1
0
Fork 0
mirror of synced 2024-05-19 20:12:30 +12:00

Added a feature to turn off 'live' when a channel goes offline

This commit is contained in:
Phxntxm 2016-07-10 13:06:56 -05:00
parent 8e99c939dc
commit 40678f6a65

View file

@ -29,6 +29,9 @@ async def checkChannels(bot):
if not live and notify and channelOnline(user):
cursor.execute('update twitch set live=1 where user_id="{}"'.format(r['user_id']))
await bot.send_message(server,"{} has just gone live! View their stream at {}".format(member.name,url))
elif live and not channelOnline(user):
cursor.execute('update twitch set live=0 where user_id="{}"'.format(r['user_id']))
await bot.send_message(server,"{} has just gone offline! Catch them next time they stream at {}".format(member.name,url))
config.closeConnection()
await asyncio.sleep(180)