mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 03:38:53 -05:00
Upped the stream check delay
Temporary "fix". Will check for multiple streams in a single request in the future.
This commit is contained in:
parent
5bf4b6a888
commit
cf10822b6e
@ -18,7 +18,6 @@ class Streams:
|
||||
self.bot = bot
|
||||
self.twitch_streams = fileIO("data/streams/twitch.json", "load")
|
||||
self.hitbox_streams = fileIO("data/streams/hitbox.json", "load")
|
||||
self.pattern = {"CHANNELS" : [], "NAME" : "", "ALREADY_ONLINE" : False}
|
||||
|
||||
@commands.command()
|
||||
async def hitbox(self, stream : str):
|
||||
@ -191,7 +190,7 @@ class Streams:
|
||||
return False
|
||||
|
||||
async def stream_checker(self):
|
||||
CHECK_DELAY = 10
|
||||
CHECK_DELAY = 60
|
||||
while "Streams" in self.bot.cogs:
|
||||
|
||||
old = (deepcopy(self.twitch_streams), deepcopy(self.hitbox_streams))
|
||||
@ -205,7 +204,7 @@ class Streams:
|
||||
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(1)
|
||||
await asyncio.sleep(0.5)
|
||||
|
||||
for stream in self.hitbox_streams:
|
||||
online = await self.hitbox_online(stream["NAME"])
|
||||
@ -216,7 +215,7 @@ class Streams:
|
||||
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(1)
|
||||
await asyncio.sleep(0.5)
|
||||
|
||||
if old != (self.twitch_streams, self.hitbox_streams):
|
||||
fileIO("data/streams/twitch.json", "save", self.twitch_streams)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user