Git Product home page Git Product logo

mathfansdiscordbot's Introduction

MathFansDiscordBot

MathFansDiscordBot is a Python based Discord Bot to help with streaming/lecturing during COVID-19

Installation

Create a server

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.

Create an application

Go to https://discordapp.com/developers and create a new application.

Create a Bot

Navigate to the Bot tab in your Discord application details, and click Add Bot.

Image of Adding Bot

Generating server authentication hyperlink a Bot user

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.

Image of Adding Bot

Authorizing a bot user

Visit the hyperlink in your web browser and follow the instructions to authorize your Bot user.

Image of Adding Bot

Save the Bot user token

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

Image of Adding Bot

Install the python package discord.py

Open python from your system terminal/shell/command prompt and use the example below to install discord.py.

python -m pip install discord.py

Using MathFansDiscordBot

Installation

Download the compressed ZIP file here and unzip into another folder.

Usage

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:

  1. Your personal token found when you created the bot account on discord (see Installation).
  2. 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.
  3. The name of the server where you would like to use this bot.
  4. 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'

Commands

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

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

mathfansdiscordbot's People

Contributors

hugteddy avatar lnperry avatar

Stargazers

Roman avatar

Watchers

 avatar

Forkers

hugteddy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.