aboutsummaryrefslogtreecommitdiffstats
path: root/bot/utils/moderation.py
diff options
context:
space:
mode:
authorGravatar sco1 <[email protected]>2019-09-10 21:56:25 -0400
committerGravatar sco1 <[email protected]>2019-09-10 21:56:25 -0400
commit4f2ca226fe61b62e4e560805f3adbc2abd3d5c16 (patch)
tree9d2fa3c6653919dc6e2f0f450bd0488d77dcd9ce /bot/utils/moderation.py
parentDocstring linting chunk 6 (diff)
Docstring linting chunk 7
Whew
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.")