mirror of
https://github.com/Ryujinx/ryuko-ng.git
synced 2025-01-09 21:55:36 +00:00
mod: Give priority to hedge
This commit is contained in:
parent
3e86b8d519
commit
82390d8dfb
59
cogs/mod.py
59
cogs/mod.py
|
@ -43,13 +43,13 @@ class ModCog:
|
||||||
@commands.command()
|
@commands.command()
|
||||||
async def mute(self, ctx, target: discord.Member, *, reason: str = ""):
|
async def mute(self, ctx, target: discord.Member, *, reason: str = ""):
|
||||||
"""Mutes a user, staff only."""
|
"""Mutes a user, staff only."""
|
||||||
# so that muted people can't just leave and rejoin
|
# Hedge-proofing the code
|
||||||
if self.check_if_target_is_staff(target):
|
if target == ctx.author:
|
||||||
|
return await ctx.send("You can't do mod actions on yourself"
|
||||||
|
", hedge.")
|
||||||
|
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.")
|
||||||
# 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))
|
safe_name = self.bot.escape_message(str(target))
|
||||||
|
|
||||||
|
@ -89,10 +89,6 @@ class ModCog:
|
||||||
@commands.command()
|
@commands.command()
|
||||||
async def unmute(self, ctx, target: discord.Member):
|
async def unmute(self, ctx, target: discord.Member):
|
||||||
"""Unmutes a user, staff only."""
|
"""Unmutes a user, staff only."""
|
||||||
if self.check_if_target_is_staff(target):
|
|
||||||
return await ctx.send("I can't unmute this user as "
|
|
||||||
"they're a member of staff.")
|
|
||||||
|
|
||||||
safe_name = self.bot.escape_message(str(target))
|
safe_name = self.bot.escape_message(str(target))
|
||||||
|
|
||||||
mute_role = ctx.guild.get_role(config.mute_role)
|
mute_role = ctx.guild.get_role(config.mute_role)
|
||||||
|
@ -113,12 +109,13 @@ class ModCog:
|
||||||
@commands.command()
|
@commands.command()
|
||||||
async def kick(self, ctx, target: discord.Member, *, reason: str = ""):
|
async def kick(self, ctx, target: discord.Member, *, reason: str = ""):
|
||||||
"""Kicks a user, staff only."""
|
"""Kicks a user, staff only."""
|
||||||
if self.check_if_target_is_staff(target):
|
# Hedge-proofing the code
|
||||||
|
if target == ctx.author:
|
||||||
|
return await ctx.send("You can't do mod actions on yourself"
|
||||||
|
", hedge.")
|
||||||
|
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.")
|
||||||
# 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))
|
safe_name = self.bot.escape_message(str(target))
|
||||||
|
|
||||||
|
@ -155,12 +152,13 @@ class ModCog:
|
||||||
@commands.command()
|
@commands.command()
|
||||||
async def ban(self, ctx, target: discord.Member, *, reason: str = ""):
|
async def ban(self, ctx, target: discord.Member, *, reason: str = ""):
|
||||||
"""Bans a user, staff only."""
|
"""Bans a user, staff only."""
|
||||||
if self.check_if_target_is_staff(target):
|
# Hedge-proofing the code
|
||||||
|
if target == ctx.author:
|
||||||
|
return await ctx.send("You can't do mod actions on yourself"
|
||||||
|
", hedge.")
|
||||||
|
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.")
|
||||||
# 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))
|
safe_name = self.bot.escape_message(str(target))
|
||||||
|
|
||||||
|
@ -195,12 +193,13 @@ class ModCog:
|
||||||
async def hackban(self, ctx, target: int, *, reason: str = ""):
|
async def hackban(self, ctx, target: int, *, reason: str = ""):
|
||||||
"""Bans a user with their ID, doesn't message them, staff only."""
|
"""Bans a user with their ID, doesn't message them, staff only."""
|
||||||
target = ctx.guild.get_member(target)
|
target = ctx.guild.get_member(target)
|
||||||
if self.check_if_target_is_staff(target):
|
# Hedge-proofing the code
|
||||||
|
if target == ctx.author:
|
||||||
|
return await ctx.send("You can't do mod actions on yourself"
|
||||||
|
", hedge.")
|
||||||
|
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.")
|
||||||
# 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))
|
safe_name = self.bot.escape_message(str(target))
|
||||||
|
|
||||||
|
@ -226,12 +225,13 @@ class ModCog:
|
||||||
@commands.command()
|
@commands.command()
|
||||||
async def silentban(self, ctx, target: discord.Member, *, reason: str = ""):
|
async def silentban(self, ctx, target: discord.Member, *, reason: str = ""):
|
||||||
"""Bans a user, staff only."""
|
"""Bans a user, staff only."""
|
||||||
if self.check_if_target_is_staff(target):
|
# Hedge-proofing the code
|
||||||
|
if target == ctx.author:
|
||||||
|
return await ctx.send("You can't do mod actions on yourself"
|
||||||
|
", hedge.")
|
||||||
|
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.")
|
||||||
# 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))
|
safe_name = self.bot.escape_message(str(target))
|
||||||
|
|
||||||
|
@ -377,12 +377,13 @@ class ModCog:
|
||||||
@commands.command()
|
@commands.command()
|
||||||
async def warn(self, ctx, target: discord.Member, *, reason: str = ""):
|
async def warn(self, ctx, target: discord.Member, *, reason: str = ""):
|
||||||
"""Warn a user. Staff only."""
|
"""Warn a user. Staff only."""
|
||||||
if self.check_if_target_is_staff(target):
|
# Hedge-proofing the code
|
||||||
|
if target == ctx.author:
|
||||||
|
return await ctx.send("You can't do mod actions on yourself"
|
||||||
|
", hedge.")
|
||||||
|
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.")
|
||||||
# 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)
|
log_channel = self.bot.get_channel(config.log_channel)
|
||||||
with open("data/warnsv2.json", "r") as f:
|
with open("data/warnsv2.json", "r") as f:
|
||||||
|
|
Loading…
Reference in a new issue