From f0a295e3eb714d53b33763b626d98e5cadb4787c Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Sun, 28 Oct 2018 01:07:41 +0000 Subject: [PATCH] Pass if there are no attribute --- discordbot/titanembeds/redisqueue.py | 2 +- discordbot/titanembeds/utils.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/discordbot/titanembeds/redisqueue.py b/discordbot/titanembeds/redisqueue.py index e4d275c..220b46b 100644 --- a/discordbot/titanembeds/redisqueue.py +++ b/discordbot/titanembeds/redisqueue.py @@ -189,7 +189,7 @@ class RedisQueue: await self.connection.set(key, "") await self.enforce_expiring_key(key) return - if guild.me.guild_permissions.manage_webhooks: + if guild.me and guild.me.guild_permissions.manage_webhooks: try: server_webhooks = await guild.webhooks() except: diff --git a/discordbot/titanembeds/utils.py b/discordbot/titanembeds/utils.py index 7eb9c71..4092be7 100644 --- a/discordbot/titanembeds/utils.py +++ b/discordbot/titanembeds/utils.py @@ -151,6 +151,8 @@ def get_message_mentions(mentions): def get_webhooks_list(guild_webhooks): webhooks = [] for webhook in guild_webhooks: + if not webhook.channel or not webhook.guild: + continue webhooks.append({ "id": str(webhook.id), "guild_id": str(webhook.guild.id),