| Commit message (Collapse) | Author | Lines |
|
|
|
|
|
Filtering should not stop even if one type of action raised an exception.
For example, if deleting the message raised somehow, it should still try to infract the user.
Exceptions raised in actions are logged instead.
Additionally adds a fix to the way actions are merged.
|
|
Also fix a bug with the cog trying to serialize a set when trying to modify the DB with no UI.
Also fix a bug with the domain setting description having a mismatching name.
|
|
|
|
This adds a way to add custom coroutines to the context, to execute when the filtering result is actioned.
|
|
|
|
- Add the everyone filter, from a new class of filters - UniqueFilter. These filters should only be run once per context.
These filters can modify any part of their behavior, including which events they respond to.
- The invite filtering had a bug where it could exit early when the context wasn't a valid whitelisting context (which usually means that any unkown filters are allowed), despite there possibly being blocked filters which require addressing.
|
|
|
|
|
|
|
|
|
|
|
|
A controversial comment, to be sure. I have solved this with a compromise
I know in my heart we can all agree on, wholeassedly.
|
|
|
|
This type is usd for a few attributes, including Guild.threads and guild.Channels. This type does not implement any of the add dunder methods, so we use itertools.chain to get a single iterator for both sequences.
Fixes BOT-398 Fixees #2292
|
|
The Settings class is now a subclass of dict as well.
SettingsEntry's now store which fields are overrides in case the entry is not empty.
If there is a overridden value and a non-overridden value in the same entry, the non-overridden value will now correctly be the default instead of staying empty.
Additionally fixes bugs with free list input parsing.
|
|
Methods that work with only a specific list type are moved to AtomicList.
FilterList is now a subclass of dict, since that's what it is.
|
|
Use a stricter bot token regex
Co-authored-by: wookie184 <[email protected]>
Co-authored-by: Hassan Abouelela <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This is need due to the new behaviour of discord.utils.get supporting both iterables and async iterables by checking for the presence of the __aiter__ attr on the iterable.
GuildChannelConverter._resolve_channel uses this get util under the hood which grabs the voice channels on the guild, which were previously Mocked by the MagicMock, meaning the __aiter__ attr was present, causing the util to think it should be ran asynchronously.
|
|
This warning was added in the latest version of flake8-bugbear, but can be ignored in this instance.
|
|
|
|
From the release notes on d.py [here](https://canary.discord.com/channels/336642139381301249/381965829857738772/1006359073610010664) and [here](https://canary.discord.com/channels/336642139381301249/381965829857738772/1008772795179737230) none of the breaking changes for the commit we were on to 2.0.1 affect us.
|
|
The UI is a simplified version of the filter UI. In fact the two views now use the same base class.
Also fixes a bug in filters with displaying the correct value in the embed for filter settings.
|
|
|
|
|
|
|
|
Added new tests for this behaviour, and added pytest-subtests dev dependency
|
|
I didn't mean to put them there in the first place
|
|
An option is added to filter add and edit to copy the overrides over from another filter.
|
|
If an override is added that is equal to the default, it is ignored instead.
If an override is read from a Filter object that is equal to its default, it is ignored instead.
This is done because otherwise when a setting shares an entry with an overriden setting (e.g infraction_type with infraction_duration),
there's no way of knowing whether it was truly overridden, since None values are not preserved for filters on loading (that is because the same pydantic models are used for both the filter and filter-list settings).
This seems like an acceptable trade-off since overrides which are equal to their defaults don't have a practical use.
Addiotionally, this commit fixes not being able to set an empty string as an override to a non-empty default.
|
|
|
|
|
|
|
|
|
|
|
|
The original plan was to have a field which only matches subdomains and not the domain itself, I got confused when I wrote the /exact field.
This fixes a bug where the matches would be updated even if it didn't meet the criteria of the extra field.
Also fixes some issues in the UI dealing with filter overrides.
|
|
Unfortunately the filter doesn't know its full effect, only its overrides, so it might not know whether it's going to delete the message or not. This commit prevents errors, but might lead to unwanted behavior if there are two domains in a message, one that causes deletion and one that doesn't, and the second one gets evaluated last. This is basically a 'I hope no one notices' fix until I can think of something better. In practice this shouldn't be an issue.
|
|
|
|
|
|
|
|
|
|
|
|
This adds both a command to runt he report, and schedules a report to be automatically once a week.
|