diff options
| author | 2021-12-25 20:18:02 +0200 | |
|---|---|---|
| committer | 2021-12-25 20:18:02 +0200 | |
| commit | c082ad818608fd52238e61f9c69d99cfb2aa503b (patch) | |
| tree | 47cd3edcd407ecd70b2e1935ba4fac53077e46ca /pydis_site/apps/api/models | |
| parent | Correct 'Redirect' FilterLists' default values. (diff) | |
Merged infraction and notification settings in JSON
The settings for infracting and notifying the user were merged under one field, which is renamed to "infraction_and_notification".
The only place which sends a message in the server by default is the antimalware, the rest try to DM the user first, and antimalware can do the same.
This avoids complications which may result from the filtering cog trying to send two messages: one for the defined server message, and another for a failed DM.
Diffstat (limited to 'pydis_site/apps/api/models')
| -rw-r--r-- | pydis_site/apps/api/models/bot/filters.py | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/pydis_site/apps/api/models/bot/filters.py b/pydis_site/apps/api/models/bot/filters.py index 92251ee4..97af21f8 100644 --- a/pydis_site/apps/api/models/bot/filters.py +++ b/pydis_site/apps/api/models/bot/filters.py @@ -50,6 +50,11 @@ class FilterSettingsMixin(models.Model): null=True, help_text="The DM to send to a user triggering this filter." ) + dm_embed = models.CharField( + max_length=2000, + help_text="The content of the DM embed", + null=True + ) infraction_type = models.CharField( choices=Infraction.TYPE_CHOICES, max_length=9, @@ -111,16 +116,6 @@ class FilterList(FilterSettingsMixin): null=False, default=True ) - server_message_text = models.CharField( - max_length=100, - help_text="The message to send on the server", - null=True - ) - server_message_embed = models.CharField( - max_length=100, - help_text="The content of the server message embed", - null=True - ) # Where a filter should apply. # # The resolution is done in the following order: @@ -183,16 +178,6 @@ class Filter(FilterSettingsMixin): help_text="Whether alert should be sent.", null=True ) - server_message_text = models.CharField( - max_length=100, - help_text="The message to send on the server", - null=True - ) - server_message_embed = models.CharField( - max_length=100, - help_text="The content of the server message embed", - null=True - ) # Check FilterList model for information about these properties. enabled_channels = ArrayField(models.IntegerField(), null=True) |