Inspiration

Inspired from the desire of change, we aim to provide safer spaces for all discord users.

What it does

Pingyu will constantly monitor discord text channels for any messages that contain hateful speech, violent remarks, and or misinformation. Utilizing the power of OpenAI's ChatGPT-3.5, we are able to constantly monitor for such messages and hide them accordingly. Pingyu also keeps track of users' reputation score and will penalize any misconduct.

How we built it

Using OpenAI's API for their ChatGPT-3.5 model, we were able to connect it to or discord bot API. The discord bot API will constantly send messages that users send in a given server to the ChatGPT API for interpretation. The LLM will return to us a label (SAFE or NOTSAFE), an explanation for why it was flagged, and a safety score ranging from 0-100 which will be used to determine how much reputation will be taken off from a user.

Challenges we ran into

We initially had difficulty setting up the discord bot to output information in the correct format. This was quite a tall hurdle to get through, but our bot team managed to fix it. Another problem we had run into involved prompt engineering for ChatGPT. It was a bit tricky to get the LLM to generate text in a specific format, but with some help, we were able to get it done. The problem with the formatting went into one of our functions which is why this was needed to be fixed ASAP!

Accomplishments that we're proud of

We were very surprised and pleased that the discord bot does close to exactly what it needs to do and even more!

What we learned

For some of us, it was our first time using git and github, while for others, we had the opportunity to guide each other through the github workflow. This ultimately taught us how to work in teams and collaborate on a project at the same time.

What's next for ethiks-pingyu_discord_bot

We were unfortunately unable to implement image classification for the specifications indicated above, so we are eager to continue our work on Pingyu and truly polish the bot to do even more content moderation.

Built With

  • chatgpt
  • discord.py
  • discordapi
  • openai
  • python
Share this project:

Updates