WIP Discord Bot written in Python
quartzbot/
├── compose.yaml
├── Dockerfile
├── LICENSE
├── README.md
├── requirements
│ ├── base.in
│ ├── base.txt
│ ├── development.in
│ └── development.txt
└── src
├── __init__.py
├── bot.py
├── cache.py
├── cogs
│ ├── __init__.py
│ ├── music
│ │ ├── __init__.py
│ │ ├── cog.py
│ │ └── views.py
│ ├── text
│ │ ├── __init__.py
│ │ └── cog.py
│ └── voice
│ ├── __init__.py
│ └── cog.py
├── main.py
└── utils.py
Create a .env
file at the repository root. This is essential as otherwise the bot will be have no way of connecting to Discord.
Example .env
file (also see .env.example):
DISCORD_TOKEN=foo
GUILD_ID=bar
Create a virtual environment for the project. PyCharm can do this (add a local interpreter option), otherwise:
cd quartzbot
python3 -m venv venv
Activate the virtual environment from repository root like so:
source venv/bin/activate
Preferred method is with uv
rather than pip
:
pip install uv
uv pip install -r requirements/base.txt -r requirements/development.txt
When adding new requirements, first add the package name to base.in or development.in
To compile the requirements:
uv pip compile --generate-hashes requirements/base.in -o requirements/base.txt
uv pip compile --generate-hashes requirements/development.in -o requirements/development.txt
Once you have set up your dev environment, start the bot like so:
docker compose up --build
# use `-d` to detach