From 09e6f17a1162a304fb5097c8c6470aeb6cc91fdf Mon Sep 17 00:00:00 2001 From: phxntxm Date: Thu, 21 Sep 2017 17:36:09 -0500 Subject: [PATCH] Add what to do for channels that no longer exist --- cogs/raffle.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cogs/raffle.py b/cogs/raffle.py index 1602936..b68ebee 100644 --- a/cogs/raffle.py +++ b/cogs/raffle.py @@ -78,7 +78,10 @@ class Raffle: default_channel_id = notifications.get('default') # If it is has been overriden by picarto notifications setting, use this channel_id = notifications.get('raffle') or default_channel_id - channel = self.bot.get_channel(int(channel_id)) + if channel_id: + channel = self.bot.get_channel(int(channel_id)) + else: + continue try: await channel.send(fmt) except (discord.Forbidden, AttributeError):