A help queue bot for the CS 240 Discord server.
This bot manages a help queue in Discord, with TA controls, automatic queue open/close announcements, and voice notifications using MP3 files in the resources/ folder.
- Python 3.10 or newer (3.11+ recommended)
ffmpeginstalled and available on your PATH for voice audio playback- A Discord application with bot token
Go to https://www.python.org/downloads/. On Windows, enable "Add Python to PATH" during installation.
Open the project folder in VS Code.
Important
Step 3 is optional, but highly recommended
Refer to the internet for help on this one. It's different depending on your system.
Run the following commands in the VSCode terminal:
python -m pip install --upgrade pip
pip install -r requirements.txtRun the following command in the VSCode terminal:
ffmpeg -versionThe bot expects the following channel and role names by default. Names are case-sensitive and must match exactly.. If you use different names, update ui/helpers/constants.py.
- Text channels:
help-queue-chatta-bot-chat
- Voice channels:
Online TAsIn Person with StudentWaiting RoomBreakout Room ABreakout Room BBreakout Room C
- Roles:
TABot(so you can give it channel-specific permissions manually)
Suggested permissions:
- Restrict channel management server-wide.
- Allow Bot to Move Members server-wide.
- help-queue-chat: @everyone restrict messages/threads, etc. Keep reactions enabled. @TA and @Bot all permissions.
- ta-bot-chat: @everyone cannot see the channel. @TA and @Bot all permissions.
- Online TAs: @everyone cannot join the channel. @TA and @Bot all permissions.
- Waiting Room/Breakout Rooms: @everyone all permissions
- In Person with Student: @everyone cannot join the channel, but they can see it. @TA and @Bot all permissions.
1. Go to the Discord Developer Portal: https://discord.com/developers/applications
3. Under the Bot section, enable the "Message Content Intent" because the bot uses message_content=True.
Create a file named .env with the following contents:
TOKEN=your-discord-bot-token-herebotapplications.commands
- View Channels
- Send Messages
- Read Message History
- Manage Messages
- Connect
- Speak
- Use Voice Activity
- Use Slash Commands
python bot.py- Use the command for the students' help queue buttons in help-queue-chat
- Use the command for the TAs' help queue buttons in ta-bot-chat
Note
If the commands don't show up, try restarting your discord client. Sometimes it takes a minute or two to sync the commands.
- If the bot cannot find the
resources/folder or no MP3 files are present, it will still run but will not play audio. - You can customize channel names and messages in
ui/helpers/constants.py.