How I Tried (And Failed) to Make a Discord Bot in a Week

28 Aug 2023

Ask and you shall receive

Ever since I was little, I was a very crafty person—I would make my own Halloween costumes, knit my own beanies, crochet leis, and more. One of my best creations were these plague doctor masks that my brother and I wore for Halloween! So, of course, my family and friends would ask me to make them things, and I would usually do it. For me, I am most in my element working with my hands or on physical things, so learning to code was challenging, but I did it! I was successful with the majority of the ICS 111 and 211 homeworks, and I even got A's in both classes!

So, those cool coding skills should transfer over into real life, right? ...Right?

plague doctor costumes

A reasonable request, or so I thought

After YouTube struck down music bots like Rhythm and Groovy, many of us Discord users were left without a way to stream music to voice chats. Naturally, my boyfriend asked me, "You're a computer science major, right? So, can you make a music bot for me and my friends' server?"

"Oh, of course! That should be no problem," I naively agreed. "I already know Java, so I basically already know JavaScript! I'll get it to you by your birthday!"

Now I had a deadline.

How I failed

So, I began to code, and I picked up the basics of JavaScript quickly. But not really. I've never developed any sort of software before, much less worked in JavaScript. JavaScript itself felt so familiar, yet so foreign all at once. I quickly got over the fact that JavaScript wasn't typed—in fact, I loved it and it made me more confident that I'd be able to get this done in time!

plague doctor costumes

...But at the same time, I had no idea what a function was, nor an anonymous function, and don't get me started on promises! I looked to the Internet for help, but ended up with more questions than answers: Why were the people in the YouTube videos writing their functions in all these different ways? Does it matter? What's the difference? What's a promise!?

Somehow, I managed to deploy the bot, so it appears online in the Discord server! ...doing nothing...

Let's just say, my boyfriend got a very nice custom embroidered t-shirt for his birthday, and not a functioning music bot.

Important Lessons

Luckily for me, as of writing, I am currently taking ICS 314, Software Engineering I, where we had to run through a JavaScript tutorial which immediately cleared a lot of things up for me. There are multiple ways to define a function! Anonymous functions are functions without names that aren't stored and can be called anonymously! Promises are literally promises that an asynchronous task will eventually be resolved or rejected! ...I think.

Although I am still new to JavaScript and will definitely need more exposure to these things in practice to really nail down what they mean, so far, I am loving this language! It's hard to describe, but JavaScript just feels so versatile and powerful in the things that it can do, and it feels a lot less tedious than Java. For example, in JavaScript, you don't have to write a main method or class declarations in order for you to run your code. For building web apps, JavaScript seems to be very powerful, and I can see why it's so popular.

Athletic Software Engineering

Prior to taking ICS 314, I had no idea about the Athletic Software Engineering (ASE) pedagogy. I thought that trying to make that bot in a week was fast! However, I believe that ASE will prove to be a great tool to train myself to make good, quick decisions and force myself to problem solve in a timed, sterile environment. I understand that we are allowed to use ChatGPT and GitHub CoPilot for the course, but I do not plan on using either so that I have more reason to actually learn and internalize the material.

So far, the Workouts-of-the-Day (WODs) have been fun, and I enjoy being put in a timed environment. Even if ASE does not make me a better programmer, it will make me a better decision maker under pressure. I believe any student of any discipline could benefit from doing timed assignments to simulate a high-stress environment. There will be those who sink at first, but with repetition, it will force everyone to learn how to swim. I believe this is beneficial to anyone that may work under stressful conditions.

So, my ICS 314 career will be over in December (assuming I don't flunk out, God forbid), which means that I will have gained experience and knowledge in software engineering just in time for Christmas... And that music bot still needs to be made...

Now I have a deadline.