mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 03:38:53 -05:00
Merge remote-tracking branch 'upstream/develop' into develop
This commit is contained in:
commit
a886547f1b
@ -18,7 +18,6 @@ class Streams:
|
|||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.twitch_streams = fileIO("data/streams/twitch.json", "load")
|
self.twitch_streams = fileIO("data/streams/twitch.json", "load")
|
||||||
self.hitbox_streams = fileIO("data/streams/hitbox.json", "load")
|
self.hitbox_streams = fileIO("data/streams/hitbox.json", "load")
|
||||||
self.pattern = {"CHANNELS" : [], "NAME" : "", "ALREADY_ONLINE" : False}
|
|
||||||
|
|
||||||
@commands.command()
|
@commands.command()
|
||||||
async def hitbox(self, stream : str):
|
async def hitbox(self, stream : str):
|
||||||
@ -191,7 +190,7 @@ class Streams:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
async def stream_checker(self):
|
async def stream_checker(self):
|
||||||
CHECK_DELAY = 10
|
CHECK_DELAY = 60
|
||||||
while "Streams" in self.bot.cogs:
|
while "Streams" in self.bot.cogs:
|
||||||
|
|
||||||
old = (deepcopy(self.twitch_streams), deepcopy(self.hitbox_streams))
|
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"]))
|
await self.bot.send_message(self.bot.get_channel(channel), "http://www.twitch.tv/{} is online!".format(stream["NAME"]))
|
||||||
else:
|
else:
|
||||||
if stream["ALREADY_ONLINE"] and not online: stream["ALREADY_ONLINE"] = False
|
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:
|
for stream in self.hitbox_streams:
|
||||||
online = await self.hitbox_online(stream["NAME"])
|
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"]))
|
await self.bot.send_message(self.bot.get_channel(channel), "http://www.hitbox.tv/{} is online!".format(stream["NAME"]))
|
||||||
else:
|
else:
|
||||||
if stream["ALREADY_ONLINE"] and not online: stream["ALREADY_ONLINE"] = False
|
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):
|
if old != (self.twitch_streams, self.hitbox_streams):
|
||||||
fileIO("data/streams/twitch.json", "save", self.twitch_streams)
|
fileIO("data/streams/twitch.json", "save", self.twitch_streams)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user