Getting Things Ready
To use the framework with your desired platform, whether it's Slack or Discord, you will need to install the required modules for that platform. But don't worry, installing these modules is easy and straightforward.To do this, you can follow this simple step-by-step guide, or if you're already comfortable installing packages with
pip
, you can skip to the last step!
코드:
# Python 3.6+ required
python -m venv .venv # We will create a python virtual environment
source .venv/bin/activate # Let's get inside it
pip install -U pip # Upgrade pip
pip install "T3SF[Discord]" # Install the framework to work with Discord
or
pip install "T3SF[Slack]" # Install the framework to work with Slack
This will install the T3SF framework along with the required dependencies for your chosen platform. Once the installation is complete, you can start using the framework with your platform of choice.
We strongly recommend following the platform-specific guidance within our Read The Docs! Here are the links:
- Discord
- Slack
- Telegram
Usage
We created this framework to simplify all your work!Using Docker
Supported Tags
- slack → This image has all the requirements to perform an exercise in Slack.
- discord → This image has all the requirements to perform an exercise in Discord.
Using it with Slack
$ docker run --rm -t --env-file .env -v $(pwd)/MSEL.json:/app/MSEL.json base4sec/t3sf:slack
Inside your
.env
file you have to provide the SLACK_BOT_TOKEN
and SLACK_APP_TOKEN
tokens. Read more about it here.There is another environment variable to set,
MSEL_PATH
. This variable tells the framework in which path the MSEL is located. By default, the container path is /app/MSEL.json
. If you change the mount location of the volume then also change the variable.Using it with Discord
$ docker run --rm -t --env-file .env -v $(pwd)/MSEL.json:/app/MSEL.json base4sec/t3sf:discord
Inside your
.env
file you have to provide the DISCORD_TOKEN
token. Read more about it here.There is another environment variable to set,
MSEL_PATH
. This variable tells the framework in which path the MSEL is located. By default, the container path is /app/MSEL.json
. If you change the mount location of the volume then also change the variable.Once you have everything ready, use our template for the
main.py
, or modify the following code:Here is an example if you want to run the framework with the
Discord
bot and a GUI
.
코드:
from T3SF import T3SF
import asyncio
async def main():
await T3SF.start(MSEL="MSEL_TTX.json", platform="Discord", gui=True)
if __name__ == '__main__':
asyncio.run(main())
GUI
and with Slack
instead, you can modify the arguments, and that's it!Yes, that simple!
await T3SF.start(MSEL="MSEL_TTX.json", platform="Slack", gui=False)
If you need more help, you can always check our documentation here!