Skip to main content

v2.0.0 Patch-Notes

ยท 6 min read
Snawe

I am happy to announce v2.0.0! ๐Ÿ˜ƒ

This update brings 2 new quality of life features, some improvements and bugfixes!

General:โ€‹

Hey guys and girls!

First of all, I am very sorry that it took soooo long for this update to come, but this update was a really huge challenge for me. Not just the programming but also with all the covid related stuff, huge work load at work and so on.. but its finally here! :)

So before we come to the "new stuff" (mostly some small fixes), I want to let you know on what I've worked. If you are not interested in the technical details, go ahead and skip to the fixes ;)

I guess most of you remember the pretty long bot downtime in the beginning of November (small side note, back than the bot was on 1200 server. Now it is on ~2100!). The downtime was related to some big discord API changes. Long story short: Before those changes the bot was able to retrieve all guilds on startup without any delay. Now the guilds are requested via hooks and there is a limit of 120 guilds each minute. That resulted in a huge increase of the bot restart time (back than 10 minutes).

Since the bot is growing constantly this wasn't really something that I could ignore and the only solution was/is using "different bots processes" instead of one. That is called sharding. Since I never did something like this before, I first thought that doing some "soft sharding" should be enough.. but I was wrong. So what I had to do was starting multiple instances/processes (shards) of the bot, giving each shard a rough amount of guilds to deal with. In theory this means; Before there was one instance running with 1200 guilds (10 minutes startup), now there are 2 instances running with each 600 guilds (startup 6 minutes).

So far, so good. Now the big problem hit me. Discord API is returning every DM on shard 0, no matter what. This means, if you execute a command on shard 1 (example create_template), shard 1 sends you a DM guiding you through the process of creating a template. However, your answer gets returned to shard 0. But shard 0 doesn't know anything about the fact that you want to create a template. It just sees a message (which most likely isn't a command) and throws it away.

This is where IPC (Inter Process Communication) joins the game. Again.. young and green as I am in this field.. I first thought "easy, let's find out all cases where a communication via DM is required and transfer them to shard 0" and I did that. Worked pretty well.. but soon I found out that there are a lot more cases where IPC is needed. To give you some examples: nearly all gear commands (because you might be in a guild in which the current shard isn't), getting the overall guild count, all commands on the webpage (webserver runs on one shard but you can handle all your guilds on all different shards there.), and a loooot more.

Since those changes were huge, I am happy that I have a hand full of beta testers (BTW: I will expand that. Maybe soonish? :) ). They didn't even noticed most of the bugs, but I saw them appearing in my log files and fixed them silently :P This leads me to my last point. I finally "got time" (actually, had to do it) to implement a better logging system :) It's still not perfect and I will improve it step by step, but it's already way better than what I had before.

Lastly, to give you a rough overview of how much I changed:

  • I touched nearly every code file for this rewrite
  • Touched about 10k lines of code

Such big changes pose a great risk of breaking a lot of stuff. However, those changes were needed and I will monitor the bot closely in the next days. If something is off, I am ready to role back to v1.6.0 or push a hotfix.

Fixes:โ€‹

  • Fixed an issue that in rare cases the wrong patreon rank was applied.
  • Fixed an issue where the bot resets premium features on a patreon server.
  • You now get proper help when using the command show_sign_up_numbers with wrong parameters.
  • You now get proper help when using the command blacklist_webhook with wrong parameters.
  • If you used the create command wrong and your input was >1024 symbols, you did not receive an error message with what went wrong. This is now fixed.
  • Fixed an issue where the template creation sometimes aborted silently if did not pass the whole message when editing sign up limits.
  • Fixed an issue where sometimes the bot aborted silently on the setup_channel when printing the existing roles on the server.
  • Fixed an issue that did not allow you to edit the emoji behavior of a custom template.
  • Fixed an issue during edit_template where the bot asked you what emoji "you want to change" even if you selected that you want to "add an emoji".
  • Fixed an issue where creating a template failed if an invalid color is used by the template.
  • Fixed an issue at create_template where the bot allowed you to enter emoji,role, which resulted in an empty name for the role. The bot now informs you that this is not allowed.
  • Fixed an issue that import_template did not take into account the patreon limits of the role silver and above.
  • Fixed some spelling mistakes

New stuffโ€‹

  • The help command had a full rework. Hope you like it :)
  • footer_text now also is a valid argument for creating/editing an event. (before it was only footer_txt and ft)
  • Add command get_template. This command returns you details about the passed template number.

Other stuffโ€‹

  • The patreon message now also prints your patreon rank
  • Fix/Improve the help of whitelist_webhook, blacklist_webhook and get_clean_mode