From 58e0b6d46a99143e3dc3218d913fd578fbae06d7 Mon Sep 17 00:00:00 2001 From: Twentysix Date: Mon, 29 Feb 2016 13:59:09 +0100 Subject: [PATCH] Undoing changes to stream module --- cogs/streams.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/cogs/streams.py b/cogs/streams.py index 787462850..5c415374b 100644 --- a/cogs/streams.py +++ b/cogs/streams.py @@ -191,9 +191,7 @@ class Streams: async def stream_checker(self): CHECK_DELAY = 60 - old_alerts = [] - last_twitch_alert = None - last_hitbox_alert = None + while "Streams" in self.bot.cogs: old = (deepcopy(self.twitch_streams), deepcopy(self.hitbox_streams)) @@ -204,9 +202,7 @@ class Streams: stream["ALREADY_ONLINE"] = True for channel in stream["CHANNELS"]: if self.bot.get_channel(channel): - if last_twitch_alert: - old_alerts.append(last_twitch_alert) - last_twitch_alert = await self.bot.send_message(self.bot.get_channel(channel), "http://www.twitch.tv/{} is online!".format(stream["NAME"])) + await self.bot.send_message(self.bot.get_channel(channel), "http://www.twitch.tv/{} is online!".format(stream["NAME"])) else: if stream["ALREADY_ONLINE"] and not online: stream["ALREADY_ONLINE"] = False await asyncio.sleep(0.5) @@ -217,9 +213,7 @@ class Streams: stream["ALREADY_ONLINE"] = True for channel in stream["CHANNELS"]: if self.bot.get_channel(channel): - if last_hitbox_alert: - old_alerts.append(last_hitbox_alert) - last_hitbox_alert = await self.bot.send_message(self.bot.get_channel(channel), "http://www.hitbox.tv/{} is online!".format(stream["NAME"])) + await self.bot.send_message(self.bot.get_channel(channel), "http://www.hitbox.tv/{} is online!".format(stream["NAME"])) else: if stream["ALREADY_ONLINE"] and not online: stream["ALREADY_ONLINE"] = False await asyncio.sleep(0.5) @@ -227,11 +221,7 @@ class Streams: if old != (self.twitch_streams, self.hitbox_streams): fileIO("data/streams/twitch.json", "save", self.twitch_streams) fileIO("data/streams/hitbox.json", "save", self.hitbox_streams) - - for msg in old_alerts: - await self.bot.delete_message(msg) - old_alerts = [] - + await asyncio.sleep(CHECK_DELAY) def check_folders():