Skip to content

qchen59/TeachersPetBot

 
 

Project 3 Demo video: https://youtu.be/V9sb925ljWE

alt text

Teacher's Pet

Streamline Your Class Discord

Build Status Coverage Status DOI Python License: MIT GitHub GitHub issues GitHub closed issues GitHub release (latest by date including pre-releases) GitHub all releases Platform Lines of code

Click Below to Watch Our Video! Watch the video

Software Engineering Project 3 for CSC 510

Teacher's Pet is a Discord Bot for class instructors to streamline their Discord servers. Discord is a great tool for communication and its functionalities can be enhanced by bots and integrations. There are many tools for organizing classes, but they are often hard to manage. They rarely have good communication mechanisms or ability to connect with other tools. This bot allows instructors to host their classes on Discord, combining communication tools with functionality for assignments, scheduling, and office hours. Instructors and students no longer have to go between platforms to view course details, forums, events, calls, and more.

Bot Commands

📂 !setInstructor Set a server member to be an instructor (Instructor command)

📂 !ask Ask a question

📂 !answer Answer a question

📂 !oh enter Enter an office hour queue as an individual student

📂 !oh enter Group ID Enter an office hour queue with a group of students

📂 !oh exit Exit the office hour queue

📂 !oh next Go to next student in queue as an instructor (Instructor command)

📂 !create Start creating an event (Instructor command)


📂 !addhw This command lets the user (either the TAs or professor) to add a homework as a reminder to the discord channel

📂 !changeduedate This command lets the user update the due date.

📂 !clearreminders This command lets the user delete all the reminders irrespective of courses or homeworks.

📂 !coursedue This command lets the user display all the homeworks that are due for a specific course.

📂 !deletereminder This command lets the user delete a reminder for a specified coursename and homework.

📂 !duethisweek This command lets the user display all the homeworks that are due this week for all the courses.

📂 !duetoday This command lets the user display all the homeworks that are due today for all the courses.

📂 !listreminders This command lets the user display all the homeworks that are due for all the courses.

📂 !notify This command lets the user display all the homeworks that are due this week for all the courses.

📂 !whois This command lets the Instructors get information about the member using his/her username.

📂 !multipoll This command lets the Instructors create a poll with specified number of choices ( 2 to 10 ).

📂 !poll This command lets the Instructors create a poll with 2 choices.

📂 !take and 📂 !eventcsv The eventcsv command lets instructors get a example CSV of all the events in a course. You can download the csv and upload it back to the bot with the take command. This will let you add all the events to the calendar in one go. When using the take command, drag the csv to discord and use the take command in the comment as you upload it.

📂 !voice_channel This command lets the Instructors create vocie channels.

Installation and Running

Tools and Libraries Used

In addition to the packages from requirements.txt which need to be installed, please have the following installed on your machine:

To install and run Teacher's Pet, follow instructions in the Installation and Testing Guide.

Testing

To run tests on the Teacher's Pet, follow instructions in the Installation and Testing Guide.

For Developer

API Documentation

To better help developers, the API documentation can be found here API Documentation

TeachersPetBot Features

Initialization

When Teacher's Pet has been added to a new server as a bot, it will do the following:

  • Create a new role called Instructor with Administrative permissions if one does not already exist
  • Add the owner of the guild to the Instructor role
  • Create a #q-and-a channel if one doesn't already exist
  • Create a #course-calendar channel if one doesn't already exist
  • Create 4 voice channels for one to one interaction with TAs
  • Create 40 voice channels (one for each group) with a limit of maximum 6 participants

In addition to this auto-set up, there is also a command which allows a user with the Instructor role to give the same role to another user. This command will only work for users with the Instructor role already (for example, the guild owner).

alt text

Q&A

The Q&A functionality allow students to ask and answer questions anonymously. The questions are numbered and when answers are sent, they are combined with the question so they can be easily found. Answers are also marked with Student Ans and Instructor Ans to distinguish between the sources.
To ask a question, type !ask "Question" in the #q-and-a channel. Example: !ask "When is the midterm?".
image
To answer a question type !answer <question_number> "Answer" in the #q-and-a channel. Example: !answer 1 "Oct 12".

!qna

Events/Calendar

Events are items relevant to a class that are time-sensitive. Currently, the types of events include office hours, exams, and assignments. Events in a class are kept track of, and assignments/exams are displayed in a calendar for students and instructors to see.

Events can be created by instructors. Creation of an event can be initiated in the private instructor-commands channel with the !create command. The bot will ask the instructor about various details for the event. Once the event is created, it should exist persistently within the system and will be added to the event list.

The calendar is updated at the creation of any new event that gets displayed on the calendar. Everything is ordered by date and sorted into two categories, past events and future events. Links attached to assignments are displayed in the calendar as well. The footer of the calendar is tagged with the last time it was updated.

image

Office Hours

The bot contains functionality for handling TA office hours. After a TA office hour event is added and it is time for a TA's office hour to open, the bot will automatically create office hour channels in the server, allowing students to enter the office hour queue and instructors to help students based on the queue. Once the closing time for the office hour is reached, the channels related to the TA's office hour are automatically deleted.

image

Polling

The bot contains functionality for polling with 2 choices (choose one) and multi-choice polling with specified number of choices (2 to 10). The polls can only be created by the Instructor and commands to create them can only be used in instructor-commands channel.

image

image

Member Information

The bot contains functionality for getting information about a member using the username of the member. The command can only be used by the Instructor in instructor-commands channel. It retrieves the Display Name, ID, Account Creation Date and Time, Date and Time of joining the Server, Roles and the Highest Role of the member.

image

Take Event CSV

The bot contains functionality that lets Instructor get an example CSV from bot using !templates command and upload it back to the bot using !importevents command. This lets Instructor add all the events in one go.

Notification Module

This command lets the user display all the homeworks that are due this week for all the courses. Whenever a user wants to be reminded about an upcoming project/assignment he/she can just use a notification command to get the bot to remind the user about the same. Notification can also be sent to email or text.

!notifyme !notifyme !notifyme

Profanity Censoring

Using the Python package better-profanity, Teacher's Pet will catch profane words sent by members of the guild, delete the message, and re-send the exact message with the bad word(s) censored out. It will also catch profane words in messages which have been edited to incude bad words. This package supports censoring based off any non-alphabetical word dividers and swears with custom characters. NOTE: Currently the Bot does not censor swears which have had extra alphabetical characters added.

alt text

Releases

  • All releases

  • v3.0: First functional release

  • v3.1: Custom Events function

  • v3.2:Command specific voice channel creation and other bug fixs

  • v3.3: Parse uploaded csv

  • v3.4: Expand testing and API documentation

What’s new in V3

Event creation improvements

In V2, the calendar was not getting updated upon event creation. This has been fixed in the new version. Furthermore, the event creation subroutine is updated with looping and error checking. Now the user will not have to start over if they enter an invaid input. Also, users can now exit the process properly at any point by simply typing ‘quit’.

Custom events

Instructors of the course can now add custom events to the calendar. The database is updated to cater to this and the calendar is improved to have a new section called ‘special events’ to showcase custom events.

Documentation improvements

To better help the developers. The entire code base is updated to have docstrings of pdoc3 format and subsequently a new API documentation was generated.

Command specific voice channel creation

Now teachers' pet bot supports command specific voice channel creation. Users can input the number of voice channels, the category name, the channel name, and max limit to create channels.

Voice channel fix

In V2, the teachers’ pet will report an error when generating the voice channels if there is a channel not in a category. We fix the auto voice channel creation bug in V3.

Get the channel Id when sending the notification

In V2, the Teachers’ pet remainder is only functional in one specific channel from the original discord server(The server from the V2 team). In V3, we modified the method, so it can get the current channel ID and the remainder is working in a new channel.

Parse an uploaded csv to check for reminders and events

The previous group had started on this but it was, however we wound up essentially completely recreating the flow for how this feature should operate.

Fix old unit tests

The previous group was starting to transition their unit tests into another system. Their old system, where they used a separate bot to run tests, had a large number of issues such as not being able to see which specific tests failed when something was not working. We transitioned the old unit tests into using the Dpytest library, which required rewriting almost all of them since the previous group had only converted 4 tests.

Future Scope

  • Track Participation of Students and their Ranking
  • Sentiment Analysis of messages being sent on the server
  • Attendance Tracker
  • Conversion of bot to JavaScript
    • Data VisualizationExport data as graph(attendance)
    • Create a visualized table for events and remainders.
  • Link Collection
  • Calendar improvements
    • When drawing the calendar, events without starting/ending times should indicate it specifically (or show nothing), instead of showing a 0.
  • Cloud Hosting
  • Upload bot to a hosting server, and also add bot to the top.gg, or discord.bots.gg

For a full list of future features, upgrades, and bug fixes, please visit our Project 3 Board.

How to Contribute?

Check out our CONTRIBUTING.md for instructions on contributing to this repo and helping enhance this Discord Bot, as well as our Code of Conduct guidelines.

License

This project is licensed under the MIT License.

Team Members

Qiuyu Chen

Parth Jinturkar

Yasitha Nisansala Rajapaksha

Hugh Wright

Jiacheng Yang

About

TeachersPet is a Discord Bot for class instructors to streamline their Discord servers

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Python 100.0%