From caa3854dc26375702b7982f337a63fa6f2d1d0b1 Mon Sep 17 00:00:00 2001 From: Phxntxm Date: Sat, 15 Jul 2017 14:13:40 -0500 Subject: [PATCH] Ensure the Picarto channel is given when checking online --- cogs/picarto.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cogs/picarto.py b/cogs/picarto.py index 30b25e6..e7c8777 100644 --- a/cogs/picarto.py +++ b/cogs/picarto.py @@ -28,6 +28,9 @@ class Picarto: self.online_channels = await utils.request(url, payload=payload) async def channel_embed(self, channel): + # First make sure the picarto URL is actually given + if not channel: + return None # Use regex to get the actual username so that we can make a request to the API stream = re.search("(?<=picarto.tv/)(.*)", channel).group(1) url = BASE_URL + '/channel/name/{}'.format(stream)