From dcfbc0a3f0a4e09363ade51ba785a8efdc10d875 Mon Sep 17 00:00:00 2001 From: Phxntxm Date: Sun, 12 Mar 2017 17:05:47 -0500 Subject: [PATCH] Update some features to work with rewrite --- cogs/twitch.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cogs/twitch.py b/cogs/twitch.py index 38c28c5..c784a64 100644 --- a/cogs/twitch.py +++ b/cogs/twitch.py @@ -43,7 +43,7 @@ class Twitch: await self.bot.wait_until_ready() # Loop through as long as the bot is connected try: - while not self.bot.is_closed: + while not self.bot.is_closed(): twitch = await utils.filter_content('twitch', {'notifications_on': 1}) for data in twitch: m_id = int(data['member_id']) @@ -51,10 +51,10 @@ class Twitch: # Check if they are online online = await self.channel_online(url) # If they're currently online, but saved as not then we'll send our notification - if online and not data['live']: + if online and data['live'] == 0: for s_id in data['servers']: s_id = int(s_id) - server = self.bot.get_server(s_id) + server = self.bot.get_guild(s_id) if server is None: continue member = server.get_member(m_id) @@ -65,10 +65,10 @@ class Twitch: channel = server.get_channel(channel_id) await channel.send("{} has just gone live! View their stream at <{}>".format(member.display_name, data['twitch_url'])) self.bot.loop.create_task(utils.update_content('twitch', {'live': 1}, str(m_id))) - elif not online and data['live']: + elif not online and data['live'] == 1: for s_id in data['servers']: s_id = int(s_id) - server = self.bot.get_server(s_id) + server = self.bot.get_guild(s_id) if server is None: continue member = server.get_member(m_id)