Prerequisites
Before you begin, make sure you have:- A Discord account with permission to create bot applications
- A Google Sheets document with your schedule data
- Docker installed on your system (or Python 3.11+ for local development)
- Basic familiarity with terminal/command line
Step 1: Create a Discord bot
Go to Discord Developer Portal
Navigate to discord.com/developers/applications and log in with your Discord account.
Create a new application
Click New Application, give it a name (e.g., “Planning Bot”), and accept the terms.
Configure the bot
In the left sidebar, go to Bot section and click Add Bot. Confirm by clicking Yes, do it!
Enable necessary intents
Scroll down to Privileged Gateway Intents and enable:
- Message Content Intent (if needed for future features)
The current bot uses default intents, so this step is optional but recommended for future extensibility.
Step 2: Prepare your Google Sheets
Format your schedule spreadsheet
Your Google Sheets should have a structure with:
- Row 4 onwards containing schedule data (first 3 rows are skipped)
- Monthly sections with headers like “JANVIER”, “FÉVRIER”, etc.
- Three columns per month: Day, Morning, Afternoon
- Course codes in cells (e.g., “UTC501”, “NFP121”)
Share your spreadsheet
Click Share in the top-right corner and set sharing to Anyone with the link can view.
The bot expects specific month names in French (JANVIER, FÉVRIER, etc.) in the first row of data. Make sure your spreadsheet follows this format.
Step 3: Configure environment variables
Create a.env file in your project directory with your credentials:
.env
Step 4: Deploy with Docker
Build the Docker image
Build the Docker container using the provided Dockerfile:This creates a lightweight Python 3.11 container with all dependencies installed.
Run the container
Start the bot with your environment variables:
The
--restart always flag ensures the bot automatically restarts if it crashes or when Docker starts.Step 5: Test the bot
Use the /planning command
Type
/planning in any channel where the bot has permissions. The bot will generate and send an image of the current week’s schedule.Slash commands may take up to an hour to appear in Discord after first deployment due to Discord’s caching.
Alternative: Run locally without Docker
If you prefer to run the bot without Docker:Install Python dependencies
Make sure you have Python 3.11+ installed, then:Required packages:
requirements.txt
Troubleshooting
Bot doesn't respond to /planning command
Bot doesn't respond to /planning command
- Wait up to 1 hour for Discord to sync slash commands
- Check bot permissions in the channel (Send Messages, Attach Files)
- Verify the bot is online in the member list
- Check Docker logs for errors:
docker logs bot-planning
Error: 'Mois X non trouvé dans le fichier CSV'
Error: 'Mois X non trouvé dans le fichier CSV'
- Verify your Google Sheets has month headers in French (JANVIER, FÉVRIER, etc.)
- Check that the CSV export URL is correct and accessible
- Ensure your spreadsheet structure matches the expected format (data starts at row 4)
Bot crashes on startup
Bot crashes on startup
- Verify your DISCORD_TOKEN is correct and hasn’t been reset
- Check that EDT_PATH URL is accessible and returns CSV data
- Ensure .env file is in the correct location
- Check Docker logs:
docker logs bot-planning
Image shows 'Aucun cours cette semaine'
Image shows 'Aucun cours cette semaine'
- The week may genuinely have no classes scheduled
- Verify data exists in your Google Sheets for that week
- Check that course codes are recognized (see configuration docs)
Next steps
Your bot is now running! Here’s what you can explore next:Customize course codes
Learn how to map course codes to full subject names
Advanced features
Explore color customization and date handling