I’m a coach at BeCode, and I need to make sure my learners are actively participating in the online Discord class. To simplify this process, I built this bot.
The bot randomly checks the number of learners connected to the voice channels in a specific class category on Discord. This allows me to monitor attendance without manually checking each session.
- Counts learners in the “Bouman-9” category and its voice channels.
- Sends the count to a “remote-attendance” text channel.
- Sends messages twice a day: once in the morning and once in the afternoon at random times.
- Does not run on weekends to avoid unnecessary activity.
- Fully logs actions for debugging and tracking.
- Deployed as a Container App on Azure using GitHub Actions
- Set up the bot on Discord and invite it with permissions to read channels, view voice channels, and send messages.
- Set the environment variable
DISCORD_TOKENwith your bot’s token. - Run the bot:
python discord-bot.pyThe bot will automatically send attendance messages at random times during the day (morning and afternoon) on weekdays.
- Ensure the bot has access to the category and the text channel.
- All scheduling uses Brussels time (UTC+1/UTC+2 with DST).
- The bot automatically skips weekends (Saturday and Sunday) and campus days (Monday/Wednesday).
- The bot only counts learners in voice channels; it does not track text activity.
- All actions are logged to the console for monitoring and debugging.