Inspiration

Due to the current global situation at our hands more and more people have been finding ways to stay connected virtually. Discord has always been viewed as “for gamers” but in the past year the use case has expanded as we see for hackathons, friends and family game nights, school, discussion groups, etc.

But as days come and go the occasional servers with friends fall silent... - we need a friendly fire to light the spark again. Something that can always be there to lighten the mood or provide a warm comfortable presence. But at the same time is well integrated with the server community and makes a brutally savage joke directed to individuals from time to time.

On a more serious note, users can be quite anonymous on Discord so they may feel more comfortable communicating with strangers that way or posting about personal issues -- this can cause potential concern in extreme cases because they may be reaching out to their online community as a cry for help if they are suffering with mental health or abuse. In moments that their peers are not online an AI bot trained to recognize these signals could be just the helping hand needed to remind them of their worth.

What it does

  • The bot monitors incoming messages in the server to detect signs of distress, abuse, general negativity and based on a trained sentiment calculation decides how to appropriately approach messaging the user.
  • Conversational bot
  • Will also roast you if you joke around with it
  • An AI powered friend

How we built it

Friendly Fire bot was built from the Discord bots API. First we used a dataset of common text messages and their appropriate responses to train the bot to talk to users in a friendly or "roasty" tone. Then we implemented a system to evaluate and keep track of sentiments of recent messages for each user. The sentiment analysis is performed by deep learning models from Azure-ai-textanalytics API, while the sentiment of recent messages are managed in O(1) time using our own modified queue data structure. We created several hyperparameters, such as the number of recent messages observed, to tune the accuracy of the bot’s judgement.

Challenges we ran into

  • It was difficult to find a reliable system that accurately predicts if anyone has a significant change in mood. We tried numerous strategies: tracking everyone’s chat history would take up significant runtime and storage, while focusing on individual messages would lead to high variances in sentiment. Our solution was to track the sentiment of the 10 most recent messages for each user, which effectively puts an upper bound on storage space, while ensuring a decently accurate evaluation of the user’s mood.
  • Finding appropriate datasets for bot responses in more serious subjects
  • Missing python installation issues whoops
  • Trying to use tensorflow… trying

Accomplishments that we're proud of

Between scheduling conflicts over this weekend and trying to maintain a healthy sleep schedule but still wanting to contribute something whether big or small to the largest hackathon in Canada… the team of two was left with <12 hours of actual sit down hacking time. There were moments of mild panic but we’re proud that we learned a completely new skill on how to work with Discord bot API’s and AI training models to produce a functional project. The most rewarding takeaway is knowing that it’s possible and grateful to have not backed out in the process, leaving us excited to keep advancing the bot further and adding more impactful yet fun features down the road.

What we learned

  • Discord bots and deploying them!
  • Azure-ai-textanalytics API, read a lot about AI training models
  • For one of us, Python lol!

What's next for Friendly Fire

  • Many people have the perception that Discord is a gaming community and can come off with very “bro-vibes”, womxn are oftentimes deterred from these environments because they may not feel welcome or comfortable with this preconception in mind. Ideally we would train our bot in the future to detect unconscious gender bias towards more masculine or and sexist wording of messages. We can build a Machine Learning model and use a NLP API to train the bot to identify statistically proven gender-bias terms and based on our sentiment calculations the bot can acknowledge users and bring awareness that their messages may be contributing to this separation.
  • Incorporate a Vision API and speech processor so these signs can also be detected in attachments sent and voice channels.
  • Using more datasets to train our bot so it can join in on more conversational topics naturally
  • The fun “roast” and jokes components could be more personalized after we collect enough data, to learn inside jokes and dank memes, to scrape a user's social media if they so allow the bot to brutally roast their profiles.
  • Training our bot to detect shady/passive aggressive conversations and put out those fires because friendly-fire can be the only fire on the server sss~

thumbnail graphic, credit to owner

Share this project:

Updates

Submission history