With school being virtual this year, my friends and I have taken to Discord as our place to study, chat, and chill. Always eager to add to our server, I thought a friendly bot would be a nice addition, and what better than a cute little corgi? Not only does it keep us laughing with its sharp little quips, but it keeps us up to speed on our science knowledge!
What it does
Once Corgi bot is added to a user's server, they type
Hi Corgi Bot in order to activate it. Corgi bot then creates a channel called
corgi-land and sends out a welcome message with instructions.
Corgi bot can:
- send random memes via the
- respond with gifs to various keywords (i.e. if a user's message includes
- give "money" to users via the
!corgi give me moneycommand (a random amount between $1 and $10), but only if they can first correctly answer a trivia question with a science theme
- help users adopt a virtual corgi for $50 (
!corgi adopt) which they can then name (
!corgipet set name _name_)
- help users buy accessories (for $5) or sell accessories (and receive $5) via the commands
!corgipet buy _item_and
!corgipet sell _item_
How we built it
Challenges we ran into
Figuring out discord.js and sequelize was particularly challenging since I had never worked with either technology before (many, many hours were spent logging and debugging). Additionally, I had never used Linode before, but luckily the Docs were very comprehensive and helpful for getting started!
Accomplishments that we're proud of
I had never built a Discord bot that actually worked, so I am proud that I now have one that my friends and I are enjoying. Additionally, I am proud that I was able to apply the skills I gained in my courses at school (specifically those surrounding databases) in a self-led project. I'm also very proud of the cute little corgis I drew!
What we learned
I learned how to build a Discord bot and implement database functionality. I also learned about the concept of asynchronous functions (and how if you're going to use a variable from an asynchronous call, you have to wait for it to be returned _or you will get an error). Another important concept I learned was about ssh access and how to host/run an application somewhere other than on my local computer (which is important if other people want to use my bot!).
What's next for Corgi Bot
I hope to keep expanding Corgi Bot's functionality in the future! Next, I would love to implement some sort of multiplayer game! Perhaps it could be related to science trivia. I would also like to play around with building a web scraper so that users could ask Corgi Bot a question, and Corgi Bot would return a relevant link/blurb from the internet!