aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/api/viewsets/bot
diff options
context:
space:
mode:
authorGravatar D0rs4n <[email protected]>2021-12-06 20:22:01 +0100
committerGravatar D0rs4n <[email protected]>2021-12-18 18:02:12 +0100
commite3a45e09041898ffd0bccd3c730524e8c673e696 (patch)
tree32ea58b71d5bf74bf89177d6e728750ba4cfec80 /pydis_site/apps/api/viewsets/bot
parentAdjust Filter JSON Schema (diff)
Adjust FilterList Representation
From now on the FilterList Serializer will contain a settings field with all the settings that were listed previously, on the model.
Diffstat (limited to 'pydis_site/apps/api/viewsets/bot')
-rw-r--r--pydis_site/apps/api/viewsets/bot/filters.py49
1 files changed, 46 insertions, 3 deletions
diff --git a/pydis_site/apps/api/viewsets/bot/filters.py b/pydis_site/apps/api/viewsets/bot/filters.py
index 64329ebe..cbadcf2b 100644
--- a/pydis_site/apps/api/viewsets/bot/filters.py
+++ b/pydis_site/apps/api/viewsets/bot/filters.py
@@ -52,7 +52,28 @@ class FilterListViewSet(ModelViewSet):
... },
... ...
... ],
- ... "default_settings": 1
+ ... "settings": {
+ ... "dm_content": None,
+ ... "infraction_type": None,
+ ... "infraction_reason": "",
+ ... "infraction_duration": None,
+ ... "ping_type": [
+ ... "onduty"
+ ... ],
+ ... "filter_dm": True,
+ ... "dm_ping_type": [
+ ... "onduty"
+ ... ],
+ ... "delete_messages": True,
+ ... "bypass_roles": [
+ ... 267630620367257601
+ ... ],
+ ... "enabled": False,
+ ... "disallowed_channels": [],
+ ... "disallowed_categories": [],
+ ... "allowed_channels": [],
+ ... "allowed_categories": []
+ ... }
... },
... ...
... ]
@@ -65,6 +86,7 @@ class FilterListViewSet(ModelViewSet):
Returns a specific FilterList item from the database.
#### Response format
+ >>>
... {
... "id": 1,
... "name": "guild_invite",
@@ -95,9 +117,30 @@ class FilterListViewSet(ModelViewSet):
... }
...
... },
- ... ...
+ ...
... ],
- ... "default_settings": 1
+ ... "settings": {
+ ... "dm_content": None,
+ ... "infraction_type": None,
+ ... "infraction_reason": "",
+ ... "infraction_duration": None,
+ ... "ping_type": [
+ ... "onduty"
+ ... ],
+ ... "filter_dm": True,
+ ... "dm_ping_type": [
+ ... "onduty"
+ ... ],
+ ... "delete_messages": True,
+ ... "bypass_roles": [
+ ... 267630620367257601
+ ... ],
+ ... "enabled": False,
+ ... "disallowed_channels": [],
+ ... "disallowed_categories": [],
+ ... "allowed_channels": [],
+ ... "allowed_categories": []
+ ... }
... }
#### Status codes