This is an app that generates a html file with information about future discord events.
It uses discord.py
to connect to a discord server, fetch data, and then generate an html file.
Output file is generated based on a template that can be modified.
This app is docker ready. Assuming docker and docker-engine are installed run docker-compose up --build
.
Make sure to set DISCORD_AUTH_TOKEN
and GUILD_ID
environment variables.
This app uses python 3.11
. Earlier version might work, but they're not tested.
This app uses poetry for managing dependencies. Ensure it's installed locally.
- Create a local environment with
python -m venv .venv
. - Activate virtual env
source .venv/bin/activate
- Install dependencies with
poetry install
- Provide environment variables
- create a .env file and put environment variables there
- (alternatively) prepend the command in the next step with them like so
DISCORD_AUTH_TOKEN="code" GUILD_ID="id" python main.py
- Run the app
python main.py
DISCORD_AUTH_TOKEN
str - auth token of a botGUILD_ID
str - id of a guild the bot is supposed to retrive events from
HTML_LOCALE
str default =en_uk
- which language should be used for generating names in the output data (like weekdays)HTML_OUTPUT_PATH
str default =PROJECT_ROOT/output/output.html
- where to save generated html fileLOGS_DIRECTORY
str default =PROJECT_ROOT/logs
- where logs should be savedDISCORD_LOG_LEVEL
str default =INFO
- what level of messages should be logged from the discord.py libraryAPP_LOG_LEVEL
str default =INFO
- what level of messages should be logged from the app