A help queue bot for the CS 240 Discord server.
- Python 3.11+
ffmpeginstalled and available on your PATH- 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. If you're using powershell, do
python -m venv .venv
.\.venv\Scripts\Activate.ps1
Run the following commands in the VSCode terminal:
python -m pip install --upgrade pip
pip install -r ./src/resources/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 for @everyone. Keep it enabled for @TA.
- Allow Bot to Move Members between Voice Channels 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 in the src/resources directory with the following contents:
TOKEN=your-token-herebotapplications.commands
- View Channels
- Send Messages
- Read Message History
- Manage Messages
- Connect
- Speak
- Use Voice Activity
- Use Slash Commands
cd src
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, or you don't have fmpegg installed, it will still run but will not play audio. - You can customize channel names and messages in
ui/helpers/constants.py. - To run tests, navigate to the project directory and run the following in the terminal:
python -m unittest discover -s tests