aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2019-12-19 14:56:53 -0800
committerGravatar MarkKoz <[email protected]>2019-12-19 15:00:21 -0800
commitc649b3b048e61e535bead99c4bbab25f2a82a66f (patch)
tree511fe9a4f5ef19f94257f09db8473da4089e9f90
parentUse OAuth to be Reddit API compliant (#696) (diff)
Moderation: explicitly set active value when posting infractions
Required due to changes in the API making the active field required. See python-discord/site/pull/317
-rw-r--r--bot/cogs/moderation/infractions.py6
-rw-r--r--bot/cogs/moderation/superstarify.py2
-rw-r--r--bot/cogs/watchchannels/bigbrother.py2
3 files changed, 5 insertions, 5 deletions
diff --git a/bot/cogs/moderation/infractions.py b/bot/cogs/moderation/infractions.py
index 3536a3d38..fcfde1e68 100644
--- a/bot/cogs/moderation/infractions.py
+++ b/bot/cogs/moderation/infractions.py
@@ -203,7 +203,7 @@ class Infractions(InfractionScheduler, commands.Cog):
if await utils.has_active_infraction(ctx, user, "mute"):
return
- infraction = await utils.post_infraction(ctx, user, "mute", reason, **kwargs)
+ infraction = await utils.post_infraction(ctx, user, "mute", reason, active=True, **kwargs)
if infraction is None:
return
@@ -220,7 +220,7 @@ class Infractions(InfractionScheduler, commands.Cog):
@respect_role_hierarchy()
async def apply_kick(self, ctx: Context, user: Member, reason: str, **kwargs) -> None:
"""Apply a kick infraction with kwargs passed to `post_infraction`."""
- infraction = await utils.post_infraction(ctx, user, "kick", reason, **kwargs)
+ infraction = await utils.post_infraction(ctx, user, "kick", reason, active=False, **kwargs)
if infraction is None:
return
@@ -235,7 +235,7 @@ class Infractions(InfractionScheduler, commands.Cog):
if await utils.has_active_infraction(ctx, user, "ban"):
return
- infraction = await utils.post_infraction(ctx, user, "ban", reason, **kwargs)
+ infraction = await utils.post_infraction(ctx, user, "ban", reason, active=True, **kwargs)
if infraction is None:
return
diff --git a/bot/cogs/moderation/superstarify.py b/bot/cogs/moderation/superstarify.py
index 7631d9bbe..1e19e943e 100644
--- a/bot/cogs/moderation/superstarify.py
+++ b/bot/cogs/moderation/superstarify.py
@@ -133,7 +133,7 @@ class Superstarify(InfractionScheduler, Cog):
# Post the infraction to the API
reason = reason or f"old nick: {member.display_name}"
- infraction = await utils.post_infraction(ctx, member, "superstar", reason, duration)
+ infraction = await utils.post_infraction(ctx, member, "superstar", reason, duration, active=True)
id_ = infraction["id"]
old_nick = member.display_name
diff --git a/bot/cogs/watchchannels/bigbrother.py b/bot/cogs/watchchannels/bigbrother.py
index 306ed4c64..fbee4f5d7 100644
--- a/bot/cogs/watchchannels/bigbrother.py
+++ b/bot/cogs/watchchannels/bigbrother.py
@@ -65,7 +65,7 @@ class BigBrother(WatchChannel, Cog, name="Big Brother"):
await ctx.send(":x: The specified user is already being watched.")
return
- response = await post_infraction(ctx, user, 'watch', reason, hidden=True)
+ response = await post_infraction(ctx, user, 'watch', reason, hidden=True, active=True)
if response is not None:
self.watched_users[user.id] = response