mirror of
https://github.com/Ryujinx/ryuko-ng.git
synced 2024-12-23 01:15:29 +00:00
mod: Hedge-proof the code
This commit is contained in:
parent
af446f4cfd
commit
3e86b8d519
18
cogs/mod.py
18
cogs/mod.py
|
@ -47,6 +47,9 @@ class ModCog:
|
|||
if self.check_if_target_is_staff(target):
|
||||
return await ctx.send("I can't mute this user as "
|
||||
"they're a member of staff.")
|
||||
# Hedge-proofing the code
|
||||
elif target == ctx.author:
|
||||
return await ctx.send("You can't do mod actions on yourself.")
|
||||
|
||||
safe_name = self.bot.escape_message(str(target))
|
||||
|
||||
|
@ -113,6 +116,9 @@ class ModCog:
|
|||
if self.check_if_target_is_staff(target):
|
||||
return await ctx.send("I can't kick this user as "
|
||||
"they're a member of staff.")
|
||||
# Hedge-proofing the code
|
||||
elif target == ctx.author:
|
||||
return await ctx.send("You can't do mod actions on yourself.")
|
||||
|
||||
safe_name = self.bot.escape_message(str(target))
|
||||
|
||||
|
@ -152,6 +158,9 @@ class ModCog:
|
|||
if self.check_if_target_is_staff(target):
|
||||
return await ctx.send("I can't ban this user as "
|
||||
"they're a member of staff.")
|
||||
# Hedge-proofing the code
|
||||
elif target == ctx.author:
|
||||
return await ctx.send("You can't do mod actions on yourself.")
|
||||
|
||||
safe_name = self.bot.escape_message(str(target))
|
||||
|
||||
|
@ -189,6 +198,9 @@ class ModCog:
|
|||
if self.check_if_target_is_staff(target):
|
||||
return await ctx.send("I can't ban this user as "
|
||||
"they're a member of staff.")
|
||||
# Hedge-proofing the code
|
||||
elif target == ctx.author.id:
|
||||
return await ctx.send("You can't do mod actions on yourself.")
|
||||
|
||||
safe_name = self.bot.escape_message(str(target))
|
||||
|
||||
|
@ -217,6 +229,9 @@ class ModCog:
|
|||
if self.check_if_target_is_staff(target):
|
||||
return await ctx.send("I can't ban this user as "
|
||||
"they're a member of staff.")
|
||||
# Hedge-proofing the code
|
||||
elif target == ctx.author:
|
||||
return await ctx.send("You can't do mod actions on yourself.")
|
||||
|
||||
safe_name = self.bot.escape_message(str(target))
|
||||
|
||||
|
@ -365,6 +380,9 @@ class ModCog:
|
|||
if self.check_if_target_is_staff(target):
|
||||
return await ctx.send("I can't warn this user as "
|
||||
"they're a member of staff.")
|
||||
# Hedge-proofing the code
|
||||
elif target == ctx.author:
|
||||
return await ctx.send("You can't do mod actions on yourself.")
|
||||
|
||||
log_channel = self.bot.get_channel(config.log_channel)
|
||||
with open("data/warnsv2.json", "r") as f:
|
||||
|
|
Loading…
Reference in a new issue