Skip to content

CambFurs/CatBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cambfurs Catbot

Telegram bot for the Cambridge Furs group.

Building

pip install -e .

Permissions

CatBot expects to be in three groups:

  1. a main group where CatBot has these admin permissions:
    • Add Users
    • Pin Messages
  2. an admin group where CatBot has these user permissions:
    • Send Messages
  3. 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.

config.toml

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.

Contributing

Automated checkers

We use ruff to help validate the python.

ruff check main.py

Design principles

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. Least Privilege Catbot should have the minimal priviliges it needs. This limits the damage that any bugs can do.

Roadmap to Minimum Viable Catbot

  • /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

Nice-to-haves

  • Ability to edit messages sent by /say

Open questions

  • 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?

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages