Changelog

View the entire public changelog of SajuukBot and secondary services!

SajuukBot is a constantly evolving bot, gaining new features and bug fixes on a monthly rollup performed towards the end of each month.

This page intends to document all changes made to the bot for transparency. Often many changes are implemented and cannot fit into a discord message on the support server, so this is our way of letting you know of those changes!

This changelog only includes updates from the release of the Sapphire codebase, on 2nd December 2020. Anything prior to that will not be included, due to them being irrelevant.

2022-09-03

There's been very few changelogs this year, because I have been very busy. This changelog will probably be the last "major" update for the bot, because I cannot guarantee that my time will allow me to work on a huge update. That being said, I've done my best to get the bot into a place where it is reasonably stable and does not require significant interventions unless Discord breaks things in places.

New Features

  • Button Roles! This actually happened a long time ago, but its official that SajuukBot now uses Buttons as a form of self-role management. It replaces Reaction Roles, which can no longer be created.

  • Forum channels are also fully supported by SajuukBot, which are effectively just regular text channels that only allow threads to be made, but with a much nicer UI surrounding them. Not every server has access to them at the time of writing, but once you do get access, there will be no issues.

  • SajuukBot now supports the native Discord AutoMod. This means if you set up an automod rule with the native feature to block messages, the bot will still know about them for moderational reasons. Refer to the sample config for how to set up modlogging relating to the automod if you're interested.

    • Due to a Discord API limitation, the bot requires Manage Server to be enabled for the modlog entry to be generated when the Discord AutoMod blocks a message based on a configured rule. If you do not need this message to be generated, and would prefer to rely upon the AutoMod notification messages instead, you can just not grant this permission and there will be no impact to how the bot handles a blocked AutoMod message.

Changed

  • The !server command no longer displays counts of how many people are online, away, on dnd or offline. That is because this information was tied to the Presences privileged intent and that intent is no longer enabled because the bot does not require it for anything.

  • The sanitising function used by the bot internally across virtually anything that took in UGC was replaced by a much simpler version that just calls two utility functions provided by discord.py. The previous function, which did sanitising on a controlled basis, is deprecated and may be removed in a later deploy.

  • Messages in modlogs now always suppress embeds and will never ping anyone, even if the sanitisers fail to escape a URL or a ping for whatever reason. They were changed to ensure AllowedMentions was set to None and that suppress_embeds was set to True, when sending the messages.

  • Several strings were converted to use f-string formatting. This is an on-going optimisation project which will eventually be completed by the time that language packs are supported, which requires more time to work out a "reusuable" strategy for handling the dynamic changing of the string output.

  • The internal error handlers have been simplified somewhat. Not a very notable change, but might as well mention it lol.

Fixed

Some of these fixes might have already been mentioned before. Since so much time has passed between the time I implemented these fixes and this changelog, I don't remember what was already live, so I'm noting them here for completeness.

  • The !info command now properly shows the default Discord avatar they're assigned if they do not have an avatar actually set.

  • The bot accidentally skipped parsing a right-click ban or unban if the permission for Administrator was not enabled, even if the bot had View Audit Log. This obvious permissions calculation error has been fixed.

  • Sometimes, the metrics task failed to send data if the websocket latency was not an integer or the value represented infinity. If the value is infinity, the task does not process it any longer and waits until the next processing time before attempting againn.

  • In some rare cases, trying to send a "Ping!" message to the latency channel when testing the REST API latency led to a Discord exception which was not checked for. Now, the bot just exits out of the loop if it cannot test REST API latency at that moment in time.

  • The generic messages intent within the discord.py library code was enabled for the bot which allowed it to receive messages in its DMs. Considering that this bot has no functionality in DMs, the intents were changed so the bot only receives on_message events for messages sent in servers.

  • Attempts were made to fix a query performance issue within the member_join event, whereby the bot would appear to crash / freeze in some rare cases. While the query was partially fixed, the issue was attributed to extremely large raids of 50+ accounts joining in a single second consuming all MariaDB connections, so a longer term fix was put in place to provide more available connections in the pool.

  • A confusing error message when no one could be banned using the !mban command has been fixed, by including other reasons why there was no one to be banned with the command.

  • Messages which had the type discord.MessageType.reply were simply ignored by the bot if they were deleted. This is no longer the case, they will now be logged correctly.

  • Use of !vkick always led to an "Oops!" error being displayed, even though the command successfully kicked users from voice channels. That error was caused by not storing the voice channel the member was in before the kick, so by the time of the modlog message, it was always going to be NoneType. This coding error was fixed, so now it doesn't send useless error messages.

  • Deleting an invite code always failed with an error, due to a variable typing error, which has been fixed.

  • When updating the bot configuration in real-time, as a result of someone doing so via the dashboard, the guilds' premium status (currently an undeveloped and unused feature) was erased from the in-memory dictionaries. This bug has been fixed (however, no one will notice it because premium status in the bot isn't a thing right now).

2022-05-12

Changed

  • When using the !lock and !unlock commands, more permissions are now revoked to account for the multitude of additions by Discord. These include permissions associated to threads (creating them and sending messages in them) as well as the use of slash commands in bots that have them.

Fixed

  • Changing the region of a voice channel now correctly submits a modlog entry, due to a bug where the bot was erroneously assuming the region attribute was an enum instead of a string. "Automatic" is now displayed if the attribute is None.

  • Various bugs with the new onboarding process were fixed. Most of this revolved around the automatic DM the bot attempts to send if the server it is added to doesn't meet requirements (it is sent in the first channel it can write in, if the DM fails).

2022-04-17

Well its been quite a lot of months since the last changelog! So much has happened that prevented me from having the time to dedicate towards putting out a big update, but todays the day in which lots of things have changed! Lets dive right into the changes:

Backend

  • SajuukBot has been upgraded to the latest discord.py master branch version. Discord.py you say? Yep, Danny revived the project and has been hard at work bringing it up to scratch with the latest Discord API changes.

  • All packages -- where possible to upgrade in time for this update -- have been upgraded to newer versions. There's a few packages which can not be upgraded, due to them requiring a complete overhaul that is not a priority for the time being.

  • Several database tables have been tuned and optimised where possible to improve their performance. This will just be an ongoing process over time, which will no longer be documented on this page going forward.

It's worth noting that SajuukBot does fully support the forum channels feature that Discord is developing, in that it will log when they're created/updated/deleted. At this point in time, there is nothing special about forums that are worth documenting or supporting here, as really they're just a placeholder for people to create threads, with a fancy UI for them.

New Features

  • Experiments! For a long time, every new feature has had to be released straight into the Production environment, with only the ability to test things locally. Going forward, eligible guilds will now be able to enable and test new features in the Production environment, by being enabled for an experiment. Think of this as similar to Discords' own experiments system, but a little more simpler than what they use.

    • The first feature to make use of this is an experiment relating to migrating some servers from Reaction Roles to Button Roles. For more information about this, please refer to the #button-roles-migration section on that page.

Changed

A lot of things have been changed internally, so aren't worth documenting, but the following public facing things were changed:

  • Scam phrases are no longer part of the bad words censor, they're now a heuristic. This means you'll need to add a new config block to enable the functionality.

    • At the time of writing, scams in chat have pretty much died out, but if you want to enable them, you can now do so without impacting the bad words censor.

    • It's worth noting that the scam filter applies across the server and is not per-channel restricted.

  • Two phrases are now a permanent part of the bad words censor and can no longer be opted out from: they are the n-bomb and the f-bomb (referring to the slur, rather than the slang relating to sexual acts).

  • Some users failed to notice the difference between a user and a member being returned by the !info command. To make it more clear, the message body in this command has been tweaked so now it refers to "Member" if the given mention, id or name refers to someone who is in the server.

  • If your server is larger than 75,000 members, then the ability for SajuukBot to log bans which are triggered by the use of the context menu option when right clicking users is disabled. This is because of technical limitations, notably that audit logs in such large guilds are no longer reliable to poll for when banning. Logging bans in such guilds can only be done through the !ban command.

  • Presence and activities data are no longer displayed in the output of the !info command. That is because SajuukBot will be getting verified soon [at the time of writing], and it would not meet requirements to be granted access to a Privileged Intent that would display this data (Discord does not consider displaying presence/activities data in an !info command to be a valid use case of the Presences intent).

  • The bot now checks if you meet its member requirements automatically after being added to a server. This removes the process of using the form and being whitelisted manually. Depending on who added the bot, that user will receive a DM outlining that they didn't meet the requirements and the bot will leave.

    • If the bot cannot DM the person who added the bot, it will attempt to post the message in the first writeable channel it can find, before leaving.

    • It is worth noting that the allowlist and blocklist systems remain in place and those will take precedence over the member requirements. These exist to ensure that bot developers can override the requirements in certain circumstances. Users can not apply to be placed on the allowlist.

  • SajuukBot now shows who deletes a thread, as the audit log entry can now be returned. At the moment, this cannot be disabled, but in the next update, I will be adding configuration settings under the "events" config to turn off thread related stuff.

  • Due to an enforced API change, polling and caching the entire ban list of a guild is paginated in chunks of 1000 bans. If your ban list is very large, this can potentially be a slow operation on startup, however efforts will be made to try and speed up the caching of ban lists in future.

  • Although nobody ever used the bot on servers with Store Channels, the bot did previously support logging when they were created, updated or deleted. As they no longer exist, they have been replaced by references to Forum Channels instead.

Fixed

There were a LOT of bug fixes in this update. Some of them were associated to just upgrading the bot code so aren't notable here, but some of the public facing bugs which were fixed are below:

  • In certain random situations, when users sent a message, the "author" property was erroneously a discord.User object. As this does not contain enough data for a large number of features, this was causing silent error failures with things like automoderator, preventing all functionality working for them. While the reasons for that property being a User -- not a Member -- are unknown, a fix was put in place to ensure this does not cause issues again.

  • Due to an obscure Discord API bug (or perhaps due to the scale that the bot now operates on), chunking guilds on startup became very erratic and unreliable. The bot now just quickly boots itself, readies itself with the gateway, then chunks every guild one by one.

    • This was fixed quite a while ago, but is being documented here for transparency.

  • Adding or removing roles from a moderator standpoint was failing to check if no roles were passed, returning an error. The bot now properly warns about "not passing roles".

  • Filters and Heuristics were erroneously using a channel mentioning format in its mod log posts which would lead to confusion if they were triggered in Threads. The bot now correctly uses the unified format so as to remove that confusion.

  • If you were not the creator of an infraction and your maximum effective level was not above that of the creator, then attempting to update the infraction reason was erroneously returning a message that made sense back when the system only looked at things in a very binary manner of "no permission, public command, moderator, administrator". However, that system has not been in use for a few years, so the response was confusing. The response now clearly refers to "maximum effective level" if you cannot edit an infraction reason.

2021-12-28

This changelog concerns only the Dashboard, no new bot functionality has been introduced. Let's hope 2022 is better than 2021 (but somehow, I doubt it....)

Changed

  • Use of Firefox to access the Desktop-based Dashboard is unsupported at this time. There's been multiple reports that the Dashboard doesn't load anything correctly for Firefox users. While some are not impacted, the majority are and its not currently possible for me to dedicate time to fixing the source of the problem, or even to diagnose why Firefox will not load JS files properly. Until a later point in time, Firefox users must either use an alternative browser for the Dashboard or make use of an extension that allows impersonating other browsers within Firefox.

    • The latter recommendation is not supported by any developer of SajuukBot, use with caution!

New Features

  • The dashboard now has a mobile-centric theme! Something lots of people have been asking for. Config editing is now actually possible as the mobile theme uses a mobile-friendly YAML editor, not Ace. The following caveats apply:

    • The mobile theme was only tested and designed to be used in landscape mode. Portrait mode may work, but this is unsupported and bugs won't be fixed for this.

    • Reaction Roles cannot be managed on Mobile, because the Discord mobile app doesn't make it easy enough to get emote ID's. To use the Reaction Roles UI on the dashboard, you must be on Desktop!

    • The desktop-based theme for the Dashboard is now unsupported for use on Mobile. Although it can be accessed, most functionality doesn't work there, or only partially works, creating a poor experience. Stick to the mobile theme on mobile devices!

2021-11-09

Changed

  • The tempmute and tempban commands have been hard-capped to a maximum of one year. This limit was imposed because of several servers abusing the unlimited "timestamp" functionality by setting tempmutes or tempbans several thousands of years into the future which would not expire at all. It will not be increased for any reason.

  • The internal global blocklist of Discord scams have been updated with new phrases as required.

2021-10-12

Fixed

  • !tempban would return a generic error message despite appearing to "succeed", this was caused by a faulty query immediately after the bot response that it "succeeded".

2021-10-09

Fixed

  • Blank configurations (those containing just "---") failed to load properly, causing the bot to fail to load any other configurations after the failed one. The bot now skips past trying to load the empty configs, though still populates other lists to ensure that, when the config is updated to contain meaningful data, it will not cause issues.

2021-08-18

Changed

  • When using !mban, the bot now @ mentions whoever invoked the command. The purpose behind this is to let the invoker know that the bot is waiting for you to confirm or reject the request, in the case when the bot takes a while to process user input.

Fixed

  • A bug where !mmute was erroneously trying to print the whole list of members who were given to the command, rather than a count of the number of elements in the list, has been fixed.

2021-07-27

This is a relatively major update to a lot of things in the bot, while improving in a LOT of areas to make things better. It's worth pointing out a lot of stuff that changed in this update was mostly internal things to improve the performance of the bot, and fixed a few bugs that cropped up.

New Features

  • SajuukBot supports Threads on Discord. At the time of writing, this feature is not available to any server due to it being restricted to servers with just 5 members or less in them. However, once the feature is fully released, you can be sure that SajuukBot will not have any issues dealing with Threads abuse.

    • It's not necessary to mention SajuukBot in threads to make it "show up" in the list. If its a public thread, it will see the messages sent there as necessary and commands will work as expected. Note that for private threads, you must give the bot the "Manage Threads" permission to log anything from it or use bot commands.

    • At this time, when a thread is created or deleted, modlogs will always be generated. The action type for these is THREAD_action, where action is CREATE or DELETE respectively. In a future update, it will be possible to suppress the log post messages in config by toggling off an event: however backend logging that allows tracking threads will not be turned off by doing this.

    • THREAD_DELETE does not include the person who deleted the thread at this time. This is currently a limitation of discord.py and will be resolved as soon as the library includes the action type for thread deletions.

  • The ban list of every server using the bot is now cached in Redis in their own individual key. The point of this is to not query Discord just to check if someone has been banned from a server. To be clear: only the member IDs of banned users are stored in Redis and nothing else. ID's are unique and are not deemed to be personal data, so this is not a problem.

  • Hardly a new feature but I added another pointless meme command to the bot. Refer to the Sample Config to find out what one was added. 😉

  • Global blacklists for malicious domains and phrases have now been added. It's no longer required to manually censor specific things that collectively impact many communities. People who do not want to make use of the global blacklists can add global opt-out: true for both the words and domains censor features in their configuration.

  • Not even worth mentioning, but since people keep asking for one, its been added: !help is a thing, but it only tells you to go read this docs site. 🤣

Changed

  • Confirmation votes using Reactions have been replaced by Confirmations using Discord's buttons feature from the Bot UI Kit. This means no more rate limiting regarding reactions and a clean experience that works just the same as reactions did.

    • There is a known issue where the checkmark and cross emotes used in these buttons are barely visible. This will be changed in a future update, but the button colours and their labels should make it very obvious what you should do.

  • Onboarding process has been changed. Going forward, the bot will no longer create the full generic configuration when the bot is added to a guild. Instead, only an empty document is made. It's up to onboarding users to acquire the default configuration from this documentation site. This is an attempt to reduce the table footprint from "whole bot configs" being stored, when the point of YAML is to just include the things you're actually using and needing.

  • The !server command no longer includes Max Members and Max Presences data. These don't return anything from the API any more, so there's no point including them [max presences is managed automatically by Discord, so users who trigger the limit get moved to a system called Relays, which negates presence limits anyway]

Fixed

  • Fixed a bug with cooldowns on the tag aliases failing to throw the "Woah, you need to wait!" message, due to it raising the error rather than just.... passing it to the error handler lmao

  • It was possible to heavily rate limit the bot by spamming !mban. This is no longer possible as the command can only be invoked one at a time: this cooldown is cleared each time the command invocation stops [tl;dr there's a concurrency limit to discourage abuse]

  • Fixed a bug where the level checking function used in some commands that attempts to check the level of whoever was mentioned [ie in moderation commands] failed to test for whether the invoker was the server owner, this was in case the server owner had none of the defined levels roles, or did not configure the feature.

  • Fixed the response string when failing the level check against target members in some moderation commands incorrectly referring to "mods and admins" instead of "member who have a maximum level greater than or equal to your own".

  • !slowmode now correctly accepts regex-style timestamps of the type used in !tempmute and !tempban commands. There was a bug where this stopped working.

  • Loads of other minor fixes and improvements to improve performance and keep things running smoothly.

2021-05-31

All bug fixes from yesterday's major update.

Fixed

  • A number of command files erroneously used the self class format to refer to a variable in a non-class context. That prevented some commands from working at all. This has been corrected to refer to the correct variable.

  • Infractions could not be created properly in the ban commands (!ban, !tempban, !unban) because they passed a variable that wasn't needed and which messed up the argument order. The rogue variable was removed and things are at peace again. 🙏

    • In the same vein, the reason was passed improperly, that has also been fixed.

  • !clean commands didn't work because the message id was not returned, so parsing the database response was impossible, now the ID is actually returned as intended.

  • !inf search failed to perform the member level check properly: it erroneously assumed any given user to search was always a member and thus failed when the given argument referred to a non-member. The command has been given a lesson and now behaves properly.

  • !archive commands succeeded but you did not manage to get the archive link and had to go searching the dashboard for them. We tackled them into submission and made it return the link the way it should do (tl;dr the variable was assigned wrongly)

  • Fixed a race condition bug where sometimes the cleanup from the anti-raid systems attempted to remove elements from the list that were not there. Now it just passes over them if an error is raised when trying to remove invalid elements.

  • Heuristic filters erroneously tested for the value 0 when checking if a key existed before setting a variable, except the method checking existence returned None, causing several filters to never expire. The correct condition is tested for, so keys expire properly now.

  • Suppressing clean invocations failed because of the wrong variable being set for getting configuration options.

  • The bot is now properly assigned as the issuer of heuristic-triggered infractions, instead of raising an error due to the wrong variable referring to the bot being used (tl;dr it called a ClientUser of itself, not the Member version of itself within the guild)

  • Multi-modlog channels erroneously did not newline-delimit entries due to missing the correct joining value to join by newlines not an empty space.

  • Temp mutes now expire instead of raising an error about missing imports and wrong variables.

  • Welcome Messages no longer pointlessly show the replacement strings of {member}, {mention} and {guild} when welcoming a member: all replacement strings are now actually replaced to the values they're meant to show.

  • After sending a message for the !announce command for the channel to post the message to, your requested channels' message wasn't deleted. Now, it does get deleted as intended.

  • The regex for the bad words censor was erroneously working under "partial matches", whereby if a string was present within another word, the post was deleted. Now its been bullied back into working by "word boundaries" as before, meaning in-word matches are no longer found.

    • A proper filter for matching random in-word matches (ie posting "knight" where "nig" is forbidden) will be created in due course.

  • Due to Discord API weirdness, role changes were sometimes sent more than once to modlogs. We made the modlog function not send the same string over and over for no reason.

  • Passing a username#discordtag combination to the !info command works again.

1.6.0 - 2021-05-30

This update is a major upgrade of many internals of the bot, fixing lots of bugs and introducing new stuff. Internally, this update represents the Emerald build of SajuukBot, due to how wide ranging the update is.

New Features

  • Certain high-traffic functions are now cached to improve performance. These include Tags and Reaction Roles. The data returned from the cache matches the same data that would be returned by a normal database query, and also massively reduces traffic to MariaDB allowing it to handle things that can only be reached by a query.

  • It's now possible to "reset" the state of the pinboard by calling !pins reset. Internally, all this will do is delete all the database records associated to the "pinned" messages (ie those posted to the defined channel). This command only works if the channel ID is either 0 or referencing a channel that no longer exists in the guild [hiding it from view does not count as "no longer existing"].

  • If a clean subcommand fails and then prevents you from being able to invoke any clean command in a channel, you can reset that state by using !clean cancel. This does not actually stop a clean thats running though.

  • A new anti-raid filter was added, specifically targeted towards capturing raids from new accounts only. The time period of what constitutes a "new account" is configurable per-guild but the maximum value is 30 days. This filter can be used in tandem with the regular "joins" anti-raid config, as a user will not be captured in both filters, preventing duplicate "running" of totally different filters.

  • Personally identifiable information about users (ie usernames and discriminator tags) can be anonymised provided the user submits a request. This will cause anything that might be attributable to you to become associated to "An Anonymous User#0000" anywhere where that data might be displayed [!inf search, text archives etc].

  • New utilities command: !voice. This doesn't really return a whole lot of information but will include the region that the voice channel is set to.

Removed Features

  • The moderator notes functionality has been removed entirely. In Sapphire, this feature was considered deprecated and was not receiving support. The feature never had widespread traction anyway, amounting to just 35 notes in total, most of which were just test notes. Users who want to add "notes" should instead use the !warn command and place [note] at the start of the reason argument of the command to create a "note".

  • The ability to suppress "small edits" (which were hard coded to be any edit less than 10 characters) has been completely removed. Like mod notes, this got no direct use by anyone. By removing this, a useless dependency has been removed.

Improvements

  • Modlogs have been completely overhauled, both the primary and any additionals you have set up. Now they're all batched, instead of the old system where only "selected spammy" events would be batched. This allows the bot to scale quite significantly and prevents rate limits from being a principal issue.

  • The databases used by the bot have been given a spring clean to keep them running reliably and performantly. These have involved splitting repetitive data into separate tables, reindexing the entire database by adding new indexes and purging data that can no longer be accessed. Reindexing and purging dead data will be a long term thing and will not be documented further, but its being mentioned now because its notable in context to other changes with them.

  • !uids is now a valid alias of the !uid command to get IDs from modlog text input.

  • Member Persist now batches adding the nickname and all required roles to user, instead of using up the global actions ratelimit by calling two endpoints independently for no reason.

  • Various regexes around censors that changed on every invocation of the censor no longer call the re.compile() method, instead the pattern is given to the requisite "find matches" method thats needed for the regex, improving performance, given the pattern will change every time.

  • You can now add overrides for channels and categories. This may be useful if you have multiple bots where commands conflict and you don't want a command to be used in a channel or a whole category [ie with ticket bots]

  • Lots of syntax and formatting changes internally to bring the code up to modern standards of bot development. These included converting lots of string variables to f-string formatting, ditching single-use variables (ie a variable thats only used once throughout a command), getting rid of excessive indentation and more. A lot of this has no impact on users, but just makes my life easier.

Changed

  • Self-assign roles via the bot commands are now handled by !join and !leave respectively. The !role add and !role remove subcommands are now only for adding/removing roles from other users.

  • The !info command now only takes a member argument and cannot be used to look up yourself. The self lookup config key was removed as part of this change. If users want to look up their own information, they should invoke the alias !userinfo instead [internally, this command just invokes !info but passing the invoker as a member]

  • Action types for all events have been updated, you may need to update your configurations to ensure the correct data reaches them. Refer to the Multi Modlogs article for a list of event names, grouped by their "type".

  • Tag Aliases are now case sensitive, meaning that an alias configured as !myalias can be used as !myALIAS without issues.

  • Very minor addition: if a guild uses the Membership Screening feature and a member has not completed the verification steps required to unlock posting, an alarm clock emoji is shown next to the "Joined" entry to indicate they are a pending member.

  • The embed output of Reaction Roles has been changed to avoid character limits. Your input description is now part of the message "body", with all available reaction roles for that post in the "description" part of the embed. This is because the description allows for 2048 characters, which should be more than sufficient for an average of 100 characters per reaction role, out of a maximum of 20 reactions.

  • The multi-action bot commands [ie !mwarn, !mban etc] now automatically redirect to the single-action command version [ie !warn, !ban etc] if only a single member could be validated. This only works if the invoking member has the ability to use the single-action versions.

  • The !announce command now only updates the given role to be "mentionable" if it does not have the "Mention everyone/here/All Roles" permission. If you make use of this command, you're encouraged to enable this permission, but there is no negative in not doing so.

  • The !server command no longer shows the servers' voice region because Discord deprecated this in favour of individual voice and stage channels having regions instead. The voice region information is shown instead within the !voice command earlier described.

Fixed

There's been a ton of bug fixes in this build, most of them were necessitated by a lot of the other described changes [and other bugs aren't worth mentioning here because they were fixed in the process of implementing new features]:

  • Triggering a cooldown on !tag get (via the use of an alias configured by Custom Commands) no longer silently fails when the cooldown is hit, due to a mishandled raise.

  • Reminders associated to channels which the bot could not post in are silently discarded rather than raising errors that cause the task to crash.

  • Datetime objects were wrong whenever DST came into effect in the UTC+0 timezone (ie British Summer Time). This meant every time DST was in effect, the time element was an hour behind. This has been corrected to properly account for the "real" time instead of constantly being incorrect.

  • In some commands, NoneType was not properly checked for, leading to errors if the wrong syntax was used. NoneType is now correctly checked for, meaning doing !ban SomeUser#0001 reason here won't pointlessly raise the "Oops!" message.

  • Some tasks that relied on starting up at midnight did not work if these tasks ended up starting on the last day of the current month. The logic has been improved so it always calculates the next midnight correctly, even if it falls on the last day of the month.

  • A minor security issue was fixed whereby the "blacklisting" aspect of overrides used the wrong return type. True was being returned when the entire point is that anyone who isn't allowed to use a command is meant to return False.

2021-02-09

New Features

  • Custom Welcome Messages. Refer to Welcome Messages for more information on how to configure.

Fixed

  • !clean channel_user now works again, after a configuration error prevented it from working.

  • !info shows the correct error when an invalid user ID is provided, rather than an "Oops" error.

2021-01-26

This is a hotfix release for the January Monthly Rollup, it fixes only bugs in the functionality. These were reported by users directly so don't have associated tickets on the bug board.

Fixed

  • The UserMemberConverter returned False in situations which didn't make sense, rendering many commands relying on a specific return value to fail when a User was needed, not a Member.

  • The multi-modlog pump had some variables returned as, or containing, None in unexpected situations.

  • The task to "reset" reaction roles had channels returned as None in some situations.

  • A variable name was incorrect within !mkick and !mban commands, rendering them non-functional.

  • A string was inappropriately truncated in the log output for !mkick and !mban.

  • Tag aliases now follow the required cooldown for retrieving tags, they previously did not adhere to the cooldown.

  • !info got None in some situations, leading to a name#tag search not working.

1.5.2 - 2021-01-23

January Monthly Rollup

New Features

  • New subcommand: !role info. This replaces the old format of passing a role name or ID to !roles and shows some additional information, like whether its managed and the number of members in it. This will expand as Discord provides more information on its API (https://bugs.sajuukbot.com/issues/95)

  • The bot now has the ability to change the Server Verification Level if an anti-raid heuristic is triggered. It increases the level to Very High, before decreasing back to the previously assigned level. This requires Manage Server to be enabled in order to use it (https://bugs.sajuukbot.com/issues/55)

  • A modlog pump for secondary modlog channels has been implemented.

    • This will only be in effect for Member Join, Member Leave, Role Changes and Voice State Updates. Other messages are already sent in a way that doesn't require further batching. This may be extended to other features in future iterations.

    • It performs the exact same batching used in the master modlog. Note that batching is done in ALL additional modlog channels where the event can be found in the event list.

    • Be aware that the nuances around batching will likely mean timestamps might not match in every location that you see the message located in (between multiple modlog channels and even the master). This is an acceptable trade off to ensure that the bot has a reduced rate limit footprint and catches all messages as required.

Changed

  • discord.py library was upgraded to the latest version.

  • User badges are now displayed in the !info command, if they have any (https://bugs.sajuukbot.com/issues/91)

  • The invocation to retrieve a tag can now be suppressed via a new configuration option (https://bugs.sajuukbot.com/issues/91)

  • !nameban will now filter through all members in the server, rather than calling a websocket-based endpoint that was capped to a maximum of 100 members per invocation.

  • Due to spam and abuse concerns, the retrieval of tags is now subject to a cooldown, to discourage the "flooding" of chat with tag retrievals. This helps if you are using tag aliases (https://bugs.sajuukbot.com/issues/92)

Fixed

  • Command modlog entries are now properly truncated if the invoking message is relatively long (longer than 1700 characters) and thus, are now logged (https://bugs.sajuukbot.com/issues/72)

  • Issuers were sometimes not suppressed in public modlogs, usually if their username contained a space or some other non-alphanumeric character that wasn't detected by the regex (https://bugs.sajuukbot.com/issues/94)

  • Self-adding roles didn't work, due to a variety of logic and coding errors with the code itself (https://bugs.sajuukbot.com/issues/96)

  • The bot would consume excessive CPU if an anti-raid trigger was set to ban members in response. Additionally, the code involved with cleaning up a raid has been made more in line with the requisite standards (https://bugs.sajuukbot.com/issues/100)

2021-01-16

Fixed

  • For guilds using the sleeker API-backend powered infractions table, after navigating through a few pages, you would get Bad Gateway errors returned by the webserver. The cause was down to an accidental inclusion of multiple calls to retrieve pooled connections for the database backend, leading to the pool being exhausted but not handling the error correctly.

1.5.1 - 2021-01-04

New Year Monthly Rollup

A large portion of these were deployed prior to this date, but this acts as a rollup for that version to match the Roadmap on the bug tracker.

New Features

  • Message counts per guild and globally have been returned due to popular demand, which simultaneously fixes the !uptime command as it wasn't working due to missing variables (https://bugs.sajuukbot.com/issues/69)

  • New task loop: reactions with more than 2000 reactions are now reset back to zero to account for Discord's rate limit that only returns a maximum of 5000 reactions. This hasn't been tested, any bugs found will be fixed as required (https://bugs.sajuukbot.com/issues/85)

  • New command: !nameban. This searches for anyone in the servers whose username (NOT nicknames!) starts with the argument passed (https://bugs.sajuukbot.com/issues/80)

Improvements

  • Old PostgreSQL cluster has been purged, reclaiming 9GB of dead space for use by the Production bot. Went easier than I had thought.

  • Some more files have been moved to the new error handler, so you'll see it more and more now. Plan is by end of January, all code will use that error handler.

  • Experimental changes to a task involving the expiration of temproles (added by the !temprole) command has been done to improve code readability.

Changed

  • !r list shows creation and delivery dates (https://bugs.sajuukbot.com/issues/76)

  • The word undefined when no valid member was passed to tags containing {member} now automatically mentions the invoker instead (https://bugs.sajuukbot.com/issues/79)

  • !tempban works with users who are no longer in your server (https://bugs.sajuukbot.com/issues/78)

  • Overflow scroll bar on the Update History of configs has been moved so the title header doesn't get buried when scrolling (as more updates are generated, this is likely going to get limited to just the latest 50 updates, with an option to view ALL updates on a separate URL)

  • Minor changes made to the Guild Update event:

    • Audit logs are only polled once in a small code improvement. Currently, bot is relying on default config, will be possible in near future to change this to false per-config if you prefer it.

    • Changes in ownership are now logged. Can be filtered to a multi-modlog with event name GUILD_OWNERSHIP_CHANGE.

    • Changes to the name of the server are now logged. Can be filtered to a multi-modlog with event name GUILD_NAME_CHANGE.

Fixed

  • Fix bug where the modlog for !nameban invocations didn't contain the user who invoked it (https://bugs.sajuukbot.com/issues/88)

  • !jumbo silently failed in certain situations due to variables being named the same as modules or other Commands.

  • The !role add / !role remove commands didn't work entirely: whether self-adding or mods using it on others

  • The modlog entry was missing if you got raided by hundreds of bots and the anti-raid filter for joins caught them all (https://bugs.sajuukbot.com/issues/86)

  • Levels could not be defined with a value of 0 on commands: the outcome was the command would not operate for anyone due to a logic error in the condition (https://bugs.sajuukbot.com/issues/82)

  • Published posts spammed backend errors when they were edited due to a missing Member object on such messages (https://bugs.sajuukbot.com/issues/61)

  • You could not delete infractions because of a logic error preventing the command from functioning as intended (https://bugs.sajuukbot.com/issues/71).

  • Passing a name or ID of a role to the !roles command wasn't working (https://bugs.sajuukbot.com/issues/83)

2020-12-11

Fixed

2020-12-06

Fixed

Dashboard

  • Another fix to the YAML schema leading to some minor issues in certain cases.

  • /guild info page should no longer be error'ing (thanks to a few people flagging this one up)

SajuukBot

  • Having the nickname key missing would prevent the bot from reloading configurations in real time

  • The !reason command was found to be not working (a variable name was not changed as required to allow passing the reason: it was passing a Command reference instead)

RankBot

  • !rank_usermod command is now enabled, for some reason it wasn't.

  • !stats commands now output data: this was due to an empty cache caused by intents not being declared in code.

  • RankBot YAML schema was updated to include a missing key preventing validation.

2020-12-05

Fixed

Dashboard

  • Owners can now properly access all pages relating to their guild configuration.

  • The Manage Access page now fully works the way it was intended to be.

  • The schema has now been updated to completely match expectations. If you have invalid keys/values, these are now reported as necessary (some configs may have been loaded with bad values/keys, these don't harm anything though they will have to be removed to validate configs)

  • The support link in the navigation now properly loads the workflow to add you to the support guild

  • Statistics on the home page properly record your accesses.

  • Duplicate entries on pages associated to queries have been removed.

Bot

  • !r remove now works (it was failing due to a key error with the command name)

  • Anti-Raid keys are properly given expires, rather than being permanent keys that would lead to inappropriate actions.

  • Cleaning of messages on Filters, Heuristics and Anti-Raid all work as intended.

  • Multi Modlogs are now working as intended.

  • Removing tags now properly checks if you're allowed to remove the tag (it would fail if the author was no longer a member of the server)

  • Removed needless references to LIMIT on the !clean until command.

  • The tempmute syntax alias on !mute has been fixed.

  • A variety of other minor bug fixes.

2020-12-03

Fixed

  • Dashboard not showing server list properly in various places.

  • Dashboard not showing buttons / no perm warnings if you were server owner.

  • Dashboard not letting you submit configuration changes due to error.

  • Statistics data on homepage wasn't loading properly

  • !info not working properly due to bad import

  • !reason not working properly due to erroneous backtick in SQL query

  • Dashboard issues relating to managing user rights.

1.5.0 [Sapphire] - 2020-12-02

Sapphire, referred to as v1.5.0, was a major rewrite of all bot internals and the code base, to make it more sleeker and easier to maintain. All updates after this build upon the highly optionalised and modular nature of this code base.

Backend

  • All core libraries of the bot have been updated to the latest possible versions, with the exception of the MySQL Connector (it does not work on MariaDB past the currently installed verson). Further upgrades may happen later if they become a necessity.

Databases

  • Since Redis was installed to the server using a package manager (YUM), it has been getting automatically upgraded to latest builds without intervention from myself. As of writing (22nd October 2020), it is running the latest stable version (6.0.9) and it will continue to be upgraded by the server as required.

  • PostgreSQL, the core database that handles message archival in all guilds, was upgraded earlier in November from v9.2.24 (a version provided by the operating system repositories) to v13.0 (a version provided by the PostgreSQL YUM repository). This opens up many avenues of optimising the bot code in the future, which will occur in stages when the code is written to take advantage of these available new pathways.

As these automatic upgrades are handled by a cronjob, this will always lead to a short period of downtime around 12.55am British Time (whether that be UTC+0 or UTC+1). These can't be avoided if there are upgrades available for the server to perform. That's because the server automatically closes down the associated service for these databases in order to upgrade / restart them, which causes the bot to run its automatic shutdown code when it comes across a connection error.

Major Changes

  • All configurations have been fully migrated to YAML (both in the editing part you will do in the dashboard and the backend code used by the bot), making it 10000% easier to understand your config from a human readable standpoint. The structure has been completely overhauled turning almost every setting into optional inputs so that your configs only showcase the enabled functionality that you want.

    • Because all configs have been rewritten to an optionalised format, there is now a backend default which will be used when you don't configure the feature. These defaults broadly align with the original defaults in the enforced config format.

  • Significant refactoring of bot code to take advantage of the optionalised nature, such as rewriting exemption functions to use a standardised class method that can be put anywhere in the code where its needed and the results will be consistent no matter where it is used. This refactoring was desperately needed, as the code was getting harder and harder to maintain "easily".

  • The old permissions system, which was a very rigid "no perm, mod or admin" system and caused plenty of people headaches over the last year or so, has been completely replaced by a very fluid and customisable levels system. Levels allow you to very accurately define which roles are allowed to use certain features or which roles become exempt from anti-spam functionality. The fallback if this is not configured (you really should configure this system!) is to test for whether a user has the Administrator permission on any of their roles.

    • As a benefit, a highly requested addition is also introduced with levels, in that the server owner is exempt from every anti-spam feature and can use any command regardless of them having any roles.

New Features

Bot

  • New subcommand for !clean: until. This effectively works the exact same way as !clean all: the big difference is that you just specify the oldest message ID and anything from that ID to present in the channel will be deleted. Usual limits of !clean commands applies. (https://rdm-prodfilfz01.sajuukbot.com/issues/39)

  • You can set up custom command aliases! Been requested a few times so here we go. The way this works is that you assign a string of text (has to follow normal command conventions, so no spaces are allowed!) to trigger a specific tag that exists. If the user has the ability to use the !tag command (specifically retrieving tags), the alias will work. See the documentation if you're unsure on how to configure this.

  • RankBot -- the subsidiary bot that provides a post-based ranking system for your community -- has also been converted to a YAML format. You can configure it yourself through the SajuukBot dashboard if you have the requisite permission to do so.

Documentation

  • The documentation site has been completely overhauled! All the messy formatting from the old one is gone and replaced with something that more fits the Gitbook v2 design.

    • This has taken a lot of time and I may have missed things. If you've found something in the bot that is not explained on the site, let me know!

    • The old documentation, located at https://old.docs.sajuukbot.com, will be taken down and deleted within a week of deployment.

  • RankBot now has public documentation, due to many people having difficulty using the commands or struggling to find updated information that wasn't being spread around multiple servers. You can find it over here: https://rankbot.docs.sajuukbot.com

    • Please note that it may be subject to getting out of date sooner, compared to SajuukBot itself. If there are any bits of information on there that is wrong, let me know and it'll be corrected!

Dashboard

  • The dashboard login flow has been updated to now request joining guilds on your behalf, though logging in itself through the usual method will not actually join you to the guild: this scope is needed for the actual page that allows you to join. Please note that this will ONLY attempt to join you to the SajuukBot support server, another bot will handle role assignment for you there.

    • Due to the way authorisations are handled, this will only be attempted once: if it fails, you will have to sign out of the dashboard directly to allow the dashboard to attempt to add you to the guild again. You can edit the URL to remove the guilds.join scope if you don't want this, though for the majority of users, this won't have any impact.

    • To actually take advantage of the new scope, you will probably need to log out of the dashboard completely, and then relogin.

    • To join the SajuukBot discord from the dashboard, use the Support link in the navbar. This opens a popup that will join you to the guild if it can do so.

  • The dashboard frontend has been improved somewhat, in that there is no longer an ugly datatable with a ton of buttons listed. Instead, what you see now is a list of guild names and ID's: clicking the guild name now takes you to a Guild Info page, which presents a large amount of information about the guild, and the buttons as described before.

    • The level of information you get from this is currently limited to infractions in different manners (total infractions in the guild, total infractions given by you, total unique targets, total unique issuers). When I find a suitable library to implement it, this will show message statistics in the same way (total messages ever sent, total unique channels, total messages sent by the person reading the page, total unique posters). However, as the database is large, getting message statistics is expensive and such information will only be shown to Guild Admins after clicking a button, the dashboard will store this state and disallow any more requests for 7 days to prevent abuse.

  • The backend tables have been overhauled to make it easier to understand the different permissions. Instead of radio buttons for levels and checkboxes for permissions, all options are now checkboxes for each type of permission.

    • "No Access" is no longer a permission. This level was only really a thing if you weren't able to manage a config but had other "side perms". With the backend table changes as noted above, the perm is meaningless because lacking permission is tested in an alternative manner that is more simpler to use.

    • Administrator is no longer a permission. Instead, it's been renamed to "Manage Access" and specifically only grants the ability to manage user rights. The concept of Administrator (whereby the user has all permissions for that guild on the dashboard implicitly) is now reserved just to the Server Owner of the config and bot developers/bot support staff.

      • It should be noted that, despite the rename of the permission, it is a permission that can only be granted by specific individuals, namely the Server Owner and bot developers/bot support staff. Users with Manage Access themselves while not being either the owner or a bot dev will not be able to give anyone else the permission.

      • In addition, a user can only give others a permission that they also have. It will not be possible to perform "perms escalation": ie being able to manage all permissions to anyone at all, even if you don't have it. This change increases security by making sure that people can only give perms they are able to.

      • For obvious reasons, the restrictions above don't apply to Owners or Bot Devs.

    • Because of the changes made, all user access rights were deleted as they're not compatible. You will have to talk with your local mod or admin team in order to regain access to anything that you previously had. Sorry! :(

  • Changes made to configurations are now logged in history with associated before and after diffs created. The user who made the change is listed alongside when that happened.

    • Clicking the blue text will open a modal showing the changes based on old config data and the new one which are stored in a separate table.

    • The point of this addition is to increase transparency of edits made by others. If you're only a viewer to the config, you will just see the changelog but not the specifics: editors will be able to see the actual diff change of an edit.

  • A red warning bar is shown at the top of most pages if you try going to restricted pages for guilds where the guild is no longer using the bot. This is because the permissions record isn't removed when the bot is removed from a guild, so you could theoretically go to certain pages if you know the URL construct.

    • If the red warning bar is shown, anything that involves submitting a form (ie to create a new reaction role or saving a configuration) will not be possible. You can, however, edit or delete reaction roles as these do not post any change to Discord.

Improvements

  • Categories can now be whitelisted from the anti-spam functionality. Highly requested and although I built the code to do this on the previous build, it was never deployed because of the amount of effort needed to make it optional on the old system. This will help those servers using modmail or ticketing bots.

  • You can now "blacklist" channels and categories from having messages stored. Unless you understand what this is for, you should not configure this feature. There are very limited use cases for whitelisting channels, usually modmail/ticketing bots because the channels are temporary.

  • The sidebar on the dashboard has been improved a little to make things a bit more clearer as to what page you're actually on.

    • Some users have specifically requested that the "Archives" option in the sidebar behave the same as the infractions option. This is being worked on for a future deployment.

  • When a user encounters an error with a command, the bot now gives a randomly-generated "Error ID". This is logged internally on my side: you should use this ID when reporting issues like a command failing for no reason. (PLEASE NOTE THIS FEATURE HAS NOT YET BEEN SETUP! It will be deployed on v1.5.1)

    • In addition, error logging on the backend has been improved by actually specifying where, who and what caused an error to occur, allowing more directed focus tto issues that occur (previously, random failures would happen but not attribute themselves to what guild triggered the error and who caused it to happen)

Bug Fixes

  • If you knew the User ID of the "Discord" system user, you could use !ban commands for no reason on it. Given its not a user, this is pointless behaviour. It is no longer possible to ban the system user as its ID has been blacklisted at converter level, so it won't parse to a user anymore (https://rdm-prodfilfz01.sajuukbot.com/issues/29).

  • The invite censor now actually catches invites using the new discord.com domain. Up until now, it was possible to evade the filter by posting invites with the domain (https://rdm-prodfilfz01.sajuukbot.com/issues/35)

  • When paginators were generated, specifically on !inf search and !inf issuer, anyone could use the reactions to paginate the results. Now only the person who actually invoked the command is able to use the reactions to paginate results (https://rdm-prodfilfz01.sajuukbot.com/issues/30)

  • When Discord's widget created an invite, and you had the INVITE CREATE event enabled, you would get no logs because these invites have no inviter object (ie the person who created the invite). These invites are now suppressed and no longer appear in the modlogs. (https://bugs.sajuukbot.com/issues/49)

  • Group DM invites will now be caught and filtered with the Invite Censor. Due to the fact these have a NoneType guild, they caused an error when they were parsed due to "NoneType object has no attributed 'id'" when the guild id test was done. (https://bugs.sajuukbot.com/issues/57)

  • In some circumstances, the issuer of an infraction like a tempban or a multi-ban was not stripped out in public modlog messages. This led to the random instances of the issuer of some actions being displayed in public modlog channels, even if others had been removed. This has now been corrected by the implementation of a regex within the modlog sending functions, instead of the previous implementation that was haphazard. (https://bugs.sajuukbot.com/issues/58)

  • Although this never happened, it was possible to quote messages from any channel in the server as long as you had permission to use the !quote command and had the appropriate Message ID. This is a security issue as it could allow for leakage of contents from private channels. The bot now properly checks the authors' permissions on the channel and will not load the message if you cannot view the channel. (https://bugs.sajuukbot.com/issues/59)

  • You may have noticed on the Reaction Roles page of the dashboard that clicking the "Emoji" input textbox made it shrink for no apparent reason to a tiny box. This was really confusing and terrible UI when it would flex itself from a tiny box to the placeholder text width. This incredibly irritating bug has been fixed by the definition of a minimum width that roughly matches the length of the placeholder text.

  • When deleting reaction roles, every "Delete" button was replaced by a spinner instead of the one you were deleting. Bit weird because then you wouldn't be able to delete other reaction role objects without refreshing the page. The selector has been made more intelligent so that it doesn't select all delete buttons.

  • Various edge-case bugs involving regexes not behaving the way they are supposed to have been fixed (these are, in the main, minor fixes)

Last updated