From 241889b38244f167ee0bead2e85e098fedf0b349 Mon Sep 17 00:00:00 2001 From: Phxntxm Date: Sat, 21 Jan 2017 17:22:52 -0600 Subject: [PATCH] Corrected a couple errors with twitch/picarto/da --- cogs/da.py | 2 +- cogs/picarto.py | 2 ++ cogs/twitch.py | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cogs/da.py b/cogs/da.py index 866792a..653d1d3 100644 --- a/cogs/da.py +++ b/cogs/da.py @@ -76,7 +76,7 @@ class Deviantart: result = cache.get(da_name, None) if result is None: params['username'] = da_name - data = await utils.request(base_url, payload=params) + data = await utils.request(self.base_url, payload=params) log.warning("DA responded with {}".format(data)) result = data['results'][0] diff --git a/cogs/picarto.py b/cogs/picarto.py index 39fbb00..7f76348 100644 --- a/cogs/picarto.py +++ b/cogs/picarto.py @@ -77,6 +77,8 @@ class Picarto: channel = self.bot.get_channel(channel_id) # Get the member that has just gone live member = discord.utils.get(server.members, id=m_id) + if member is None: + continue fmt = "{} has just gone live! View their stream at {}".format(member.display_name, url) await self.bot.send_message(channel, fmt) diff --git a/cogs/twitch.py b/cogs/twitch.py index 5e1adc3..80d37c8 100644 --- a/cogs/twitch.py +++ b/cogs/twitch.py @@ -70,6 +70,8 @@ class Twitch: channel = self.bot.get_channel(channel_id) # Get the member that has just gone live member = discord.utils.get(server.members, id=m_id) + if member is None: + continue fmt = "{} has just gone live! View their stream at {}".format(member.display_name, url) await self.bot.send_message(channel, fmt)