Inspiration

Online conversations are known for getting out of hand due to a lack of monitoring and thus creating unsafe environments prone to cyberbullying. Unfortunately, even the most sophisticated chat monitoring bot fails to detect subtle hateful comments and comments in other languages and dialects. To solve this long overdue issue, we decided to develop a bot that uses AI to detect hateful meanings behind messages of all languages, even emojis and obscure internet references.

What it does

The main feature of the bot is to delete any hateful comments right after they are sent, but there are a lot of other interesting and unique features. The fallacy detector can be run as a command and analyzes past conversations to find any logical fallacies such as false analogy, hasty generalization, bandwagon, slippery slope, appeal to authority, and more. This feature ensures that participants of the conversation are well-informed of any misleading fallacies. The summarization feature can be run as a command to summarize the past conversation. The live translation feature translates every message into English. As citizens of a bilingual state, too often we only recall a word in French and not English. The grammar feature can fix even the most advanced grammar mistakes in a wide range of languages from English to Mandarin Chinese and passing by Parsi. The fact checker feature will just verify if the claim in the selected message is truthful. The ask GPT feature is just a regular GPT.

How we built it

We started development by creating a simple barebone Discord bot. We then made an event handler for messages that asks ChatGPT via the API whether the message is considered hateful or not. Then, we brainstormed a lot of chat-related features we thought would be relevant such as a fact checker, logical fallacy detector, summarization, and translation. Each of those features was implemented by first parsing the conversation and then feeding it to ChatGPT along with a sophisticated prompt that contains purpose, context, what to expect as input, and an example case to further ensure the reliability of ChatGPT.

Challenges we ran into

The biggest challenge of this project was to set up the Discord bot. it involved so much boilerplate code and the documentation on Discord's official website was massive. We spent a big chunk of our time trying to understand how we could do certain things in Discord programmatically. We also encountered a lot of issues with the unreliability of ChatGPT's answers, we had to try many different prompts for the same goal.

Accomplishments that we're proud of

We are so proud that we managed to implement all of the features we wanted. We successfully met all the judging criteria of the JAC Hacks competition. Our bot outperformed some of the most widely used Discord bots. Last but not least, we are really happy that we managed to develop a tool that can be used by many to ensure the safety of the community

What we learned

We learned how to develop performing discord bots. We also learned how to leverage the power of ChatGPT in our own applications through the use of OpenAI APIs and how to write reliable prompts.

What's next for ChatDefender

We will introduce this bot to our friends and encourage them to use it. We will carefully listen to their feedback and will use this feedback to improve the performance and the UX of our bot. Lastly, we will add more features to our bot to truly make it a one of a kind software.

Built With

Share this project:

Updates