1
0
Fork 0
mirror of synced 2024-06-02 02:34:32 +12:00

Added a check to make sure the server is found, as now that the bot is sharded we may not detect the correct server

This commit is contained in:
Phxntxm 2016-09-03 17:18:24 -05:00
parent 6de4800e54
commit 8bd014a345
2 changed files with 8 additions and 0 deletions

View file

@ -63,6 +63,8 @@ class Picarto:
for server_id in r['servers']:
# Get the channel to send the message to, based on the saved alert's channel
server = self.bot.get_server(server_id)
if server is None:
continue
server_alerts = await config.get_content('server_alerts')
channel_id = server_alerts.get(server_id) or server_id
channel = self.bot.get_channel(channel_id)
@ -82,6 +84,8 @@ class Picarto:
for server_id in r['servers']:
# Get the channel to send the message to, based on the saved alert's channel
server = self.bot.get_server(server_id)
if server is None:
continue
server_alerts = await config.get_content('server_alerts')
channel_id = server_alerts.get(server_id) or server_id
channel = self.bot.get_channel(channel_id)

View file

@ -53,6 +53,8 @@ class Twitch:
for server_id in r['servers']:
# Get the channel to send the message to, based on the saved alert's channel
server = self.bot.get_server(server_id)
if server is None:
continue
server_alerts = await config.get_content('server_alerts')
channel_id = server_alerts.get(server_id) or server_id
channel = self.bot.get_channel(channel_id)
@ -72,6 +74,8 @@ class Twitch:
for server_id in r['servers']:
# Get the channel to send the message to, based on the saved alert's channel
server = self.bot.get_server(server_id)
if server is None:
continue
server_alerts = await config.get_content('server_alerts')
channel_id = server_alerts.get(server_id) or server_id
channel = self.bot.get_channel(channel_id)