/crous-bot

A discord bot that send the menu of the lunch every day

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

icon Discord Crous Bot

Github Version Github License Github Last Commit Github Issues

Python Version Interactions.py Version

Author

This bot is used to display the menu of the Crous in a discord channel and to send the menu at a specific time of the day.

๐Ÿงพ Table of Contents

  1. ๐Ÿ”ง Setup
  2. ๐Ÿš€ Launch
  3. ๐Ÿ“ Commands
  4. ๐Ÿž Bugs and TODO

๐Ÿ”ง Setup

This bot now work with the API Menu Crous : you need to use it to make this bot work.

Many libraries are needed to make this bot work :

pip install -r requirements.txt
Info

If you have some troubles with the installation of the pycurl library, make sure to have installed the libcurl4-openssl-dev and the libssl-dev packages :

sudo apt install libcurl4-openssl-dev libssl-dev

To configure the bot, you need to create configuration file name .env (you can use the .env.example file as a template) :

# URL of the API with the 5000 port
URL_API="http://<URL_API>:5000"

# Token of the bot
TOKEN=""

# ID of the channel where the bot will send the menu and ID of the owner of the bot to use /echo
CHANNEL_ID=""
OWNER_ID=

# Hour of the day when the bot will send the daily message (24h format):
HOUR=
MINUTE=

๐Ÿš€ Launch

To launch the bot, you need to run the main.py file :

python3 main.py

๐Ÿ“ Commands

The bot use the slash commands to interact with the user.

Command Description
/menu Get the list of all the available menus for the day and the menus for tomorrow passed 14:00.
/menu illkirch Get the menu of the Illkirch restaurant.
/menu cronenbourg Get the menu of the Cronenbourg restaurant.
/menu paul appell Get the menu of the Paul Appell restaurant.
/menu esplanade Get the menu of the Esplanade restaurant.
/menu gallia Get the menu of the Gallia restaurant.
/echo <message> Send a message in the channel choosed by CHANNEL_ID (only for the owner of the bot using the OWNER_ID).

In adition, the bot send a message at a specific time mentioned in the .env file with the menu of the day and the menu of tomorrow passed 14:00.

๐Ÿž Bugs and TODO

  • Add the possibility to choose the day of the menu to display