From 8a6ec4e6819b096dd1b713f3a8c1139acfcd9c81 Mon Sep 17 00:00:00 2001 From: phxntxm Date: Wed, 13 Sep 2017 03:47:29 -0500 Subject: [PATCH] Handle default channel no longer existing --- cogs/picarto.py | 5 ++++- cogs/twitch.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cogs/picarto.py b/cogs/picarto.py index cfebbff..c5023ac 100644 --- a/cogs/picarto.py +++ b/cogs/picarto.py @@ -111,7 +111,10 @@ class Picarto: # If it is has been overriden by picarto notifications setting, use this channel_id = notifications.get('picarto') or default_channel_id # Now get the channel - channel = server.get_channel(int(channel_id)) + if channel_id: + channel = server.get_channel(int(channel_id)) + else: + continue # Then just send our message try: diff --git a/cogs/twitch.py b/cogs/twitch.py index 33a2d58..c4b2d60 100644 --- a/cogs/twitch.py +++ b/cogs/twitch.py @@ -123,7 +123,10 @@ class Twitch: # If it is has been overriden by twitch notifications setting, use this channel_id = notifications.get('twitch') or default_channel_id # Now get the channel - channel = server.get_channel(int(channel_id)) + if channel_id: + channel = server.get_channel(int(channel_id)) + else: + continue # Then just send our message try: