1
0
Fork 0
mirror of synced 2024-06-22 16:20:23 +12:00

Corrected issue where having no server alerts set broke the loop

This commit is contained in:
Phxntxm 2017-02-17 18:07:50 -06:00
parent 2d3e5d680c
commit 2e4f006f5f
2 changed files with 2 additions and 2 deletions

View file

@ -97,7 +97,7 @@ class Picarto:
server_alerts = await utils.get_content('server_alerts', {'server_id': server_id})
try:
channel_id = server_alerts[0]['channel_id']
except IndexError:
except (IndexError, TypeError):
channel_id = server_id
channel = self.bot.get_channel(channel_id)
# Get the member that has just gone live

View file

@ -89,7 +89,7 @@ class Twitch:
continue
server_alerts = await utils.get_content('server_alerts', {'server_id': server_id})
channel_id = server_id
if len(server_alerts) > 0:
if server_alerts is not None and len(server_alerts) > 0:
channel_id = server_alerts[0].get('channel_id')
channel = self.bot.get_channel(channel_id)
# Get the member that has just gone live