Inspiration
The inspiration to develop this bot came from an experience when we were talking on a discord server and we encountered an unfortunate situation where a group of people were passing lewd comments on women as well as people of other races and origin. Most of the people who were there in the server simply ignored it and this behavior didn't concern them hence they didn't pay much attention to the incident. This was the time we thought of building a bot which can curb any type of harassment and racism. The bot would constantly monitor the chats of the server and take necessary actions if any person tries to disturb the decorum of the server !
What it does
The bot would scold the user who use offensive language and give warnings to the user. If the user still doesn't mend the ways, the bot would kick the user out of the server. The bot basically checks if any person while using offensive words, crossed a threshold. If the user crossed a threshold, then they are kicked from the user and the kicked user also gets a mail that they were kicked due to inappropriate behavior.
How we built it
We first collected a long list of cuss words, discriminatory and racial slangs. First we created a bot from discord, copied its credentials of oAuth2 and permissions accordingly in our local server and made the files and code accordingly. After making the bot online, it becomes active and can function now. Now if any user send any message on discord, then we check if any of the listed word is present in the message and we mark the user in our local storage indicating the offensive behavior from that particular user to further check any kind of offensive behavior in future. If the message contains any listed word, then the bot send warnings to the user to not to use such words. If the user continues to use the offensive language then the bot kicks the user off the server. We implemented data structure trie to store the offensive words to speed up message analyses and fast decision by the bot. We implemented all of this in Python using discord.py library to ensure smooth functioning of the bot. We used notivize's mailing service to send mails to the kicked user. We then pushed the hosted our bot on heroku to be used globally 24/7 anywhere.
Challenges we ran into
The first challenge we encountered was the formation of a team. Since this is our very first hackathon, we didn't have much idea about how to form team with someone with similar interest to ensure smooth work flow. So after successful team formation we both had to think little different and innovative to create something creative and practical. We wanted our idea to be focused on solving real life problems so we came up with an idea to create a discord bot. After some research we found out discord.py library in python which can be used to make bots but still the challenge was how to code it because both of us have used python earlier but we were new to discord.py library. So after brainstorming and some research we finally figured out how to use the library. After learning this, hosting the application on heroku was still a big challenge because none of us had an experience how to do it. Notivize's API was also a new domain to be tried so this was also a challenge to get into. So there are some of the challenges we got into.
Accomplishments that we're proud of
We are proud of working as a team being the first hackathon and this was our first time working on discord library and heroku. We also learnt how to set up a bot using its own credentials of oAuth2 and making it global so these are some of the accomplishments we are proud of through this hackathon.
What we learned
First and most important thing that we learnt was to how to function as a team and assign the tasks to all the teammates accordingly. We learnt to use discord.py library as well as insights of heroku while working on the bot. We also learnt how to use notivize's API to send mails and we also learnt how to distribute work amongst various teammates to ensure smooth functioning of the project.
What's next for Anti-Discrimination Bot
We are planning to integrate it with Machine Learning models to make the analyses more faster and accurate. We are also planning to give its appropriate access to admins of the server so that they can efficiently monitor whole of the server.
Built With
- discord
- python


Log in or sign up for Devpost to join the conversation.