mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -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:
parent
e15815cd97
commit
8b15053dd4
@ -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():
|
||||
|
||||
@ -461,6 +461,9 @@ async def create_case(
|
||||
if not await case_type.is_enabled():
|
||||
return None
|
||||
|
||||
if user == bot.user:
|
||||
return None
|
||||
|
||||
next_case_number = int(await get_next_case_number(guild))
|
||||
|
||||
case = Case(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user