| Commit message (Collapse) | Author | Lines |
|
|
|
Since the anti-spam now works cross-channels, it makes no sense to identify it by the channel in which it was invoked.
The DeletionContext class was changed to accept a frozenset of members, and the message_deletion_queue dict uses the frozensets as keys.
DeletionContext still accepts a channel on creation, because while it might get added more channels, there's only one channel in which the mute message will be sent.
Using members as the key can run into the issue of one member becoming irrelevant to the filter while others still are, resulting in another log message being sent, but it's an unlikely edge case since the users should be muted almost immediately, and we're currently not using any multi-member filters in the first place.
|
|
The anti-spam cog was amended to handle cross-channel spam.
|
|
The anti-spam cog now uses a cache instead of reading channel history.
The cache is for all channels in the guild, and does not remove deleted messages.
That means that the anti-spam logic now works cross-channel and counts deleted messages.
The size of the cache is determined via a new field in the config YAML file.
The cache was implemented as a separate class, MessageCache, which uses circular buffer logic.
This allows for constant time addition and removal form either side, and lookup. The cache does not support removal from the middle of the cache.
The cache additionally stores a mapping from message ID's to the index of the message in the cache, to allow constant time lookup by message ID.
The commit additionally adds accompanying tests, and renames `cache.py` to `caching.py` to better distinguish it from the new `message_cache.py` and convey that it's for general caching utilities.
|
|
The on_message event calculated the max interval value every time for no reason. The value is constant throughout the bot's up time.
|
|
|
|
Co-authored-by: Bluenix <[email protected]>
|
|
The regEx pattern did not match the 'https://' part in case of canary urls
Thus, from now on the regEx pattern matches the full canary urls as well.
|
|
|
|
|
|
|
|
Remove redundant retrieval of category objects.
Include the asking guide URL in the message via an f-string.
|
|
If the cog is reloaded while there are less than the maximum amount of
available channels, it makes some channels available until the limit is
reached. When a channel is made available, it updates the
`available_help_channels` set. The `update_available_help_channels()`
function would not update this set if it saw that the set already
contains elements. This resulted in only the channels that were just
made available being in the set; the set would not contain the channels
that were already available when the bot started.
Fix this by unconditionally populating the set, but moving it to
`init_available()` so it only happens once.
Fix BOT-Z1
Fix #1715
|
|
From now on, webhooks that were posted in the chat will be also
deleted from Discord in order to eliminate the risk.
|
|
Co-authored-by: Bluenix <[email protected]>
|
|
Interestingly enough, the reason doesn't seem to be displayed for channel permission overrides.
|
|
Co-authored-by: Bluenix <[email protected]>
|
|
Co-authored-by: Bluenix <[email protected]>
|
|
Previously nomination messages had role pings in them, now they don't as we moved them into a thread.
Due to this, we need to detect both in the interim of historic nominations existing.
A 'proper' fix for this is to store the nomination message IDs when we post them against the
nomination object in the site api. We are planing to work on this soon, this commit is a
short term fix.
|
|
|
|
|
|
channel.category doesn't get updated in cache so the category ends up still linking to "In Use", whereas we want the "Dormant".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
When the limit was raised, the error message was not edited to reflect the change.
https://github.com/python-discord/bot/commit/6f45d6896adb3f05962733cec8e5db199def20bc
|
|
|
|
Fixes BOT-1J7
|
|
Fixes BOT-J2
|
|
Fixes BOT-ZN
|
|
Reorder user roles in !user command from highest to lowest
|
|
403 occurs if the user has DMs disabled.
Fixes BOT-137
|
|
Some discord usernames contain unicode characters, which causes an decoding
error as chardet isn't 100% and can't falsely detect the response text as
Windows-1254.
|
|
Fixes BOT-13B
|
|
|
|
|
|
Reduce nesting and code duplication.
|
|
|
|
|
|
* Fixed wrong condition in rescheduler which made the eventual consistency not work.
* Mods now correctly removed from cache on role reapplies.
|
|
|
|
|