From e22667ce905beb4bf315b4fbbea96803dd4b57c1 Mon Sep 17 00:00:00 2001 From: Ske Date: Mon, 16 Jul 2018 01:06:29 +0200 Subject: [PATCH] Make the bot silently continue if logging fails --- bot/pluralkit/proxy.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bot/pluralkit/proxy.py b/bot/pluralkit/proxy.py index c8470db7..624a963e 100644 --- a/bot/pluralkit/proxy.py +++ b/bot/pluralkit/proxy.py @@ -33,7 +33,11 @@ async def log_message(original_message, hook_message, member, log_channel): message_link = "https://discordapp.com/channels/{}/{}/{}".format(original_message.server.id, original_message.channel.id, hook_message.id) embed.author.url = message_link - await client.send_message(log_channel, embed=embed) + try: + await client.send_message(log_channel, embed=embed) + except discord.errors.Forbidden: + # Ignore logging permission errors, perhaps make it spam a big nasty error instead + pass async def log_delete(hook_message, member, log_channel): embed = make_log_embed(hook_message, member, channel_name=hook_message.channel.name)