diff options
author | 2019-01-06 20:18:51 +0100 | |
---|---|---|
committer | 2019-01-06 20:19:06 +0100 | |
commit | 6e640122cca34bd8a060f75f44a878a00f2b30c5 (patch) | |
tree | 36dcef814729ab18574d6092060d5b68fe4e4192 /bot/utils/moderation.py | |
parent | Move note and warning creation to Django API backend. (diff) |
Move all moderation commands to the Django API.
Diffstat (limited to 'bot/utils/moderation.py')
-rw-r--r-- | bot/utils/moderation.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bot/utils/moderation.py b/bot/utils/moderation.py index 459fe6eb3..2611ee993 100644 --- a/bot/utils/moderation.py +++ b/bot/utils/moderation.py @@ -1,4 +1,5 @@ import logging +from datetime import datetime from typing import Union from aiohttp import ClientError @@ -14,7 +15,7 @@ HEADERS = {"X-API-KEY": Keys.site_api} async def post_infraction( ctx: Context, user: Union[Member, Object, User], - type: str, reason: str, duration: str = None, hidden: bool = False + type: str, reason: str, expires_at: datetime = None, hidden: bool = False ): payload = { @@ -24,8 +25,8 @@ async def post_infraction( "type": type, "user": user.id } - if duration: - payload['duration'] = duration + if expires_at: + payload['expires_at'] = expires_at.isoformat() try: response = await ctx.bot.api_client.post( |