After nearly two years of mostly minor updates, I'm proud to finally present the next major version of LiBot. Primarily, this update cleverly addresses the verification requirement plaguing the previous release - instead of verifying the bot and submitting an image of my ID for discord and their partners to process, I opted to split LiBot between multiple bot users. This means that you will be able to add it to your guilds again! Doing so ensures that each individual user stays below 100 guilds, while the collective bot can reach as many guilds as needed. All instances (internally named shreds) act as one, with any cross-guild features able to access guilds in other shreds. Needless to say, guilds are limited at most one shred to avoid taking up more of the system's capacity than needed.
While most important, this is actually the smallest part of the update - more or less the entire codebase has been rewritten. Over time, it had accumulated large chunks of unnecessary code that made it hard to maintain, especially considering I've only been adding to it since LiBot's inception in 2017, with a few refactors. Since I've also taken the time to remove all hard-coded tokens and secrets, I will be able to release the source officially on git.zajc.tel and GitHub.
I will likely resume working on LiBot. As discord has been increasingly restrictive towards bots, I will probably focus on making LiBot compatible with other platforms - Matrix would be a good start. I will possibly also be reimplementing some of the removed features, such as *leaderboard
and *mathquiz
(more on that later).
Below is a non-exhaustive list of additions, changes, and removals I've made to the bot and everything related to it in this release. Since this is such a large release that took a while to make, I will probably miss a few things, but the most important things are listed.
-
Added: shredding support! As already described above, this will allow LiBot to exceed the 100 guild limit without requiring verification. This also comes with a diagnostic *shredder
command.
Unfortunately, this also comes at a cost - since the legacy LiBot instance is already present in more than 100 guilds, I will not be able to add it to the system without first removing the excess (600 or so) guilds. This will be necessary after August 31, 2022, as this is the deadline for the message content intent. Effectively, this means that discord will no longer supply LiBot with the content of sent messages, which it requires for commands to work. An alternative to that would be migrating to discord's "slash commands", but I have reservations about doing that (primarily the poor state of the slash commands UI in the client, and that it would not address the verification issue).
This means you will be required to readd LiBot to your guild! Fortunately, doing so is easy (as long as you have the 'Manage Server' permission. All you have to do is click the link, and follow the authorization prompt's instructions.
An unintended side-effect of shredding is a much faster start-up time for LiBot. Discord limits the number of guilds that can be loaded to about 100 per minute, and because I load all of them on startup, it ended up taking some 7 minutes to load all of them. As all shreds are limited to 100 guilds, they never hit the ratelimit, and load all of the guilds instantly.
-
Added: a website for LiBot (you're looking at it right now). I have been postponing this for far too long, but it was unavoidable with the addition of shredding, as the website is responsible for load-balancing the shreds between guilds, such that the shred with the least guilds is picked on the /get route.
On top of that, I will be hosting changelogs and documentation for LiBot here (once I get around to writing it). I also host an e-mail inbox here, which means I can offer support over e-mail if there's any use for that.
I should probably note that the website's design is inspired by bedrocklinux.org's.
-
Changed: *calculator
now uses Qalculate! as the backend (replacing EvalEx). Qalculate! supports numerous functions, constants, and unit conversions. It can solve equations, integrate, perform complex number arithmetic, and much more (it can also plot graphs, but LiBot does not support that as it would require a bit more involved use of Gnuplot).
-
Changed: guilds are now able to run more than one poll at the same time (up to 10). Likewise, users are able to have more than one reminder set (not limited).
-
Changed: *blackjack
has been rewritten from scratch. It should now follow the game's rules better.
-
Removed: the entire Messaging
command category (that's *mail
, *message
, *message
, *blockuser
, *unblockuser
, and *getblocked
). *feedback
stays and has been relocated to the LIBOT
category.
These commands could be used for sending unsolicited messages, and I feel like it's not possible to make blocking unwanted users intuitive enough, even with blocking commands in place. Spam could previously be avoided by simply blocking the bot itself (not a good solution but works nevertheless), but this would no longer work as the bot is now split between multiple users (via shredding). It is impossible to tell whether a user has blocked the bot (without trying to send a message at least), so I could not simply apply a block of one bot to all of them.
-
Removed: *backup
and *restore
. They were two of the longest commands in the bot (754 sloc for backup, 583 for restore!), were written in a rather unmaintainable manner, and served no purpose after the addition of server templates.
-
Removed: *getid
. This was primarily needed as a "user-friendly" way of getting user IDs for use with the (now removed) messaging commands. There is no reason to keep this around, especially since Discord lets you copy snowflake IDs via the right-click context menu when developer mode is enabled in the settings (which is arguably less tedious than using *getid
in the first place).
-
Removed: *leaderboard
. This might get added as a guild-local feature, but I felt like displaying usernames and discriminators of users from other guilds by default (even with a not-so-obvious way of opting out) is not a very clever thing to do. On the other hand, simply making it opt-in would likely render it useless, as I doubt people would bother to do that.
-
Removed: *mathquiz
, which relied on a dependency I no longer maintain and was written rather hastily with pretty poor writing standards. This meant having an out-of-tree dependency (that wasn't in any repository, so I'd have to take care of that too), which would make building LiBot more tedious for no good reason. The idea was pretty nifty, so I might readd it in the future.
-
Removed: *audioplayer
. The codebase of this command was incredibly messy, as well as rather poorly structured (the entire thing was powered by one long while(true)) loop. It was essentially an interactive way to call music commands, so I don't think rewriting it would justify the effort.
-
Removed: *rewind
, as it was just a shortcut for *seek 0
.
Other minor changes:
-
Changed: *akinator
now displays akitudes (the little emotes in the corner) using the same logic as en.akinator.com (yes, they're not random).
-
Changed: *uno
no longer highlights possible placements (because there was no reason for it to in the first place).
-
Changed: *dice
now displays a different emoji based on the rolled number.
-
Changed: *lenny
now constructs random emoji itself instead of relying on a web API.
-
Changed: *urbandictionary
now sorts entries correctly (or at least as close as I could get).
-
Changed: the *money
hourly reward curve has been flattened a bit.
-
Changed: *help
's format (both for the command list and for command usage help) has been revised, so it should hopefully be easier to read.
-
Changed: LiBot now uses replies for most messages.
-
Changed: most commands (even the ones not listed here) have an updated interface.
-
Removed: *declutter
, *maintenance
, and *threaddump
, which are purely administrative commands, so that shouldn't matter too much to end users.