mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-20 18:06:08 -05:00
[V3 Mod/Modlog] prevent self-casing the bot + feedback for heirarchy (#1777)
* prevent the bot from being a modlog target * prevent heirarchy issues in mod * modify this comparison to avoid more complex mocking of the guild object in mod test * spelling
This commit is contained in:
@@ -316,6 +316,9 @@ class Mod:
|
||||
)
|
||||
)
|
||||
return
|
||||
elif ctx.guild.me.top_role <= user.top_role or user == ctx.guild.owner:
|
||||
await ctx.send(_("I cannot do that due to discord hierarchy rules"))
|
||||
return
|
||||
audit_reason = get_audit_reason(author, reason)
|
||||
try:
|
||||
await guild.kick(user, reason=audit_reason)
|
||||
@@ -369,6 +372,9 @@ class Mod:
|
||||
)
|
||||
)
|
||||
return
|
||||
elif ctx.guild.me.top_role <= user.top_role or user == ctx.guild.owner:
|
||||
await ctx.send(_("I cannot do that due to discord hierarchy rules"))
|
||||
return
|
||||
|
||||
if days:
|
||||
if days.isdigit():
|
||||
|
||||
Reference in New Issue
Block a user