Bot for the Cryptic Discord Server
- Python 3.10
- Poetry + poethepoet
- Git
- Docker + docker-compose (recommended)
- PyCharm Community/Professional (recommended)
git clone --recursive git@github.com:PyDrocsid/CrypticBot.gitgit clone --recursive https://github.com/PyDrocsid/CrypticBot.gitAfter cloning the repository, you can setup the development environment by running the following command:
poe setupThis will create a virtual environment, install the dependencies, create a .env file and install the pre-commit hook.
To set the required environment variables it is necessary to create a file named .env in the root directory (there is a template for this file in bot.env). If you need a token, generate one by following these instructions: Creating a Bot Account (Note you need to enable the options under Privileged Gateway Intents)
Project
├── bot
│ ├── cogs
│ │ ├── custom
│ │ │ ├── <cog>
│ │ │ │ ├── translations
│ │ │ │ │ └── en.yml
│ │ │ │ ├── __init__.py
│ │ │ │ ├── api.py
│ │ │ │ ├── cog.py
│ │ │ │ ├── colors.py
│ │ │ │ ├── models.py
│ │ │ │ ├── permissions.py
│ │ │ │ └── settings.py
│ │ │ ├── contributor.py
│ │ │ ├── pubsub.py
│ │ │ └── translations.py
│ │ └── library (submodule)
│ │ ├── <category>
│ │ │ └── <cog>
│ │ │ ├── translations
│ │ │ │ └── en.yml
│ │ │ ├── __init__.py
│ │ │ ├── api.py
│ │ │ ├── cog.py
│ │ │ ├── colors.py
│ │ │ ├── documentation.md
│ │ │ ├── models.py
│ │ │ ├── permissions.py
│ │ │ └── settings.py
│ │ ├── contributor.py
│ │ ├── pubsub.md
│ │ ├── pubsub.py
│ │ └── translations.py
│ ├── bot.py
│ └── cryptic_bot.py
└── config.yml
- Open PyCharm and go to
Settings➔Project➔Python Interpreter - Open the menu
Python Interpreterand click onShow All... - Click on the plus symbol
- Click on
Poetry Environment - Select
Existing environment(setup the environment first by runningpoe setup) - Confirm with
OK - Change the working directory to root path ➔
Edit Configurations➔Working directory
Finally, please remember to mark the bot directory as Sources Root (right click on bot ➔ Mark Directory as ➔ Sources Root).
# clone git repository and cd into it
git clone --recursive https://github.com/PyDrocsid/CrypticBot.git
cd CrypticBot
# build docker image
sudo docker build -t pydrocsid/crypticbot .
# adjust the docker-compose.yml and create a .env file
cp bot.env .env
vim .env
vim docker-compose.yml
# start redis, database and bot using docker-compose
sudo docker-compose up -d# install poetry and poethepoet
pip install poetry poethepoet
# create virtual environment and install requirements
poetry install --no-root --no-dev
# start the bot
poe bot