1
0
Fork 0
mirror of synced 2024-09-28 07:21:16 +12:00

Added an exception in case we could not connect to twitch at the time

This commit is contained in:
Phxntxm 2016-07-31 06:36:00 -05:00
parent e1b68f52e8
commit ff5cb2fd52

View file

@ -14,7 +14,10 @@ async def channel_online(channel: str):
async with s.get(url) as r:
response = await r.text()
data = json.loads(response)
return data['stream'] is not None
try:
return data['stream'] is not None
except KeyError:
return False
class Twitch: