Revert "push local changes and hope that nothing breaks"

This reverts commit e85ecd41e5.

IT BROKE EVERYTHING
This commit is contained in:
Ave Ozkal 2019-02-22 20:09:58 +03:00
parent e85ecd41e5
commit 0384f0aad9
No known key found for this signature in database
GPG key ID: 09356ABAA42C842B
2 changed files with 8 additions and 32 deletions

View file

@ -135,34 +135,30 @@ async def on_command_error(ctx, error):
await bot.botlog_channel.send(err_msg) await bot.botlog_channel.send(err_msg)
if isinstance(error, commands.NoPrivateMessage): 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): elif isinstance(error, commands.MissingPermissions):
roles_needed = '\n- '.join(error.missing_perms) 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: " " permissions to run this command. You need: "
f"```- {roles_needed}```") f"```- {roles_needed}```")
await ctx.message.delete()
elif isinstance(error, commands.BotMissingPermissions): elif isinstance(error, commands.BotMissingPermissions):
roles_needed = '\n-'.join(error.missing_perms) 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. " "the right permissions to run this command. "
"Please add the following roles: " "Please add the following roles: "
f"```- {roles_needed}```") f"```- {roles_needed}```")
await ctx.message.delete()
elif isinstance(error, commands.CommandOnCooldown): 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 " "ratelimited. Try in "
f"{error.retry_after:.1f} seconds.") f"{error.retry_after:.1f} seconds.")
await ctx.message.delete()
elif isinstance(error, commands.CheckFailure): 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 " "You might not have the right permissions "
"to run this command, or you may not be able " "to run this command, or you may not be able "
"to run this command in the current channel.") "to run this command in the current channel.")
await ctx.message.delete()
elif isinstance(error, commands.CommandInvokeError) and\ elif isinstance(error, commands.CommandInvokeError) and\
("Cannot send messages to this user" in error_text): ("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 " "You might have me blocked or have DMs "
f"blocked globally or for {ctx.guild.name}.\n" f"blocked globally or for {ctx.guild.name}.\n"
"Please resolve that, then " "Please resolve that, then "
@ -171,10 +167,6 @@ async def on_command_error(ctx, error):
# Nothing to do when command is not found. # Nothing to do when command is not found.
return 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}"\ help_text = f"Usage of this command is: ```{ctx.prefix}"\
f"{ctx.command.signature}```\nPlease see `{ctx.prefix}help "\ f"{ctx.command.signature}```\nPlease see `{ctx.prefix}help "\
f"{ctx.command.name}` for more info about this command." f"{ctx.command.name}` for more info about this command."

View file

@ -72,8 +72,6 @@ class Mod:
"it is recommended to use `.mute <user> [reason]`"\ "it is recommended to use `.mute <user> [reason]`"\
" as the reason is automatically sent to the user." " 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) log_channel = self.bot.get_channel(config.modlog_channel)
await log_channel.send(chan_message) await log_channel.send(chan_message)
await ctx.send(f"{target.mention} can no longer speak.") await ctx.send(f"{target.mention} can no longer speak.")
@ -93,8 +91,6 @@ class Mod:
f"{target.mention} | {safe_name}\n"\ f"{target.mention} | {safe_name}\n"\
f"🏷 __User ID__: {target.id}\n" f"🏷 __User ID__: {target.id}\n"
chan_message += f"\nJump: <{ctx.message.jump_url}>"
log_channel = self.bot.get_channel(config.modlog_channel) log_channel = self.bot.get_channel(config.modlog_channel)
await log_channel.send(chan_message) await log_channel.send(chan_message)
await ctx.send(f"{target.mention} can now speak again.") await ctx.send(f"{target.mention} can now speak again.")
@ -142,8 +138,6 @@ class Mod:
"`.kick <user> [reason]`"\ "`.kick <user> [reason]`"\
" as the reason is automatically sent to the user." " 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) log_channel = self.bot.get_channel(config.modlog_channel)
await log_channel.send(chan_message) await log_channel.send(chan_message)
@ -188,8 +182,6 @@ class Mod:
", it is recommended to use `.ban <user> [reason]`"\ ", it is recommended to use `.ban <user> [reason]`"\
" as the reason is automatically sent to the user." " 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) log_channel = self.bot.get_channel(config.modlog_channel)
await log_channel.send(chan_message) await log_channel.send(chan_message)
await ctx.send(f"{safe_name} is now b&. 👍") await ctx.send(f"{safe_name} is now b&. 👍")
@ -226,8 +218,6 @@ class Mod:
", it is recommended to use "\ ", it is recommended to use "\
"`.hackban <user> [reason]`." "`.hackban <user> [reason]`."
chan_message += f"\nJump: <{ctx.message.jump_url}>"
log_channel = self.bot.get_channel(config.modlog_channel) log_channel = self.bot.get_channel(config.modlog_channel)
await log_channel.send(chan_message) await log_channel.send(chan_message)
await ctx.send(f"{safe_name} is now b&. 👍") await ctx.send(f"{safe_name} is now b&. 👍")
@ -261,8 +251,6 @@ class Mod:
", it is recommended to use `.ban <user> [reason]`"\ ", it is recommended to use `.ban <user> [reason]`"\
" as the reason is automatically sent to the user." " 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) log_channel = self.bot.get_channel(config.modlog_channel)
await log_channel.send(chan_message) await log_channel.send(chan_message)
@ -287,8 +275,7 @@ class Mod:
await ctx.send(f"Approved {target.mention} to `{role}` role.") await ctx.send(f"Approved {target.mention} to `{role}` role.")
await log_channel.send(f"✅ Approved: {ctx.author.mention} added" 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.guild_only()
@commands.check(check_if_staff) @commands.check(check_if_staff)
@ -311,8 +298,7 @@ class Mod:
await ctx.send(f"Un-approved {target.mention} from `{role}` role.") await ctx.send(f"Un-approved {target.mention} from `{role}` role.")
await log_channel.send(f"❌ Un-approved: {ctx.author.mention} removed" 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.guild_only()
@commands.check(check_if_staff) @commands.check(check_if_staff)
@ -325,7 +311,6 @@ class Mod:
await channel.purge(limit=limit) await channel.purge(limit=limit)
msg = f"🗑 **Purged**: {ctx.author.mention} purged {limit} "\ msg = f"🗑 **Purged**: {ctx.author.mention} purged {limit} "\
f"messages in {channel.mention}." f"messages in {channel.mention}."
msg += f"\nJump: <{ctx.message.jump_url}>"
await log_channel.send(msg) await log_channel.send(msg)
@commands.guild_only() @commands.guild_only()
@ -386,7 +371,6 @@ class Mod:
msg += "Please add an explanation below. In the future"\ msg += "Please add an explanation below. In the future"\
", it is recommended to use `.ban <user> [reason]`"\ ", it is recommended to use `.ban <user> [reason]`"\
" as the reason is automatically sent to the user." " as the reason is automatically sent to the user."
msg += f"\nJump: <{ctx.message.jump_url}>"
await log_channel.send(msg) await log_channel.send(msg)
@commands.guild_only() @commands.guild_only()