aboutsummaryrefslogtreecommitdiffstats
path: root/tests/helpers.py (unfollow)
Commit message (Collapse)AuthorLines
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-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-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-04Add filter content processing before posting/patchingGravatar mbaruh-5/+89
2022-10-01Handle invalid UI editsGravatar mbaruh-4/+8
2022-10-01Prettify post/patch filter errorGravatar mbaruh-3/+21
2022-10-01Show settings in sorted order in UIGravatar mbaruh-2/+2
2022-10-01Add a warning if an added filter has content identicalto othersGravatar mbaruh-2/+15
2022-10-01Bring back enabled categories, remove redundant validatorsGravatar mbaruh-26/+19
There needs to be a way to only enable a filter in a specific category, so this setting now fulfills that role. Disabled channels can be used to disable a filter in a specific channel within the category. Additionally the validators which maybe convert to int are now removed. As long as the int is the first in the Union, it will happen anyway.
2022-10-01Stress that a filter was triggered in DMGravatar mbaruh-1/+1
2022-10-01Fix channel_scope checking IDs and names separatelyGravatar mbaruh-16/+9
2022-10-01Fix patching removed overrideGravatar mbaruh-3/+9
2022-10-01Correctly handle DMsGravatar mbaruh-2/+8
2022-10-01Properly remove items from sequence editGravatar mbaruh-1/+8
Some items might not be stored as strings.
2022-10-01Keep sequences as lists in editing UIGravatar mbaruh-2/+1
Sequences such as sets are not serializable, and it's going to be converted to the right type when loaded to the cog anyway.
2022-10-01Use try-except instead of is_digit in bypass_rolesGravatar mbaruh-3/+4
2022-10-01Correct loggingGravatar mbaruh-1/+1
2022-10-01Fix testsGravatar mbaruh-281/+44
2022-09-30Split actions and validations to their own packcagesGravatar mbaruh-12/+23
This is a purely aesthetic choice. Additionally fixes a small bug where a missing entry type would repeatedly invoke a warning on cog load.
2022-09-30Voice ban -> voice mute in auto-infractionsGravatar mbaruh-1/+1
This is a remnant after the last rebase.
2022-09-30Add filter delete commandGravatar mbaruh-0/+12
2022-09-30Add filter edit commandGravatar mbaruh-19/+116
2022-09-29Filter adding commands, simplify infractionGravatar mbaruh-122/+869
This commit adds the mechanic to add new filters. The overrides of the settings can be provided in the command itself, but also through a UI made of Discord components. The UI adjusts itself to the data type of the setting, e.g a boolean setting will invoke a select with "True" and "False" options. This commit additionally gets rid of the mechanic to apply a superstar alongside another higher tier infraction for the same message. This is an edge case that isn't worth the complexity at the moment. Includes a small fix to the Ping setting which made the __or__ method malfunction.
2022-09-20Display mention & str of the mentionable object in `!remind list`.Gravatar Izan-1/+1
Added so that the user still gets information on what the mention is, when the mention doesn't render (due to client cache etc.)
2022-09-20move DEFAULT_RULES_DESCRIPTION under information.pyGravatar Amrou Bellalouna-9/+7
2022-09-19use subTest to isolate assertionsGravatar Amrou Bellalouna-14/+17
2022-09-19add DEFAULT_RULES_DESCRIPTION to avoid duplicationGravatar Amrou Bellalouna-13/+10
2022-09-19fix redundant test nameGravatar Amrou Bellalouna-1/+1
2022-09-19test the cases where default rules message is supposed to be sentGravatar Amrou Bellalouna-0/+31
2022-09-19fix wrong type hint of the rules function return valueGravatar Amrou Bellalouna-2/+2
2022-09-19add test that checks for the sent content if one invalid index is present in ↵Gravatar Amrou Bellalouna-0/+46
the input
2022-09-19return final list of rule numbers to be sentGravatar Amrou Bellalouna-2/+4
2022-09-19sort the list of final rule numbersGravatar Amrou Bellalouna-1/+1
2022-09-18determine final_rule_numbers value by subscribing to the ↵Gravatar Amrou Bellalouna-9/+2
keyword_to_rule_number using the matched keywords
2022-09-18subscribe directly to the keyword_to_rule_number dict instead of using .getGravatar Amrou Bellalouna-1/+2
2022-09-18remove redundant use of list transformation when sorting final rule numbersGravatar Amrou Bellalouna-1/+1