aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-07-18 13:29:51 -0700
committerGravatar MarkKoz <[email protected]>2020-07-31 23:01:26 -0700
commit578477da164ef8c3ff77400b22e608a7d4c6d5f2 (patch)
tree47cafd4a9b58940fd7fc5ae802d444084cf3c2df
parentDecorators: use new func utils in respect_role_hierarchy (diff)
Decorators: remove default value for respect_role_hierarchy
Explicit is better than implicit, and this default value wasn't much of a convenience.
-rw-r--r--bot/cogs/moderation/infractions.py4
-rw-r--r--bot/decorators.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/bot/cogs/moderation/infractions.py b/bot/cogs/moderation/infractions.py
index 8df642428..d720c2911 100644
--- a/bot/cogs/moderation/infractions.py
+++ b/bot/cogs/moderation/infractions.py
@@ -230,7 +230,7 @@ class Infractions(InfractionScheduler, commands.Cog):
await self.apply_infraction(ctx, infraction, user, action())
- @respect_role_hierarchy()
+ @respect_role_hierarchy(2)
async def apply_kick(self, ctx: Context, user: Member, reason: t.Optional[str], **kwargs) -> None:
"""Apply a kick infraction with kwargs passed to `post_infraction`."""
infraction = await utils.post_infraction(ctx, user, "kick", reason, active=False, **kwargs)
@@ -245,7 +245,7 @@ class Infractions(InfractionScheduler, commands.Cog):
action = user.kick(reason=reason)
await self.apply_infraction(ctx, infraction, user, action)
- @respect_role_hierarchy()
+ @respect_role_hierarchy(2)
async def apply_ban(self, ctx: Context, user: UserSnowflake, reason: t.Optional[str], **kwargs) -> None:
"""
Apply a ban infraction with kwargs passed to `post_infraction`.
diff --git a/bot/decorators.py b/bot/decorators.py
index b4bf9ba05..6b2214f53 100644
--- a/bot/decorators.py
+++ b/bot/decorators.py
@@ -200,7 +200,7 @@ def redirect_output(destination_channel: int, bypass_roles: t.Container[int] = N
return wrap
-def respect_role_hierarchy(name_or_pos: Argument = 2) -> t.Callable:
+def respect_role_hierarchy(name_or_pos: Argument) -> t.Callable:
"""
Ensure the highest role of the invoking member is greater than that of the target member.