aboutsummaryrefslogtreecommitdiffstats
path: root/bot/utils/moderation.py
diff options
context:
space:
mode:
Diffstat (limited to 'bot/utils/moderation.py')
-rw-r--r--bot/utils/moderation.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/bot/utils/moderation.py b/bot/utils/moderation.py
index c1eb98dd6..9ea2db07c 100644
--- a/bot/utils/moderation.py
+++ b/bot/utils/moderation.py
@@ -21,8 +21,8 @@ async def post_infraction(
expires_at: datetime = None,
hidden: bool = False,
active: bool = True,
-):
-
+) -> Union[dict, None]:
+ """Post infraction to the API."""
payload = {
"actor": ctx.message.author.id,
"hidden": hidden,
@@ -35,9 +35,7 @@ async def post_infraction(
payload['expires_at'] = expires_at.isoformat()
try:
- response = await ctx.bot.api_client.post(
- 'bot/infractions', json=payload
- )
+ response = await ctx.bot.api_client.post('bot/infractions', json=payload)
except ClientError:
log.exception("There was an error adding an infraction.")
await ctx.send(":x: There was an error adding the infraction.")