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

Handle no server settings

This commit is contained in:
phxntxm 2017-03-22 22:21:59 -05:00
parent 788743de25
commit 13f2b89e81

View file

@ -77,8 +77,11 @@ class Raffle:
self.bot.loop.create_task(utils.remove_content('raffles', raffle_id))
server_settings = await utils.get_content('server_settings', str(server.id))
channel_id = server_settings.get('notification_channel', server.id)
channel = self.bot.get_channel(channel_id)
if server_settings is None:
channel = self.bot.get_channel(server.id)
else:
channel_id = server_settings.get('notification_channel', server.id)
channel = self.bot.get_channel(channel_id)
try:
await channel.send(fmt)
except discord.Forbidden: