MathFansDiscordBot is a Python based Discord Bot to help with streaming/lecturing during COVID-19
Create a free server at https://discordapp.com if you do not have one yet. Simply log in, and then click the plus sign on the left side of the main window to create a new server.
Go to https://discordapp.com/developers and create a new application.
Navigate to the Bot tab in your Discord application details, and click Add Bot.
Navigate to the OAuth2 tab in your Discord application details, under the scope table toggle the bot checkbox. Scroll down to the permissions and toggle administrator permissions. Copy the hyperlink MathFansDiscordBot uses administrator permissions for the Queue feature, but does not need admin permissions to take attendance.
Visit the hyperlink in your web browser and follow the instructions to authorize your Bot user.
Navigate back to the Bot tab after creating your application and create a bot user. Save the token, you will need it later to run the bot. Do NOT share the token with any unathorized users or post online
Open python from your system terminal/shell/command prompt and use the example below to install discord.py.
python -m pip install discord.py
Download the compressed ZIP file here and unzip into another folder.
To start your instance of the bot some changes are needed to the main python file. Open MathFansDiscordBot.py with a text editor such as notepad, notepad++, etc. or an IDE of choice.
On download, lines 12-14 will include the text:
# Change Per Server Deployment
token = 'bot_token'
instructor = 'instructor_ID'
current_voice_channel = 0
You must change these values to:
- Your personal token found when you created the bot account on discord (see Installation).
- Your personal instructor_id which can be found by using the Discord desktop app in developer mode and right clicking your username in then selecting 'copy id' at the bottom of the pop up menu.
- The name of the server where you would like to use this bot.
- Set current voice channel with the bot command !changeinstructor.
The resulting code block should look something like this:
# Change Per Server Deployment
token = 'D43f5y0ahjqew82jZ4NViEr2YafMKhue'
instructor = 307362705684299777
server_name = 'My Test Server'
Once you have verified that the submitted information is correct, save and exit. Then run the attached 'run.bat'
For the Student:
Command | Function |
---|---|
!attendance {student name} | logs the student to the attendance log |
!talk | adds the user to the voice queue |
!done | removes the user from the voice queue |
!queue | shows current queue to ask questions |
!poll | creates a reaction poll with format [!poll ? :] |
For the Instructor:
Command | Function |
---|---|
!start | start class, will mute users in voice chat |
!end | ends class, will unmutes all users in voice chat |
!qauto | changes questions to cycle automatically |
!qsingle | changes questions to cycle one at a time |
!next | cycles to the next student in line |
!changeinstructor {instructor_id} | changes the current instructor to a new instructor |
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.