From e8b725484aa02fd56df6565b90c0eb38840101f2 Mon Sep 17 00:00:00 2001 From: Phxntxm Date: Mon, 27 Mar 2017 21:27:17 -0500 Subject: [PATCH] Add a check to ensure that we have online channels --- cogs/picarto.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cogs/picarto.py b/cogs/picarto.py index 0417bf2..5fd72a2 100644 --- a/cogs/picarto.py +++ b/cogs/picarto.py @@ -35,6 +35,8 @@ class Picarto: # Channel is the name we are checking against that # This creates a list of all users that match this channel name (should only ever be 1) # And returns True as long as it is more than 0 + if not self.channels: + return False channel = re.search("(?<=picarto.tv/)(.*)", channel).group(1) matches = [stream for stream in self.online_channels if stream['channel_name'].lower() == channel.lower()] return len(matches) > 0