From 0384f0aad9d2f65f27504ac295ac792740764b29 Mon Sep 17 00:00:00 2001 From: Ave Ozkal Date: Fri, 22 Feb 2019 20:09:58 +0300 Subject: [PATCH] Revert "push local changes and hope that nothing breaks" This reverts commit e85ecd41e58ebf679396b8ee47086f95ce6f644b. IT BROKE EVERYTHING --- Robocop.py | 20 ++++++-------------- cogs/mod.py | 20 ++------------------ 2 files changed, 8 insertions(+), 32 deletions(-) diff --git a/Robocop.py b/Robocop.py index 0c57cb6..10447c4 100755 --- a/Robocop.py +++ b/Robocop.py @@ -135,34 +135,30 @@ async def on_command_error(ctx, error): await bot.botlog_channel.send(err_msg) if isinstance(error, commands.NoPrivateMessage): - resp = await ctx.send("This command doesn't work on DMs.") + return await ctx.send("This command doesn't work on DMs.") elif isinstance(error, commands.MissingPermissions): roles_needed = '\n- '.join(error.missing_perms) - resp = await ctx.send(f"{ctx.author.mention}: You don't have the right" + return 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) - resp = await ctx.send(f"{ctx.author.mention}: Bot doesn't have " + return 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): - resp = await ctx.send(f"{ctx.author.mention}: You're being " + return 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): - resp = await ctx.send(f"{ctx.author.mention}: Check failed. " + return 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): - resp = await ctx.send(f"{ctx.author.mention}: I can't DM you.\n" + return 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 " @@ -171,10 +167,6 @@ 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." diff --git a/cogs/mod.py b/cogs/mod.py index faabb84..48b70d0 100644 --- a/cogs/mod.py +++ b/cogs/mod.py @@ -72,8 +72,6 @@ class Mod: "it is recommended to use `.mute [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.") @@ -93,8 +91,6 @@ 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.") @@ -142,8 +138,6 @@ class Mod: "`.kick [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) @@ -188,8 +182,6 @@ class Mod: ", it is recommended to use `.ban [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&. 👍") @@ -226,8 +218,6 @@ class Mod: ", it is recommended to use "\ "`.hackban [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&. 👍") @@ -261,8 +251,6 @@ class Mod: ", it is recommended to use `.ban [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) @@ -287,8 +275,7 @@ 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"<{ctx.message.jump_url}>") + f" {role} to {target.mention}") @commands.guild_only() @commands.check(check_if_staff) @@ -311,8 +298,7 @@ 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"<{ctx.message.jump_url}>") + f" {role} from {target.mention}") @commands.guild_only() @commands.check(check_if_staff) @@ -325,7 +311,6 @@ 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() @@ -386,7 +371,6 @@ class Mod: msg += "Please add an explanation below. In the future"\ ", it is recommended to use `.ban [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()