Inspiration

Last year, in the difficult time of quarantine, our friend group held a Secret Santa around the holiday season in order to lift spirits and share some happiness with each other. In trying to set up the Secret Santa, there were many problems we ran into, ranging from finding a good website to set up the draws to messaging your receiver with questions or important information regarding the gifting process. Last year was held very last minute, and so time to solve these problems was low, and a coding project was not at the forefront of anybody's mind. This year, with ample time and knowledge from the past year, we plan to use this bot as a way to streamline and simplify the Secret Santa process for the group and others with a similar idea.

What it does

Our bot randomizes the list of discord users in a server so that they can hold a Secret Santa gift exchange with their friends. On top of this, it also allows for the users to anonymously message their receivers/Secret Santa for the purposes of sharing important information regarding the gift exchange, purchasing of gifts, or anything else that may be important to share. You can also anonymously message other people in the server, such as people who know the receiver better, so that you can get ideas for gifts or even ask about which gift might be a better for your specific receiver.

How we built it

After importing the discord API, We were able to randomize each persons gifter by either receiving a specific list of users or selecting all users from the server. Then, every Santa/receiver is stored into the Google Cloud Realtime Database, allowing the user to direct message the bot and use one of two commands in order to message their Santa or their receiver. The bot will then ask which server that the bot and the user share as mutual servers, and it will then access the respective server, and gifter/recipient from the database. The bot will ask what the author would like to send to the recipient. The text of the message that follows the question is sent to the recipient of the message. If the .dm [Discord username] command is written, the bot will ask which server that the bot and the user share as mutual servers, and then uses the discord API to access the list of users in the server to ultimately message the recipient. After the message is sent to the recipient, the bot will ask how the recipient would like to respond, and the next message sent by the recipient will be sent back to the original author of the command.

Accomplishments that we're proud of

This is the first time we used discord.py so it was we were happy that we were able to follow the API documentation to create a fun program!

What we learned

Antonio (first-time hacker): I learned how difficult and precise coding must be, and how it majorly is about trial and error, testing to figure out which line of code is causing the issue in the program. I knew the basics of Python before, but I definitely gained a much deeper understanding of the language as well as the many things it can do. Overall, I had a lot of fun doing this, and I hope to do many more hackathons in the future!

Adrien (veteran hacker): I learned how to store and receive text information in Google Cloud, which ultimately was simpler than I thought! It is definitely something I will be using in the future if I need to store any data due to it's ease of use.

What's next for ElfBot

One of the big things that we wanted to add was a system of blacklisting receivers/Santa. Since our friend group has held a Secret Santa gift exchange before, last year everybody had a receiver/Santa, and we decided that it would be best that you cannot roll the same person as last year. Also, somebody may not want to receive a certain person, so we think this is a good and natural next step to take towards improving the bot overall.

Built With

Share this project:

Updates