Kiltisbot is a bot that provides many telegram integrations to Guild of Physics' services. Its features e.g. printing Guild's calendar events to telegram user and digital stoke system for Guild's candy closet. Try it: https://t.me/@Fk_kiltisbot
Using kiltisbot requires python3 and the Poetry package manager.
Activate virtual environment with
poetry install
poetry shellConfigure the bot by copying bot.env.example to bot.env and filling in the missing parts. For the production configuration reach out to the Guilds tech team.
After configuring the bot, you can run it with
mkdir data/ # Create directory for SQLite DB
poe runRun & detach. Copy Google credentials to google_service_account_creds.json and set up bot.env in project root. Docker will create or mount a data/ directory for the SQLite DB and create kiltis.db file there.
docker-compose up --build -dFor production deployment, use the production docker-compose file that uses the pre-built image from GitHub Container Registry:
docker-compose -f docker-compose.prod.yml up -dBot is configured with environment variables. File bot.env.example contains all variables that are needed to enjoy full functionality of kiltisbot. Copy file and name it bot.env and fill missing parts.
For the production configuration reach out to the Guilds tech team.
The calendar functionality and Drive backups use a Google service account. This can be created in the Google Cloud Console. The service account needs to have the following permissions:
- Google Calendar API (read-only)
- Google Drive API (read-write)
The sheets used for backup need to be shared with the service account email ([email protected]) with edit permissions for the backup to work.
Drive backend uses same token as calendar module. Drive backend enables importing and exporting database with telegram commands that are only available for admin users.
The bot provides access to weekly newsletters through two commands:
/viikkotiedote- Get the current weekly newsletter in Finnish/weekly- Get the current weekly newsletter in English
The newsletter data is fetched from an external API endpoint configured via the NEWSLETTER_BASE_URL environment variable. The bot formats the newsletter content and sends it as an HTML-formatted message to users.
Many. Some of them are documented in the source code as TODO comments. You can find them by typing
grep -r TODO $(ls -I env)in the roof folder. Opening new issues in Github and sending pull requests is welcomed.