Added an exception in case we could not connect to twitch at the time
This commit is contained in:
parent
e1b68f52e8
commit
ff5cb2fd52
1 changed files with 4 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue