1
0
Fork 0
mirror of synced 2024-05-20 20:42:27 +12:00

Catch twitch returning no information

This commit is contained in:
Phxntxm 2017-04-08 21:51:22 -05:00
parent a45f37324e
commit c4b29224a6

View file

@ -117,6 +117,9 @@ class Twitch:
twitch_url = "https://api.twitch.tv/kraken/channels/{}".format(user)
payload = {'client_id': self.key}
data = await utils.request(twitch_url, payload=payload)
if data is None:
await ctx.send("Sorry but I couldn't connect to twitch right now!")
return
embed = discord.Embed(title=data['display_name'], url=url)
if data['logo']: