.env file in your project root using the python-dotenv library.
Required Variables
Your Discord bot authentication token. This token allows your application to connect to Discord’s API and interact with servers.Location in code:
bot.py:18The URL or file path to your CSV file exported from Google Sheets. This CSV contains your schedule data in the required format.Location in code: Example values:
bot.py:19- Google Sheets CSV export URL:
https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID/export?format=csv - Local file path:
/path/to/your/schedule.csv
Setup Instructions
Add environment variables
Open the Replace:
.env file and add your configuration:your_discord_bot_token_herewith your actual Discord bot tokenYOUR_SHEET_IDwith your Google Sheets document ID
How It Works
The bot loads environment variables at startup using:Troubleshooting
Bot won’t start:- Verify your
.envfile is in the same directory asbot.py - Check that
DISCORD_TOKENis set correctly - Ensure there are no extra spaces or quotes around the values
- Verify
EDT_PATHURL is accessible - Check that the Google Sheets CSV export link is publicly accessible or properly authenticated
- Test the URL in your browser to ensure it downloads a CSV file