mod: Improve hedgeproofing by also mod blocking actions on bot
This commit is contained in:
parent
c91284cd92
commit
a595baa2ad
1 changed files with 18 additions and 0 deletions
18
cogs/mod.py
18
cogs/mod.py
|
@ -40,6 +40,9 @@ class Mod(Cog):
|
||||||
# Hedge-proofing the code
|
# Hedge-proofing the code
|
||||||
if target == ctx.author:
|
if target == ctx.author:
|
||||||
return await ctx.send("You can't do mod actions on yourself.")
|
return await ctx.send("You can't do mod actions on yourself.")
|
||||||
|
elif target == self.bot.user:
|
||||||
|
return await ctx.send(f"I'm sorry {ctx.author.mention}, "
|
||||||
|
"I'm afraid I can't do that.")
|
||||||
elif self.check_if_target_is_staff(target):
|
elif self.check_if_target_is_staff(target):
|
||||||
return await ctx.send("I can't mute this user as "
|
return await ctx.send("I can't mute this user as "
|
||||||
"they're a member of staff.")
|
"they're a member of staff.")
|
||||||
|
@ -106,6 +109,9 @@ class Mod(Cog):
|
||||||
# Hedge-proofing the code
|
# Hedge-proofing the code
|
||||||
if target == ctx.author:
|
if target == ctx.author:
|
||||||
return await ctx.send("You can't do mod actions on yourself.")
|
return await ctx.send("You can't do mod actions on yourself.")
|
||||||
|
elif target == self.bot.user:
|
||||||
|
return await ctx.send(f"I'm sorry {ctx.author.mention}, "
|
||||||
|
"I'm afraid I can't do that.")
|
||||||
elif self.check_if_target_is_staff(target):
|
elif self.check_if_target_is_staff(target):
|
||||||
return await ctx.send("I can't kick this user as "
|
return await ctx.send("I can't kick this user as "
|
||||||
"they're a member of staff.")
|
"they're a member of staff.")
|
||||||
|
@ -151,6 +157,9 @@ class Mod(Cog):
|
||||||
# Hedge-proofing the code
|
# Hedge-proofing the code
|
||||||
if target == ctx.author:
|
if target == ctx.author:
|
||||||
return await ctx.send("hedgeberg#7337 is now b&. 👍")
|
return await ctx.send("hedgeberg#7337 is now b&. 👍")
|
||||||
|
elif target == self.bot.user:
|
||||||
|
return await ctx.send(f"I'm sorry {ctx.author.mention}, "
|
||||||
|
"I'm afraid I can't do that.")
|
||||||
elif self.check_if_target_is_staff(target):
|
elif self.check_if_target_is_staff(target):
|
||||||
return await ctx.send("I can't ban this user as "
|
return await ctx.send("I can't ban this user as "
|
||||||
"they're a member of staff.")
|
"they're a member of staff.")
|
||||||
|
@ -198,6 +207,9 @@ class Mod(Cog):
|
||||||
# Hedge-proofing the code
|
# Hedge-proofing the code
|
||||||
if target == ctx.author.id:
|
if target == ctx.author.id:
|
||||||
return await ctx.send("You can't do mod actions on yourself.")
|
return await ctx.send("You can't do mod actions on yourself.")
|
||||||
|
elif target == self.bot.user:
|
||||||
|
return await ctx.send(f"I'm sorry {ctx.author.mention}, "
|
||||||
|
"I'm afraid I can't do that.")
|
||||||
elif target_member and self.check_if_target_is_staff(target_member):
|
elif target_member and self.check_if_target_is_staff(target_member):
|
||||||
return await ctx.send("I can't ban this user as "
|
return await ctx.send("I can't ban this user as "
|
||||||
"they're a member of staff.")
|
"they're a member of staff.")
|
||||||
|
@ -232,6 +244,9 @@ class Mod(Cog):
|
||||||
# Hedge-proofing the code
|
# Hedge-proofing the code
|
||||||
if target == ctx.author:
|
if target == ctx.author:
|
||||||
return await ctx.send("You can't do mod actions on yourself.")
|
return await ctx.send("You can't do mod actions on yourself.")
|
||||||
|
elif target == self.bot.user:
|
||||||
|
return await ctx.send(f"I'm sorry {ctx.author.mention}, "
|
||||||
|
"I'm afraid I can't do that.")
|
||||||
elif self.check_if_target_is_staff(target):
|
elif self.check_if_target_is_staff(target):
|
||||||
return await ctx.send("I can't ban this user as "
|
return await ctx.send("I can't ban this user as "
|
||||||
"they're a member of staff.")
|
"they're a member of staff.")
|
||||||
|
@ -322,6 +337,9 @@ class Mod(Cog):
|
||||||
# Hedge-proofing the code
|
# Hedge-proofing the code
|
||||||
if target == ctx.author:
|
if target == ctx.author:
|
||||||
return await ctx.send("You can't do mod actions on yourself.")
|
return await ctx.send("You can't do mod actions on yourself.")
|
||||||
|
elif target == self.bot.user:
|
||||||
|
return await ctx.send(f"I'm sorry {ctx.author.mention}, "
|
||||||
|
"I'm afraid I can't do that.")
|
||||||
elif self.check_if_target_is_staff(target):
|
elif self.check_if_target_is_staff(target):
|
||||||
return await ctx.send("I can't warn this user as "
|
return await ctx.send("I can't warn this user as "
|
||||||
"they're a member of staff.")
|
"they're a member of staff.")
|
||||||
|
|
Loading…
Reference in a new issue