Schedule Table Structure
The bot displays your weekly schedule as a table with three columns:| Column | Description |
|---|---|
| Jour | Day of the week (Monday-Friday) |
| Matin | Morning courses |
| Après-midi | Afternoon courses |
Weekends (Saturday and Sunday) are automatically filtered out and not displayed in the schedule.
Course Code Mappings
The bot displays courses in the format:CODE : Course Name
Here are all the course code mappings:
| Course Code | Display Name |
|---|---|
| UTC501 | Maths |
| UTC502 | OS |
| UTC503 | Programmation |
| UTC504 - IM | SI et BD |
| UTC505 | Réseaux |
| GDN100 | Gestion |
| SEC102-FC | Cybersécurité |
| SEC102-AD | Cybersécurité |
| NFP121 | Programmation avancée |
| NFP107 | SQL |
| RSX102 | Applications réseaux |
| ANG320 | Anglais |
UTC501 is displayed as UTC501 : Maths
If a course code is not in the mapping, it will be displayed as-is. Course codes starting with “SEM” are treated as empty cells.
Color Coding System
Each course is assigned a unique pastel color to make the schedule easy to read at a glance. The color system uses two components:Automatic Color Generation
Colors are automatically generated based on the course code using a deterministic algorithm:- Hash Generation: The course code is hashed using MD5
- RGB Extraction: RGB values are extracted from the hash
- Pastel Conversion: Colors are lightened to create a pastel effect using the formula:
- Each course always gets the same color
- Colors are visually distinct
- Colors are soft and easy on the eyes (pastel palette)
Implementation
The color generation algorithm (frombot.py:68-86):
Text Color Optimization
The bot automatically determines whether to use black or white text based on the background color’s luminosity:- Dark backgrounds: White text (#FFFFFF)
- Light backgrounds: Black text (#000000)
Special Cell Values
| Display Value | Meaning |
|---|---|
| FERIE | Public holiday (no classes) |
| Hors jour de cours | Not a class day |
| (empty) | No course scheduled |
When the morning slot is marked as “FERIE”, the afternoon slot is automatically set to “FERIE” as well.