aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/api/viewsets
diff options
context:
space:
mode:
authorGravatar Dennis Pham <[email protected]>2020-07-20 13:56:10 -0400
committerGravatar GitHub <[email protected]>2020-07-20 13:56:10 -0400
commitd720d56e8d99bcc5df1679cfe83593c39fc0cb0e (patch)
tree04aba87e98d75d5052371139cca202c25311dba2 /pydis_site/apps/api/viewsets
parentBump jQuery version (diff)
parentFix misleading documentation (diff)
Merge pull request #370 from python-discord/role-reminders
Add mentions field to Reminders model
Diffstat (limited to 'pydis_site/apps/api/viewsets')
-rw-r--r--pydis_site/apps/api/viewsets/bot/reminder.py30
1 files changed, 28 insertions, 2 deletions
diff --git a/pydis_site/apps/api/viewsets/bot/reminder.py b/pydis_site/apps/api/viewsets/bot/reminder.py
index 147f6dbc..6f8a28f2 100644
--- a/pydis_site/apps/api/viewsets/bot/reminder.py
+++ b/pydis_site/apps/api/viewsets/bot/reminder.py
@@ -27,9 +27,16 @@ class ReminderViewSet(
... {
... 'active': True,
... 'author': 1020103901030,
+ ... 'mentions': [
+ ... 336843820513755157,
+ ... 165023948638126080,
+ ... 267628507062992896
+ ... ],
... 'content': "Make dinner",
... 'expiration': '5018-11-20T15:52:00Z',
- ... 'id': 11
+ ... 'id': 11,
+ ... 'channel_id': 634547009956872193,
+ ... 'jump_url': "https://discord.com/channels/<guild_id>/<channel_id>/<message_id>"
... },
... ...
... ]
@@ -43,8 +50,11 @@ class ReminderViewSet(
#### Request body
>>> {
... 'author': int,
+ ... 'mentions': List[int],
... 'content': str,
- ... 'expiration': str # ISO-formatted datetime
+ ... 'expiration': str, # ISO-formatted datetime
+ ... 'channel_id': int,
+ ... 'jump_url': str
... }
#### Status codes
@@ -52,6 +62,22 @@ class ReminderViewSet(
- 400: if the body format is invalid
- 404: if no user with the given ID could be found
+ ### PATCH /bot/reminders/<id:int>
+ Update the user with the given `id`.
+ All fields in the request body are optional.
+
+ #### Request body
+ >>> {
+ ... 'mentions': List[int],
+ ... 'content': str,
+ ... 'expiration': str # ISO-formatted datetime
+ ... }
+
+ #### Status codes
+ - 200: returned on success
+ - 400: if the body format is invalid
+ - 404: if no user with the given ID could be found
+
### DELETE /bot/reminders/<id:int>
Delete the reminder with the given `id`.