aboutsummaryrefslogtreecommitdiffstats
path: root/tests/helpers.py (unfollow)
Commit message (Collapse)AuthorLines
2022-10-27Use command prefix instead of hardcoded !Gravatar mbaruh-3/+7
2022-10-27Convert redundant filter setting group to commandGravatar mbaruh-14/+9
2022-10-27Suppress exceptions while actioning filtersGravatar mbaruh-7/+20
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.
2022-10-26Add Discord token filterGravatar mbaruh-35/+255
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.
2022-10-23Add rich embed filterGravatar mbaruh-19/+62
2022-10-23Add webhook filterGravatar mbaruh-5/+76
This adds a way to add custom coroutines to the context, to execute when the filtering result is actioned.
2022-10-22Move Security cog to backend extensionGravatar mbaruh-1/+1
2022-10-22Add everyone filter, fix invite filteringGravatar mbaruh-110/+285
- 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.
2022-10-20remove int from search_value's type unionGravatar Amrou Bellalouna-6/+6
2022-10-20apply style guidelines to signatureGravatar Amrou Bellalouna-2/+7
2022-10-20update doc strings to reflect the usage of the new paramGravatar Amrou Bellalouna-2/+2
2022-10-20change the signature to include a "zen_rule_index"Gravatar Amrou Bellalouna-7/+9
2022-10-19Calculate 'now' once to ensure it is constant for scoring nominationsGravatar wookie184-4/+5
2022-10-18Resolve a serious grammatical problem in a commentGravatar Leon Sandøy-1/+1
A controversial comment, to be sure. I have solved this with a compromise I know in my heart we can all agree on, wholeassedly.
2022-10-17Add a command to query filters by settingsGravatar mbaruh-55/+563
2022-10-17Support the new SequenceProxy type in d.pyGravatar Chris Lovering-1/+2
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
2022-10-16Change override handlingGravatar mbaruh-114/+143
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.
2022-10-15More improvements to FilterListGravatar mbaruh-89/+54
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.
2022-10-14enhancement(filters): use a stricter bot token regex (#2006)Gravatar arl-5/+5
Use a stricter bot token regex Co-authored-by: wookie184 <[email protected]> Co-authored-by: Hassan Abouelela <[email protected]>
2022-10-13`REPO_TOKEN` is no more. (#2289)Gravatar Xithrius-1/+0
2022-10-11Add filter matching commandGravatar mbaruh-51/+83
2022-10-11Better API error handlingGravatar mbaruh-13/+27
2022-10-11Add confirmation before filter deletionGravatar mbaruh-35/+39
2022-10-11Rearrange FilterList classGravatar mbaruh-99/+153
2022-10-11Filter list add commandGravatar mbaruh-25/+189
2022-10-10Use explicit mock channels in tests to remove warningGravatar Chris Lovering-2/+11
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.
2022-10-10noqa an abstract class with no abstract methodsGravatar Chris Lovering-1/+1
This warning was added in the latest version of flake8-bugbear, but can be ignored in this instance.
2022-10-10Bump all deps to latestGravatar Chris Lovering-498/+426
2022-10-10Bump bot-core to 8.2.1Gravatar Chris Lovering-152/+1340
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.
2022-10-10Add filter list edit commandGravatar mbaruh-144/+393
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.
2022-10-10Rearrange UI into several modulesGravatar mbaruh-326/+344
2022-10-10Added filter list deletion command.Gravatar mbaruh-3/+84
2022-10-09Make changes requested in reviewGravatar wookie184-3/+5
2022-10-09Use scoring system that weights age and number of entriesGravatar wookie184-128/+1375
Added new tests for this behaviour, and added pytest-subtests dev dependency
2022-10-09Move tests out of moderation/ directoryGravatar wookie184-0/+0
I didn't mean to put them there in the first place
2022-10-09Add filter template optionGravatar mbaruh-26/+100
An option is added to filter add and edit to copy the overrides over from another filter.
2022-10-08Ignore overrides that are equal to their defaultsGravatar mbaruh-23/+90
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.
2022-10-08Fix pings validationGravatar mbaruh-3/+3
2022-10-08Add infraction channel settingGravatar mbaruh-10/+9
2022-10-07Prevent the duplicate filter warning from mentioning itselfGravatar mbaruh-4/+7
2022-10-07Add more spacing in mod alertGravatar mbaruh-4/+4
2022-10-07Make auto-infraction actually workGravatar mbaruh-16/+66
2022-10-06domain/exact -> domain/subdomainsGravatar mbaruh-9/+16
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.
2022-10-06Fix bug with setting domain to notifyGravatar mbaruh-5/+1
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.
2022-10-05Add message when there are no patrons in a tierGravatar wookie184-1/+2
2022-10-04Add filter content processing before posting/patchingGravatar mbaruh-5/+89
2022-10-03await unawaited remove_cog callsGravatar Amrou Bellalouna-3/+3
2022-10-02Make autoban report silently fail if output will be sent to a non-mod channelGravatar Chris Lovering-0/+4
2022-10-02Send weekly_autoban_report to ctx channel when manually invokedGravatar Chris Lovering-3/+7
2022-10-02Report on all autoban filters added in the last 7 daysGravatar Chris Lovering-1/+55
This adds both a command to runt he report, and schedules a report to be automatically once a week.