Math Bot For Discord

The only way to learn mathematics is to do mathematics.

- Paul Halmos

I love Math. I love learning new things, I love that there is always something new to learn in the math field. I love that it connects all of the stem fields together as you can not do Science Tech or Engineering without it. I love trig and Geometry. The only thing I do not like is Calculus. I suffered through Calc I and Calc II in University and while I passed it was hard to fully grasp the concepts. I tried getting supplemental reading to help as well as studying online through tutorials and practice questions. So I took it a step further. If I could not learn it the regular way I would do what all online learning courses do: remind you to do it relentlessly untill it is easy.

robot learning math

The full project can be seen Here for download and expirementation.

What I wanted was a way to constantly remind me to learn math and study while doing other tasks. I figured the best place to do that would be where I interacted with my friends and classmates the most. That was Discord. I did some quick research on what the discord bot needed to run and all it took was some simple developer settings and a script. I needed to make the bot understand when to become active, what steps it needed to do, and how to end the interaction.

I wanted my bot to randomly come into the chat and provide a quiz question. This could be from several fields in math including Linear Algebra, Calculus, Trig, or even Geometry. You would have a set time to respond or guess at the question. If you got the question right, the bot would congratulate you and allow you to continue. If you got the question wrong or did not respond in time you would be locked out of speaking in the chat for a set amount of time. This would act like the timeout command in discord. This would give the user time to review or study instead of being distracted.

different mathematic functions on a clock to symbolize the different hour markers

This would be the most basic interpretation. I thought to go a step beyond that. It is not enough to just say 'oh you failed try again later'. I wanted to make sure the user knew what was wrong about their response so they could study properly and learn from the mistake. So instead of just timing the user out, it also puts the correct answer in the current chat so they can compare their answer to the correct one. On top of this addition, it also sends them a private message with the solution worked out to show them the step by step solution for even better studying.

Why would you not put the worked out solution in the current chat room? When designing the Bot and how they would interact in the chat it became obvious that it would get cluttered very quickly. If the original prompt asking the question was with the user response, the indication if it was right or wrong, the correct solution, and the worked out solution it would take up so much space in the chat that would be used by others. Let alone if multiple people in the same chat activated the bot individually within a short time how would one user know which to answer or what their question was? If we deligated everything to a private message between the bot and the user without posting anything in the general chat how would they know they had been messaged or need to answer a question quickly before being timed out? Lastly, if everything was only done in the general chat it would quickly become a mess as the members typing grew.

Thats why I implimented it the way I did. Only the important prompt, response and answer in the general chat and the more in depth answer in a private message to encourage learning among users in the chat as well as curiosity. Questions like 'How is that the right answer?' or 'I have not gotten a question like that. How would I do if I got a question in that field?' made me try and develop it even further. The questions are also randomized so they are never set in stone but instead randomly generated from the beginning to make it seem like an actual quiz. There is no remembering the same 4 questions to get a quick cycle. I also made it so not only are the questions random but the field of questions is random as well. You could recieve 3 Trig questions back to back. YOu could also get Linear Algebra right after basic Arithmatic. This is meant to keep you on your toes and keep the learning fun.

The last thing was how to style it. While learning can be fun for some, it takes a quick drag over the finish line to help the others. Thats why most learning brands have mascots and virtual teachers to keep them interested. You can have an amazing tool but if it is boring to use then no one will want it. I chose to use a popular meme math format for this project. Using this idea and crafting the responses around that, it was smoother and easier to make the bot more interactable. As the meme was also a major player in making this bot an idea in the first place, it also helped shape the whole project to include it in the final design.

A couple of other design aspects can be tweaked. If the creator wanted the explanation to be in the general chat, that is easy enought to put back into the output part of the script. more modules can be added or removed to suit what kind of studying you wish to get done. While I put this up for use to everyone, they can also edit the context of the app, have their teacher be the bot and what shows up, change the language, and really make it their own. When making call and response bots like this, the world is your oyster for mixing and matching. I do hope that other people pick this up and play with it and see what their spin on it is.

In Conclusion - What I Learned

Learning a new platform can be scary. When you have never done womething before the learning process can be steep. After you get past that initial hurtle though everything becomes easier to read, test, and create. I dedicated time and effort into making something that would make me better and force me to learn mroe as I went about my day to day. I found that to be the best part. Learning to inspire learning will be what helps me as I move forward in this journey.

Author, Phoenix Campbell, standing in front of his alma mater.

Phoenix Campbell

Currently looking for a job in my field, enjoys coding and workig on projects. Takes a little to learn something new but enjoys the steps it takes to get there.