We are aware that May is mental health awareness month, so we wanted a bot that could be used to help people when they are feeling down, or distract the user when they want to get their mind off of something. We designed this bot to be more fun and relaxed so it could hopefully help some users feel at ease.

What it does

This bot has several different commands. This bot can spin a wheel, flip a coin, or pick a person for you. There are also minigames such as dice roll which sums up several dice rolls and compares who has the higher sum. There is also a number guess where the bot picks a random number from 1 to 10 and compares it with the number the user guesses, if the user guesses correctly, the user wins! There are also some other fun commands such as a command that wishes users happy birthday or repeats back a message that the user inputs. Users can also receive jokes or fortunes if they type out “Tell me a joke!” or “Fortune time!”. The bot also replies to messages that contain negative or discouraging messages. For example, if the user has “sad” in their message, the bot will reply with an encouraging message.

How we built it

As a team, we collaborated on a Replit file to effectively code the discord bot while having frequent communication on discord to share ideas of what we wanted to achieve and inform the team on our progress on certain functions of the bot. Throughout the duration of the project, we made sure to constantly communicate our challenges, update each other on our progress, and provide assistance to each other when needed.

Challenges we ran into

We did run into a few bugs along the way, one main one being with the roll dice command. At first, we couldn’t figure out how to take input from the user, so we kept trying to mess around with 'wait_for', however, we realized we could’ve made it a lot more streamlined if we just allowed the user to put the value in the command right when they ask for it. So, we ended up changing that command a little so it was easier to code and easier to use. Additionally, as we are also all new to python, we had a bit of difficulty coding the pick a person command. We didn’t really understand how 'mention' and '' really worked, so through trial and error and a bit of research, we managed to overcome that obstacle and get our bot to successfully pick a person.

Accomplishments that we're proud of

We are so proud of our bot as a whole. As a group of students with minimal experience with python and practical coding, we were ecstatic when our bot finally worked, and at a pretty sufficient level! We are proud of overcoming and fixing many of the bugs that we stumbled upon, from little mistakes such as missing a colon or incorrect indentation, to larger errors like using incorrect logic. We are all so proud of ourselves for what we were able to accomplish!

What we learned

We learned a lot about the coding behind a discord bot! We have never messed around with coding discord bots before, so this challenge was a lot of fun and taught us a lot about the behind-the-scenes aspects of a discord bot. Furthermore, we learned about how to research and dissect code when we need help. We learned how to effectively look at how other people used certain methods in their code, and how to compare it to ours, which helped us find out how we were using certain aspects incorrectly. This was good practice because now we know how we can use research to our advantage when we are stuck while coding.

What's next for Krusty Krab Bot

There are a few bug fixes that have yet to be fixed, including there being an issue with the bot repeating a message multiple times if it echoes a message containing the word “sad”. We do in theory know how this bug could be fixed, however, during practice, it is more difficult than we had originally thought to fix. There are also several optimization options that could be imposed to make things run smoother. We could take out all the lists in the main file and put them in a different file, then we could call those lists to the main file when needed. This declutters the main file, making it a lot easier to navigate. The code could also be changed so that it is more lenient when it comes to capitalization and grammar so that the user does not have to worry about capitalization and get frustrated if they input the command incorrectly multiple times in a row.

Built With

Share this project: