Floood

Quote Bot Logo

Floood | 01/08/2023

Quote Bot.. Rewritten in C++!

For a long time now I've wanted to optimize my original Quote Bot code, as I wanted to make it run as it's own thing and not in an engine, and seeing as I was going to have it run on an external server, I decided to drop the engine and rewrite it in C++.

For the discord bot, I used the D++ library ,which can be found on GitHub! The whole bot is compliled using CMAKE, although I'm very new to working with CMAKE and it has some small issues that I have not yet figured out, but I'm learning! I'm also trying to learn how to make a system that would handle the commands and make it easy to add, however I still have a lot to learn in C++, and have not yet figured it out.

This bot currently has all the same features as the original version of the bot except for the edit feature, which I still need to complete. If you'd like to see all the features, refer to my old blog. A new thing of this bot is that it no longer uses discord's old system of doing commands (like q! or !), and it instead uses discord's slash commands. My old bot's system in godot didn't even support slash commands! This has been and will continue to be a cool learning experience for me, and I can''t wait to learn more.

I do not know how much faster writing the code in C++ is compared to godot, however the fact that gd script is an interpreted language and C++ is a compiled language, as well as Godot runs more engine features wheras C++ is quite purely the libraries, indicates that the C++ version of the bot will run quite a bit faster. I'm sure there are many ways I could optimize my code better, but I'm not experienced enough with C++ to know these techniques.

In conclusion, this complete rewrite of this discord bot has been a really fun project and a good learning experience. It is my first C++ project and I think I've done good for a first timer. This bot is not done yet, and I still have more to learn, but I'd like to see where this bot is headed! If you've read all this, thanks, and feel free to shoot me an email if you'd like to learn more!