push local changes and hope that nothing breaks
This commit is contained in:
parent
4164786b40
commit
e85ecd41e5
2 changed files with 32 additions and 8 deletions
20
Robocop.py
20
Robocop.py
|
@ -135,30 +135,34 @@ async def on_command_error(ctx, error):
|
|||
await bot.botlog_channel.send(err_msg)
|
||||
|
||||
if isinstance(error, commands.NoPrivateMessage):
|
||||
return await ctx.send("This command doesn't work on DMs.")
|
||||
resp = await ctx.send("This command doesn't work on DMs.")
|
||||
elif isinstance(error, commands.MissingPermissions):
|
||||
roles_needed = '\n- '.join(error.missing_perms)
|
||||
return await ctx.send(f"{ctx.author.mention}: You don't have the right"
|
||||
resp = await ctx.send(f"{ctx.author.mention}: You don't have the right"
|
||||
" permissions to run this command. You need: "
|
||||
f"```- {roles_needed}```")
|
||||
await ctx.message.delete()
|
||||
elif isinstance(error, commands.BotMissingPermissions):
|
||||
roles_needed = '\n-'.join(error.missing_perms)
|
||||
return await ctx.send(f"{ctx.author.mention}: Bot doesn't have "
|
||||
resp = await ctx.send(f"{ctx.author.mention}: Bot doesn't have "
|
||||
"the right permissions to run this command. "
|
||||
"Please add the following roles: "
|
||||
f"```- {roles_needed}```")
|
||||
await ctx.message.delete()
|
||||
elif isinstance(error, commands.CommandOnCooldown):
|
||||
return await ctx.send(f"{ctx.author.mention}: You're being "
|
||||
resp = await ctx.send(f"{ctx.author.mention}: You're being "
|
||||
"ratelimited. Try in "
|
||||
f"{error.retry_after:.1f} seconds.")
|
||||
await ctx.message.delete()
|
||||
elif isinstance(error, commands.CheckFailure):
|
||||
return await ctx.send(f"{ctx.author.mention}: Check failed. "
|
||||
resp = await ctx.send(f"{ctx.author.mention}: Check failed. "
|
||||
"You might not have the right permissions "
|
||||
"to run this command, or you may not be able "
|
||||
"to run this command in the current channel.")
|
||||
await ctx.message.delete()
|
||||
elif isinstance(error, commands.CommandInvokeError) and\
|
||||
("Cannot send messages to this user" in error_text):
|
||||
return await ctx.send(f"{ctx.author.mention}: I can't DM you.\n"
|
||||
resp = await ctx.send(f"{ctx.author.mention}: I can't DM you.\n"
|
||||
"You might have me blocked or have DMs "
|
||||
f"blocked globally or for {ctx.guild.name}.\n"
|
||||
"Please resolve that, then "
|
||||
|
@ -167,6 +171,10 @@ async def on_command_error(ctx, error):
|
|||
# Nothing to do when command is not found.
|
||||
return
|
||||
|
||||
# Delete warn message after 5 seconds
|
||||
await asyncio.sleep(5)
|
||||
return await resp.delete()
|
||||
|
||||
help_text = f"Usage of this command is: ```{ctx.prefix}"\
|
||||
f"{ctx.command.signature}```\nPlease see `{ctx.prefix}help "\
|
||||
f"{ctx.command.name}` for more info about this command."
|
||||
|
|
20
cogs/mod.py
20
cogs/mod.py
|
@ -72,6 +72,8 @@ class Mod:
|
|||
"it is recommended to use `.mute <user> [reason]`"\
|
||||
" as the reason is automatically sent to the user."
|
||||
|
||||
chan_message += f"\nJump: <{ctx.message.jump_url}>"
|
||||
|
||||
log_channel = self.bot.get_channel(config.modlog_channel)
|
||||
await log_channel.send(chan_message)
|
||||
await ctx.send(f"{target.mention} can no longer speak.")
|
||||
|
@ -91,6 +93,8 @@ class Mod:
|
|||
f"{target.mention} | {safe_name}\n"\
|
||||
f"🏷 __User ID__: {target.id}\n"
|
||||
|
||||
chan_message += f"\nJump: <{ctx.message.jump_url}>"
|
||||
|
||||
log_channel = self.bot.get_channel(config.modlog_channel)
|
||||
await log_channel.send(chan_message)
|
||||
await ctx.send(f"{target.mention} can now speak again.")
|
||||
|
@ -138,6 +142,8 @@ class Mod:
|
|||
"`.kick <user> [reason]`"\
|
||||
" as the reason is automatically sent to the user."
|
||||
|
||||
chan_message += f"\nJump: <{ctx.message.jump_url}>"
|
||||
|
||||
log_channel = self.bot.get_channel(config.modlog_channel)
|
||||
await log_channel.send(chan_message)
|
||||
|
||||
|
@ -182,6 +188,8 @@ class Mod:
|
|||
", it is recommended to use `.ban <user> [reason]`"\
|
||||
" as the reason is automatically sent to the user."
|
||||
|
||||
chan_message += f"\nJump: <{ctx.message.jump_url}>"
|
||||
|
||||
log_channel = self.bot.get_channel(config.modlog_channel)
|
||||
await log_channel.send(chan_message)
|
||||
await ctx.send(f"{safe_name} is now b&. 👍")
|
||||
|
@ -218,6 +226,8 @@ class Mod:
|
|||
", it is recommended to use "\
|
||||
"`.hackban <user> [reason]`."
|
||||
|
||||
chan_message += f"\nJump: <{ctx.message.jump_url}>"
|
||||
|
||||
log_channel = self.bot.get_channel(config.modlog_channel)
|
||||
await log_channel.send(chan_message)
|
||||
await ctx.send(f"{safe_name} is now b&. 👍")
|
||||
|
@ -251,6 +261,8 @@ class Mod:
|
|||
", it is recommended to use `.ban <user> [reason]`"\
|
||||
" as the reason is automatically sent to the user."
|
||||
|
||||
chan_message += f"\nJump: <{ctx.message.jump_url}>"
|
||||
|
||||
log_channel = self.bot.get_channel(config.modlog_channel)
|
||||
await log_channel.send(chan_message)
|
||||
|
||||
|
@ -275,7 +287,8 @@ class Mod:
|
|||
await ctx.send(f"Approved {target.mention} to `{role}` role.")
|
||||
|
||||
await log_channel.send(f"✅ Approved: {ctx.author.mention} added"
|
||||
f" {role} to {target.mention}")
|
||||
f" {role} to {target.mention} | "
|
||||
f"<{ctx.message.jump_url}>")
|
||||
|
||||
@commands.guild_only()
|
||||
@commands.check(check_if_staff)
|
||||
|
@ -298,7 +311,8 @@ class Mod:
|
|||
await ctx.send(f"Un-approved {target.mention} from `{role}` role.")
|
||||
|
||||
await log_channel.send(f"❌ Un-approved: {ctx.author.mention} removed"
|
||||
f" {role} from {target.mention}")
|
||||
f" {role} from {target.mention} | "
|
||||
f"<{ctx.message.jump_url}>")
|
||||
|
||||
@commands.guild_only()
|
||||
@commands.check(check_if_staff)
|
||||
|
@ -311,6 +325,7 @@ class Mod:
|
|||
await channel.purge(limit=limit)
|
||||
msg = f"🗑 **Purged**: {ctx.author.mention} purged {limit} "\
|
||||
f"messages in {channel.mention}."
|
||||
msg += f"\nJump: <{ctx.message.jump_url}>"
|
||||
await log_channel.send(msg)
|
||||
|
||||
@commands.guild_only()
|
||||
|
@ -371,6 +386,7 @@ class Mod:
|
|||
msg += "Please add an explanation below. In the future"\
|
||||
", it is recommended to use `.ban <user> [reason]`"\
|
||||
" as the reason is automatically sent to the user."
|
||||
msg += f"\nJump: <{ctx.message.jump_url}>"
|
||||
await log_channel.send(msg)
|
||||
|
||||
@commands.guild_only()
|
||||
|
|
Loading…
Reference in a new issue