Skip to content

The Telegram bot of the CLIC, cleaned up and in Rust.

License

Notifications You must be signed in to change notification settings

clicepfl/roboclic

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

822e0c6 · Sep 8, 2024

History

25 Commits
Apr 11, 2024
Dec 29, 2023
May 2, 2024
Sep 8, 2024
Oct 12, 2023
May 2, 2024
Oct 12, 2023
Sep 3, 2024
Sep 3, 2024
Dec 29, 2023
Oct 12, 2023
May 2, 2024

Repository files navigation

Roboclic V2

The Telegram bot of the CLIC, cleaned up and in Rust.

The available commands are:

  • /help: Displays a help message.
  • /authenticate <token> <name>: Authenticate as an admin user using the ADMIN_TOKEN provided in the environment variables and a name (can be any).
  • Group restricted commands:
    • /bureau: Creates a poll querying who is at the desk (in INN132).
    • /poll: Creates a quiz where you need to find the committee behind a quote.
    • /stats: Display the stats of the committee (number of polls).
  • Admin restricted commands:
    • /adminlist: List the admins.
    • /adminremove <name>: Remove an admin.
    • /authorize <command>: Authorize the current chat to use the given command (must be one of the command from the list above).
    • /unauthorize <command>: Unauthorize the current chat to use the given command (must be one of the command from the list above).

Configuration

Environment

  • BOT_TOKEN: The token provided by @BotFather to authenticate the bot in API calls.
  • ADMIN_TOKEN: The token used to authenticate admin users.
  • DATA_DIR: The directory where the bot will read/write data
  • DATABASE_URL (optional): The url of the SQLite database. Defaults to sqlite://${DATA_DIR}/db.sqlite.
  • DIRECTUS_URL: Base url of the Directus instance used.
  • DIRECTUS_TOKEN: Token for Directus RoboCLIC user.

Deployment

The bot can be run either using cargo, or the provided Docker image.

The latter is preferred, since it allows off-the-shelf use. The configuration required is the same as specified above, the config file can directly be mounted in the container.

References