Telegram bot for the Cambridge Furs group.
pip install -e .
CatBot expects to be in three groups:
- a main group where CatBot has these admin permissions:
- Add Users
- Pin Messages
- an admin group where CatBot has these user permissions:
- Send Messages
- a waiting room group where CatBot has these admin permissions:
- Ban Users
Catbot expects Privacy Mode to be turned off. That way it can read messages you give it in the admin group and waiting room group without being admin.
Catbot requires a single configuration file config.toml
containing the following fields:
bot_token = "<YOUR TELEGRAM BOT TOKEN>"
main_group_id = -1234567890
admin_group_id = -1234567890
waiting_room_group_id = -1234567890
For security reasons, this file must never be checked in.
We use ruff
to help validate the python.
ruff check main.py
- KISS and Be Beginner Friendly Keep It Simple, Stupid! CatBot aims to be easy to understand and easy to modify by non-experts. To that end, any catbot improvement must be weighed against the complexity it will introduce.
- No Caching CatBot is a low-volume telegram bot, it is therefore not necessary to cache information. This reduces complexity and prevents stale data bugs.
- Fixed Configuration CatBot does not require the flexibility of being added to arbitrary groups. It knows about the three groups it will be in, and has different behaviour for each. Having this configuration be fixed is both safer and less complex than having it be editable at run-time.
- Fail Safe Any long-running system will experience downtime at some point. In the case catbot goes down, it should be possible for admins to manually do what catbot does automatically.
- Least Privilege Catbot should have the minimal priviliges it needs. This limits the damage that any bugs can do.
-
/say
command for use in the admin group to have catbot put a message in the main group - Allow new users to join the main chat using the
/approve @username
command in the waiting room. - Welcome message in the main chat
- Welcome message in the waiting room
- Meet announcements generated from ical
- Ability to edit messages sent by
/say
- How to implement tests for Catbot? Pre-recorded json messages?
- Should meet-dates be editable via Catbot?
- Should catbot be able to read an external banlist?
- Should the welcome list be editable at run-time?
- Should there be a "safe mode" to temporarily disable automatic actions for catbot in case it causes issues?