logs/common: haste bugfixes

This commit is contained in:
Ave Ozkal 2019-02-15 01:17:34 +03:00
parent c5b518e9c0
commit dc39f42e12
No known key found for this signature in database
GPG key ID: 09356ABAA42C842B
2 changed files with 5 additions and 2 deletions

View file

@ -146,6 +146,8 @@ class Common:
if response.status == 200: if response.status == 200:
result_json = await response.json() result_json = await response.json()
return f"{instance}{result_json['key']}" return f"{instance}{result_json['key']}"
else:
return f"Error {response.status}: {response.text}"
async def async_call_shell(self, shell_command: str, async def async_call_shell(self, shell_command: str,
inc_stdout=True, inc_stderr=True): inc_stdout=True, inc_stderr=True):

View file

@ -81,7 +81,7 @@ class Logs:
log_channel = self.bot.get_channel(config.log_channel) log_channel = self.bot.get_channel(config.log_channel)
msg = "📝 **Message edit**: \n"\ msg = "📝 **Message edit**: \n"\
f"from {self.bot.escape_message(after.author.name)} "\ f"from {self.bot.escape_message(after.author.name)} "\
f"({after.author.id})\n"\ f"({after.author.id}), in {after.channel.mention}:\n"\
f"`{before.clean_content}` → `{after.clean_content}`" f"`{before.clean_content}` → `{after.clean_content}`"
# If resulting message is too long, upload to hastebin # If resulting message is too long, upload to hastebin
@ -99,7 +99,8 @@ class Logs:
log_channel = self.bot.get_channel(config.log_channel) log_channel = self.bot.get_channel(config.log_channel)
msg = "🗑️ **Message delete**: \n"\ msg = "🗑️ **Message delete**: \n"\
f"from {self.bot.escape_message(message.author.name)} "\ f"from {self.bot.escape_message(message.author.name)} "\
f"({message.author.id})\n `{message.clean_content}`" f"({message.author.id}), in {message.channel.mention}:\n"\
f"`{message.clean_content}`"
# If resulting message is too long, upload to hastebin # If resulting message is too long, upload to hastebin
if len(msg) > 2000: if len(msg) > 2000: