Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read me updates #16

Merged
merged 21 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ To create a Discord Bot, you must:
TESTING_BOT_TOKEN={test-bot-token}
TEST_BOT_NAME={test-bot-name}
TEST_BOT_APP_ID={test-bot-application-id}
BARD_API_KEY={your-bard-api-key}
VERSION={custom bot version}
```

Expand Down Expand Up @@ -60,10 +61,11 @@ To run tests on the Teacher's Pet Bot:
TESTING_BOT_TOKEN={test-bot-token}
TEST_BOT_NAME={test-bot-name}
TEST_BOT_APP_ID={test-bot-application-id}
BARD_API_KEY={your-bard-api-key}
VERSION={custom bot version}
```
3. In `test/tests.py`, update the `TEST_GUILD_ID` to be the id of the server/guild you are testing in.
4. Start Teacher's Pet Bot by running one of the following commands in the root directory of the project:
4. IMPORTANT(You will have two bots running at once for testing. One normal bot, one test bot): Start Teacher's Pet Bot by running one of the following commands in the root directory of the project:
* Without Coverage: `pytest src/bot.py`
* With Coverage: `coverage run --source=./src -m pytest src/bot.py`
5. Run the tests with `python test/tests.py` in the root directory of the project
Expand Down
130 changes: 46 additions & 84 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
https://drive.google.com/file/d/1AN1_ogV7DrMxMMEdWf1HOMlxwH-fbyPm/view?usp=sharing

<p align="center"><img src="https://github.com/Ashwinshankar98/TeachersPetBot/blob/main/images/teacherspet.png" alt="alt text" width=200 height=200>

<h1 align="center"> Teacher's Pet </h1>
Expand Down Expand Up @@ -31,76 +29,39 @@ https://drive.google.com/file/d/1AN1_ogV7DrMxMMEdWf1HOMlxwH-fbyPm/view?usp=shari


<a name="desc"></a>
Click Below to Watch Our Video!
Click Below to Watch The Video!



https://user-images.githubusercontent.com/60410421/143972105-f5aabb10-73e3-454a-96dc-9e9d0fe5b468.mp4



<h2>Software Engineering Project for CSC 510 : Phase III</h2>
<h2>Software Engineering Project for CSC 510 : Phase IV</h2>


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.

For 3.0, we created new tools for instructors and students to use to improve course communication. Some of our implemented features were partly suggested by iteration 2 such as regrade requests, project event, and live spam checking. We implemented other features we thought would be helpful such as email interactions, link saving, and data visualization. Our main objective for 3.0 was to add more organizational tools to make a course's discord channel more than just a messenger.
For 4.0, we created new tools for instructors and students to use to improve course communication. After version 3.0's success, we decided we wanted to improve upon some of its features including spam and saved links. We also wanted to add a few more exciting features that would really drive engagement with our bot, for example, the AI chat and student ranking feature. Our main objective for 4.0 was to make using Discord a more controlled and enjoyable experience.

<hr />

<a name="features"></a>
<h2>Bot Features</h2>

<!-- Need to update this -->
[Click here to see the features of iterations I and II.](https://github.com/chandur626/TeachersPetBot/blob/update-readme/docs/feature-history.md)

<!-- Need to update this -->
<h4>Charts</h4>
Instructors (like TAs, and Professors) can quickly make graphcs and charts directly in discord to share with students/users. Instructors can use this feature to share grade distributions, lecture participation/attendance, or other course statistics. All charts are named and stored into a json file when they are created. Students have acess to a command that allows them to view previously presented charts.

<p align="left"><img width=65% src="https://github.com/chandur626/TeachersPetBot/blob/update-readme/docs/media/charts.gif"></p>

<!-- Need to update this -->
<h4>Email Configuration</h4>
[Click here to see the features of iterations I, II and III.](docs/feature-history.md)

This feature enables users to configure their email address in the system to receive important notifications, attachments from professors, assignment reminders. Users can also update, view and unconfigure a configured email address through the system.
<h4>Bard AI</h4>

<p align="left"><img width=65% src="https://github.com/chandur626/TeachersPetBot/blob/update-readme/docs/media/email-address.gif"></p>
<h4>Upgraded Spam Detection</h4>
This feature is used to detect spam in message channels. First instructors have the ability to fully customize their spam detection settings.

<!-- Need to update this -->
<h4>Email Interaction</h4>

This feature notifies all students regarding the next assignment deadline which is due for a day through email.

<p align="left"><img width=65% src="https://github.com/chandur626/TeachersPetBot/blob/update-readme/docs/media/email-reminder.gif"></p>
<p align="left"><img width=65% src="docs/media/set_spam.gif"></p>

<!-- Need to update this -->
<h4>Re-Grading</h4>

This feature provides a way for students to submit regrade requests and Instructors can collect information of the requests submitted. There are various commands included to add, update, display and remove regrade requests.
This usecase was based on regrade request submission for CSE 510 SE FALL21 mid examination.
When a user tries to send too many messages to the channel, it gives a warning. When a warned user continues to spam after this, they will be temporarily put in timeout, effectively ending their spam. This is a good feature to help keep rogue students in check, while also stopping students from spamming for rank.

<p align="left"><img width=65% src="https://github.com/chandur626/TeachersPetBot/blob/update-readme/docs/media/Regrade.gif"></p>

<!-- Need to update this -->
<h4>Link Saving</h4>

This feature is helpful to save all the messages which contain important URLs. we have built a user command "!send_links" This command lets users access all messages which contain URLs. The messages Containing URLs are automatically get appended in a file and the file is attached when the "!send_links" command is input.

<p align="left"><img width=65% src="https://github.com/chandur626/TeachersPetBot/blob/update-readme/docs/media/link-saving.gif"></p>

<!-- Need to update this -->
<h4>Project Event</h4>

This feature allows instructors or teaching assistants to create a project event by providing information such as description, link for project submission and deadline. The deadline reminder is taken care of Email Interaction feature.

<p align="left"><img width=65% src="https://github.com/chandur626/TeachersPetBot/blob/update-readme/docs/media/project-event.gif"></p>

<!-- Need to update this -->
<h4>Spam Detection</h4>
This feature is used to detect spam in message channels. When a user tries to send too many messages in the channel, it gives a warning. This is useful when multiple users are trying to send mutiple messages. The warning lets the student know that they have sent too many messages.

<p align="left"><img width=65% src="https://github.com/chandur626/TeachersPetBot/blob/update-readme/docs/media/Spam-Detection.gif"></p>
<p align="left"><img width=65% src="docs/media/spam.gif"></p>

<hr />

Expand All @@ -113,47 +74,27 @@ In addition to the packages from [requirements.txt](https://github.com/tanmaypar
* [Python 3.9.7](https://www.python.org/downloads/)
* [Sqlite](https://www.sqlite.org/download.html)
<!-- Are there any changes here? -->
To install and run Teacher's Pet, follow instructions in the [Installation and Testing Guide](https://github.com/Ashwinshankar98/TeachersPetBot/blob/main/Installation.md).
To install and run Teacher's Pet, follow the instructions in the [Installation and Testing Guide](Installation.md).


<a name="testing"></a>
<!-- Are there any changes here? -->
<h2>Testing </h2>

To run tests on the Teacher's Pet, follow instructions in the [Installation and Testing Guide](https://github.com/Ashwinshankar98/TeachersPetBot/blob/main/Installation.md#Run-Tests).
To run tests on the Teacher's Pet, follow instructions in the [Installation and Testing Guide](Installation.md).

<hr />
<!-- Are there any changes here? -->
<a name="commands"></a>
<h2> Bot Commands </h2>

<h3> Bot commands from iteration III </h3>

<h3> Bot commands from iteration IV </h3>

:open_file_folder: [!regrade-request command](https://github.com/chandur626/TeachersPetBot/blob/main/docs/Regrade/Regrade.md)

:open_file_folder: [!update-request command](https://github.com/chandur626/TeachersPetBot/blob/main/docs/Regrade/Regrade.md)

:open_file_folder: [!remove-request command](https://github.com/chandur626/TeachersPetBot/blob/main/docs/Regrade/Regrade.md)

:open_file_folder: [!display-requests command](https://github.com/chandur626/TeachersPetBot/blob/main/docs/Regrade/Regrade.md)

:open_file_folder: [!chart command](https://github.com/chandur626/TeachersPetBot/blob/update-readme/docs/charts/charts.md)

:open_file_folder: [!check_chart command](https://github.com/chandur626/TeachersPetBot/blob/update-readme/docs/charts/check_chart.md)

:open_file_folder: [!create_email_command](https://github.com/chandur626/TeachersPetBot/blob/update-readme/docs/email_address/create_email.md)

:open_file_folder: [!view_email_command](https://github.com/chandur626/TeachersPetBot/blob/update-readme/docs/email_address/view_email.md)

:open_file_folder: [!update_email_command](https://github.com/chandur626/TeachersPetBot/blob/update-readme/docs/email_address/update_email.md)

:open_file_folder: [!remove_email_command](https://github.com/chandur626/TeachersPetBot/blob/update-readme/docs/email_address/remove_email.md)

:open_file_folder: [!project_event command](https://github.com/chandur626/TeachersPetBot/blob/update-readme/docs/events/project_event.md)
:open_file_folder: [!set_spam_settings command](docs/spam/set_spam_settings.md)

<br>
<h3> Bot commands from iteration I and II </h3>
<h3> Bot commands from iteration I, II and III </h3>

`!setInstructor <@member>` Set a server member to be an instructor (Instructor command)

Expand Down Expand Up @@ -187,6 +128,30 @@ To run tests on the Teacher's Pet, follow instructions in the [Installation and

`!stats` Gets the statistics of system and softwares used

`!regrade-request` This command lets a student add a regrade-request

`!update-request` This command lets a student update an existing regrade-request

`!remove-request` This command removes a regrade request

`!display_requests` This command lets a student display all regrade requests

`!chart` This command lets admins make a custom chart of any type with any size of dataset

`!check_chart` This command lets students/users check any chart if previously created

`!create_email` This command enables users to configure their email address to receive important reminder notifications and attachments

`!view_email` This command enables users to view their configured email address

`!update_email` This command enables users to update their configured email address

`!remove_email` This command enables users to delete their configured email address

`!create -> press project button` This command enables users to create a project



<hr />

<a name="fscope"></a>
Expand All @@ -195,17 +160,14 @@ To run tests on the Teacher's Pet, follow instructions in the [Installation and

This bot has endless possibilities for functionality. Features which we are interested in adding but did not have time for include but are not limited to:

* Custom Events
* Allow events to be edited
* Show error information on discord
* Make Instructor commands private
* Add new roles
* Track participation and user ranking
* Adding detailed error display integration to the bot
* Add Tutor role
* Add ways for users to lose exp in the rank feature(spamming etc)
* Add commands so an instructor can customize how rank exp is awarded(what for and how much etc)
* Refactor code to use cogs
* Save data charts on DB rather than locally in json
* Store data based on user emote reactions to instructor messages

For a detailed description of each of the above future enhancements listed visit [Future Scope](https://github.com/chandur626/TeachersPetBot/projects/2).
* Add a gibberish detector that deletes comments that are irrelevant to the class
* Funnel the AI chat responses to a limited set(so AI only answers questions an instructor wants them to answer)
* Upgrade to a better chatbot API that is free

<hr />

Expand Down
52 changes: 52 additions & 0 deletions docs/feature-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,55 @@ Since the bot is hosted on cloud ( In this case Heroku ). Its crucial to know th
For the purpose of Debugging and maintaining the bot `!stats` command has been added to keep track of CPU usage, Bot up time, Bot version, No. of users and Memory usage.

![alt text](https://github.com/Ashwinshankar98/TeachersPetBot/blob/main/images/stats_command.png)

<br>
<h2> Iteration III </h2>

<h4>Charts</h4>
Instructors (like TAs, and Professors) can quickly make graphcs and charts directly in discord to share with students/users. Instructors can use this feature to share grade distributions, lecture participation/attendance, or other course statistics. All charts are named and stored into a json file when they are created. Students have acess to a command that allows them to view previously presented charts.

<p align="left"><img width=65% src="https://github.com/chandur626/TeachersPetBot/blob/update-readme/docs/media/charts.gif"></p>

<!-- Need to update this -->
<h4>Email Configuration</h4>

This feature enables users to configure their email address in the system to receive important notifications, attachments from professors, assignment reminders. Users can also update, view and unconfigure a configured email address through the system.

<p align="left"><img width=65% src="https://github.com/chandur626/TeachersPetBot/blob/update-readme/docs/media/email-address.gif"></p>

<!-- Need to update this -->
<h4>Email Interaction</h4>

This feature notifies all students regarding the next assignment deadline which is due for a day through email.

<p align="left"><img width=65% src="https://github.com/chandur626/TeachersPetBot/blob/update-readme/docs/media/email-reminder.gif"></p>

<!-- Need to update this -->
<h4>Re-Grading</h4>

This feature provides a way for students to submit regrade requests and Instructors can collect information of the requests submitted. There are various commands included to add, update, display and remove regrade requests.
This usecase was based on regrade request submission for CSE 510 SE FALL21 mid examination.

<p align="left"><img width=65% src="https://github.com/chandur626/TeachersPetBot/blob/update-readme/docs/media/Regrade.gif"></p>

<!-- Need to update this -->
<h4>Link Saving</h4>

This feature is helpful to save all the messages which contain important URLs. we have built a user command "!send_links" This command lets users access all messages which contain URLs. The messages Containing URLs are automatically get appended in a file and the file is attached when the "!send_links" command is input.

<p align="left"><img width=65% src="https://github.com/chandur626/TeachersPetBot/blob/update-readme/docs/media/link-saving.gif"></p>

<!-- Need to update this -->
<h4>Project Event</h4>

This feature allows instructors or teaching assistants to create a project event by providing information such as description, link for project submission and deadline. The deadline reminder is taken care of Email Interaction feature.

<p align="left"><img width=65% src="https://github.com/chandur626/TeachersPetBot/blob/update-readme/docs/media/project-event.gif"></p>

<!-- Need to update this -->
<h4>Spam Detection</h4>
This feature is used to detect spam in message channels. When a user tries to send too many messages in the channel, it gives a warning. This is useful when multiple users are trying to send mutiple messages. The warning lets the student know that they have sent too many messages.

<p align="left"><img width=65% src="https://github.com/chandur626/TeachersPetBot/blob/update-readme/docs/media/Spam-Detection.gif"></p>

<hr />
Binary file added docs/media/set_spam.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/media/spam.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions docs/spam/set_spam_settings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# About !set_spam_settings
This command lets instructors set their own customized spam settings

# Location of Code
The code that implements the above mentioned gits functionality is located [here](../../src/spam.py).

# Code Description
## Functions

- async def set(ctx): <br>
This function prompts the instructor (only inside the instructor commands channel) for what settings they would like to apply the spam detector. For example, instructors are allowed to set how many messages per unit of time a student is allowed to send before they are warned of spamming, and when they are timed out. Also they are allowed to set how long the timeout will last. Then the function takes all the input prompts and places them into the database so the spam detector knows how to do its job correctly.

# How to run it? (Small Example)
Enter: "!set_spam_settings"

This will be followed by the prompt: How many messages should a user be able to send before they are put in timeout?

Enter how many messages a user should be able to send before warned of spam: "3"

This will be followed by the prompt: How many messages should a user be able to send before they are put in timeout?

Enter how many meesages a user should be able to send before they are put in timeout: "4"

This will be followed by the prompt: How much time should users have to send 3 messages before they will be warned and then eventually put in timeout?

Enter the unit of time (in seconds) over which students are allowed to send 3 and 4 messages without being warned of spam and timed out respectively (In other words what you enter in how much are users allowed to send x messages. If the user sends x+1 messages in this amount of time, then they will be accused of spamming): "10"

This will be followed by the prompt: How long should a user be placed in timeout when caught spamming? Format: min,hours,days Example: 5,0,0 is 5 minutes

Enter the amount of time a user should be placed in timeout in the format outlined above: 10,0,0

Below is an example of using the !set_spam_settings command:
<p align="center"><img width=85% src="../media/set_spam.gif"></p>

Successful execution will result in a spam detector similar to below.

<p align="center"><img width=85% src="../media/spam.gif"></p>

# Use Case Example
Let's say you are an English professor and you have a class discord that you use for your live classes. Let's say you often ask multiple questions at once to your students. For example your class just read a book and you send out 10 questions for them to respond to on the chat. Some students may answer all 10 questions very quickly, so quickly in fact they could be banned by the default spam settings since if they send more than 5 messages in 15 seconds they will be banned for spamming. Luckily, our teacher's pet bot offers the !set_spam_settings command such that you can change the number of messages to 15 for days where you will be asking multiple questions at once. Then when students answer your question very quickly, they won't be accused of spamming. But even still, if a mean student set a spam bot loose on the discord it would be banned for spam if it broke your new set threshold. So with our highly customizable spam command, you can set your spam settings to meet whatever needs you require.
Loading