Inspiration

Discord is a platform that is used by many across the word, so when we were brainstorming ideas, and our platform we were using is discord and many people from our group have experienced cyberbullying and language barriers when using discord, this is the project that we decided to work on.

What it does

This discord bot first picks up sound from the discord voice channel using the discord library, subsequently, it saves the sound in a .pcm file which then gets turned into a string format which could be used in processing. There are two ways that this data could be processed, it could either use the google translate package to turn the string into another language which is then read using Google's Text-To-Speech package. This sound is saved as a .mp3 file which can later be read by the discord bot in a voice channel. Another way this data can be processed is after the string is produced, we loop through the string and check our .json file for potentially offensive words, each offensive word has a relative rating which would later be sent into the TiDB Serverless MySQL database where there is a table storing all of the violations in a discord call. This data could later be accessed with a web app that is built with retool which allows for sorting, searching, updating, creating, and deleting the data.

How it is built

This discord bot is built with multiple Google npm packages as well as APIs which helped do all of the natural language processing required. The web app is built with retool as it allows for a quick way to connect to a serverless framework from a web app along with easy-to-build tables and other functionalities. TiDB is used to host the database and the discord API is used to build the main framework of the discord bot and the ability for it to listen to voice channels as well as to speak in voice channels.

Roadblocks

A couple of roadblock we hit was first connecting the database and deploying the database on TiDB because we found out that it isn't compatible with Windows so WSL had to be used to help with the deploying process, in addition, a lot of time was spent trying to connect the bot to the database because we didn't know we had to include a .pem file in the package. On the discord side, a roadblock is connecting all of the packages together and learning about the discord API.

What we learned

We learned how to use the discord API as well as numerous Google APIs that use AI to do natural language processing. Those APIs include translating, text to sound, and sound to text. Finally, we learned about hosting a MySQL database on a Serverless Framework and connecting the framework to a web app as well as connecting it to the discord bot with the MySQL package on npm.

Next Steps

A couple of next steps for the app include rebuilding the web app in React which allows for further flexibility. In addition, we also aim to do all of the language processing in real-time if possible rather than having the user speak for a couple of seconds and then there is audio playback.

Built With

Share this project:

Updates