Inspiration
After a few months of dry club Discord servers, it can be hard to expand your network and find people with similar interests. We hoped to facilitate new introductions between members of an existing community, making it a little easier for all of us to feel more connected in our digital communities.
What we added for LA Hacks
- Support for
@everyonemention when sending out surveys - Made text channels private using new
discord.pyfeatures - Added automated testing and deployment with GitHub Actions
What it does
Match Bot Com lives in a club or workspace's Discord server and provides functionality for generating meaningful pairings between members based on personality survey responses. It can DM survey forms to server members and store their responses. Match Bot Com has matching functions that pair off users based on the similarity of their survey responses and connects them in their own channel for further interaction.
How we built it
We used the Discord API library for Python, discord.py. We collected our data with Google Forms and stored it in a Google Sheet. We used Google Cloud's Sheets API to access our form data in the program, which we used with pandas to rank similarity of questionnaire responses. We implemented a Stable Roommate algorithm with the Python package matching that optimized our pairings.
Challenges we ran into
Out of the gate, the first challenge was trying to figure out which APIs to use within the flow of our application. Discord and Slack were both viable options to implement our bot in, but we ended up choosing Discord due to its accessibility to our immediate clubs. Setting up Google Sheets was especially challenging, as initially while OAuth keys worked for establishing a connection into a specific sheet document, we could not depend on these for our final hosting. Therefore, our implementation had to use Service keys, which were a little more nuanced to implement.
With the actual backend generation itself, parsing through the Discord’s API structure itself was a large task. There are a huge number of subclasses, each of which have their own specific usages, and actually understanding which functions would help us send commands to users and create text channels between users.
Getting specific user IDs from usernames was an unexpected problem we had, where there were many functions to return a server’s Member based on full ID, but none to associate ID with name. We solved this by creating a reverse lookup table to reassociate names with ID.
Deployment presented a new set of obstacles, where setting up a Google service account to handle the Google Sheets API was difficult to implement with Heroku’s deployment services, specifically in terms of setting up the environment needed and clearing dependencies.
Accomplishments that we're proud of
We are all proud that we came out of this hackathon with a deeper understanding of how to use APIs to make real-world applications. Many of our accomplishments came in the ways in which we overcame difficult obstacles while developing our bot, such as limitations within Discord’s API and being able to find clever workarounds.
What we learned
One of the many things we learned from this hackathon is how to work as a team. Our final product would not be possible if it weren’t for the collaboration and cooperation of each team member.
We learned about Git workflows and reproducible package management in Python. We all learned about Discord’s bot API and reading data from Google Sheets with the Sheets API.
What's next for Match Bot Com
We would love to see some of our favorite campus clubs using Match Bot Com in their own Discord servers (perhaps... ahem... ACM). We could also see any group using the bot by substituting in their own form. We want to expand support for custom forms and more question types.
Log in or sign up for Devpost to join the conversation.