aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar sco1 <[email protected]>2019-01-09 16:59:43 -0500
committerGravatar sco1 <[email protected]>2019-01-09 16:59:43 -0500
commitd25ac2c3fc1d83a0022f456ee2189507e249e35a (patch)
tree3bf7fd43418a331ab3bbfe6a4905943f2c12dbc7
parentAdd missing awaits (diff)
Get member object for ban infractions to pass to hierarchy check
-rw-r--r--bot/cogs/moderation.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/bot/cogs/moderation.py b/bot/cogs/moderation.py
index 1db7df3dd..46c10e084 100644
--- a/bot/cogs/moderation.py
+++ b/bot/cogs/moderation.py
@@ -176,7 +176,8 @@ class Moderation(Scheduler):
:param reason: The reason for the ban.
"""
- if not await self.respect_role_hierarchy(ctx, user, 'ban'):
+ member = ctx.guild.get_member(user.id)
+ if not await self.respect_role_hierarchy(ctx, member, 'ban'):
# Ensure ctx author has a higher top role than the target user
# Warning is sent to ctx by the helper method
return
@@ -337,7 +338,8 @@ class Moderation(Scheduler):
:param reason: The reason for the temporary ban.
"""
- if not await self.respect_role_hierarchy(ctx, user, 'tempban'):
+ member = ctx.guild.get_member(user.id)
+ if not await self.respect_role_hierarchy(ctx, member, 'tempban'):
# Ensure ctx author has a higher top role than the target user
# Warning is sent to ctx by the helper method
return
@@ -476,7 +478,8 @@ class Moderation(Scheduler):
:param reason: The reason for the ban.
"""
- if not await self.respect_role_hierarchy(ctx, user, 'shadowban'):
+ member = ctx.guild.get_member(user.id)
+ if not await self.respect_role_hierarchy(ctx, member, 'shadowban'):
# Ensure ctx author has a higher top role than the target user
# Warning is sent to ctx by the helper method
return
@@ -606,7 +609,8 @@ class Moderation(Scheduler):
:param reason: The reason for the temporary ban.
"""
- if not await self.respect_role_hierarchy(ctx, user, 'shadowtempban'):
+ member = ctx.guild.get_member(user.id)
+ if not await self.respect_role_hierarchy(ctx, member, 'shadowtempban'):
# Ensure ctx author has a higher top role than the target user
# Warning is sent to ctx by the helper method
return