@@ -18,13 +18,13 @@ The bot has the following extensions ("Cogs"):
1818
1919## Screenshots
2020### Registration Channel:
21- ![ Registration Channel] ( . /img/registration-channel.png)
21+ ![ Registration Channel] ( docs /img/registration-channel.png)
2222
2323### Registration Form:
24- ![ Registration Form] ( . /img/registration-form.png)
24+ ![ Registration Form] ( docs /img/registration-form.png)
2525
2626### Programme Notification:
27- ![ Programme Notification] ( . /img/programme-notification.png)
27+ ![ Programme Notification] ( docs /img/programme-notification.png)
2828
2929## Configuration
3030
@@ -47,10 +47,12 @@ Cache files (will be created if necessary):
4747* ` pretix_cache.json ` : Local cache of Pretix ticket data
4848* ` schedule_cache.json ` : Local cache of [ programapi] ( https://github.com/europython/programapi ) schedule
4949
50- ## Setup
51- ### Quickstart using ` pip `
50+ ## Usage
5251
53- If you just want to try the bot and skip the development setup, you can use ` pip ` (requires Python >= 3.11):
52+ This section describes how to install and run the bot.
53+ Please see below for development and EuroPython-specific deployment instructions.
54+
55+ With pip:
5456
5557``` shell
5658# create and activate virtual environment (optional, but recommended)
@@ -65,17 +67,65 @@ export DISCORD_BOT_TOKEN=... # Windows: $env:DISCORD_BOT_TOKEN = '...'
6567export PRETIX_TOKEN=... # Windows: $env:PRETIX_TOKEN = '...'
6668
6769# run the bot with a given config file
68- run-bot --config your-config-file.toml
70+ run-bot --config-file your-config-file.toml
71+ ```
72+
73+ With uv:
74+
75+ ``` shell
76+ # install dependencies in virtual environment
77+ uv sync
78+
79+ # set environment variables
80+ export DISCORD_BOT_TOKEN=... # Windows: $env:DISCORD_BOT_TOKEN = '...'
81+ export PRETIX_TOKEN=... # Windows: $env:PRETIX_TOKEN = '...'
82+
83+ # run the bot with a given config file
84+ uv run run-bot --config-file your-config-file.toml
6985```
7086
71- ### Full Development Setup
87+ ## Development Setup
7288
73- * Install ` uv ` as documented [ here] ( https://docs.astral.sh/uv/getting-started/installation/ ) .
74- * Run ` uv sync --dev ` to create/update a virtual environment with all dependencies according to [ ` uv.lock ` ] ( ./uv.lock ) .
75- * Run ` . .venv/bin/activate ` (Windows: ` .venv/Scripts/activate ` ) to activate the virtual environment
89+ NOTE: This project uses [ uv] ( https://docs.astral.sh/uv/ ) to manage Python versions and dependencies.
90+ If you don't plan to add/remove/update dependencies, you can also use [ pip] ( https://pip.pypa.io/en/stable/ ) , and any Python version >= 3.9.
91+
92+ ### Discord Server and Bot Setup
93+
94+ Follow [ Discord Server and Bot Setup] ( docs/discord-server-bot-setup.md )
95+ if you don't yet have a Bot and Server for developing the bot.
96+
97+ Expected outcome: You have a Discord Bot Token and can run a Discord Bot on a Discord Server.
98+
99+ ### Discord Server Configuration
100+
101+ Follow [ Discord Server Configuration] ( docs/discord-server-configuration.md )
102+ to configure your existing Discord Server with the expected channels, roles and messages.
103+
104+ Expected outcome: A Discord Server ready to be used for this bot.
105+
106+ ### Pretix Integration
107+
108+ This bot connects to a Pretix instance to obtain a list of valid tickets.
109+
110+ Follow [ Pretix Client Setup] ( docs/pretix-client-setup.md ) to either connect to a real Pretix instance,
111+ or to use a mock.
112+
113+ ### Python environment setup
114+
115+ * Using ` uv `
116+ * Install ` uv ` as documented [ here] ( https://docs.astral.sh/uv/getting-started/installation/ )
117+ * Activate virtual environment: ` . .venv/bin/activate ` (macOS, Linux) or ` .venv/Scripts/activate ` (Windows)
118+ * Run ` uv sync --dev ` to create/update a virtual environment with all dependencies according to [ uv.lock] ( ./uv.lock ) .
119+ * Using ` pip `
120+ * Create a virtual environment: ` python3 -m venv .venv ` (might require ` apt install python3-venv ` or similar on some systems)
121+ * Activate virtual environment: ` . .venv/bin/activate ` (macOS, Linux) or ` .venv/Scripts/activate ` (Windows)
122+ * Ensure ` pip ` version is >= 25.1.0: ` python3 -m pip install --upgrade pip ` (earlier versions don't support [ PEP 735] ( https://peps.python.org/pep-0735/ ) Dependency Groups)
123+ * Install all dependencies according to [ pyproject.toml] ( pyproject.toml ) : ` python3 -m pip install -e . --group dev `
76124* Run ` pre-commit install ` to install the [ pre-commit] ( https://pre-commit.com/ ) hooks.
77125* Run ` pre-commit run --all-files ` to verify your setup. All checks should pass.
78126
127+ ### Run the bot
128+
79129To run the bot, use the following:
80130
81131``` shell
@@ -87,7 +137,7 @@ export PRETIX_TOKEN=... # Windows: $env:PRETIX_TOKEN = '...'
87137run-bot --config your-config-file.toml
88138```
89139
90- #### Working with ` uv `
140+ ### Working with ` uv `
91141
92142This is a list of useful commands when working with ` uv ` .
93143Please refer to the [ uv documentation] ( https://docs.astral.sh/uv ) or ` uv help ` for details.
@@ -123,15 +173,23 @@ uv remove [package]
123173* Check code style: ` ruff check . `
124174* Run tests: ` pytest `
125175
126- ### Deployment
176+ ## Deployment
127177
128- The bot is deployed on a VPS using a GitHub Action .
178+ For the EuroPython conference, this bot is deployed on a VPS.
129179It uses Ansible to configure the VPS, and Docker Compose to run the bot.
180+ The deployment process is executed via a GitHub Action.
130181
131182Related files:
132183
133- * [ .github/workflows/deploy.yml] ( ./.github/workflows/deploy.yml ) : The GitHub Action
134- * [ ansible/deploy-playbook.yml] ( ./ansible/deploy-playbook.yml ) : The Ansible Playbook
135- * [ Dockerfile] ( ./Dockerfile ) : The Docker container recipe
136- * [ compose.yaml] ( ./compose.yaml ) : The Docker Compose recipe
137- * [ prod-config.toml] ( ./prod-config.toml ) : The Prod bot configuration
184+ * In this repository:
185+ * [ .github/workflows/deploy.yml] ( ./.github/workflows/deploy.yml ) : GitHub Action
186+ * [ ansible/deploy-playbook.yml] ( ./ansible/deploy-playbook.yml ) : Ansible Playbook
187+ * [ Dockerfile] ( ./Dockerfile ) : Docker container recipe
188+ * [ compose.yaml] ( ./compose.yaml ) : Docker Compose recipe
189+ * [ prod-config.toml] ( ./prod-config.toml ) : Prod bot configuration
190+ * On the VPS:
191+ * ` /root/.secrets ` : Contains ` DISCORD_BOT_TOKEN ` and ` PRETIX_TOKEN `
192+ * ` /root/livestreams.toml ` : Livestream URL configuration
193+ * ` /home/bot/registered_log.txt ` : Registration log
194+ * ` /home/bot/pretix_cache.json ` : Pretix cache
195+ * ` /home/bot/schedule_cache.json ` : Program cache
0 commit comments