1
0
Fork 0
mirror of synced 2024-06-16 17:44:33 +12:00

Add what to do for channels that no longer exist

This commit is contained in:
phxntxm 2017-09-21 17:36:09 -05:00
parent 88b8c04117
commit 09e6f17a11

View file

@ -78,7 +78,10 @@ class Raffle:
default_channel_id = notifications.get('default') default_channel_id = notifications.get('default')
# If it is has been overriden by picarto notifications setting, use this # If it is has been overriden by picarto notifications setting, use this
channel_id = notifications.get('raffle') or default_channel_id channel_id = notifications.get('raffle') or default_channel_id
channel = self.bot.get_channel(int(channel_id)) if channel_id:
channel = self.bot.get_channel(int(channel_id))
else:
continue
try: try:
await channel.send(fmt) await channel.send(fmt)
except (discord.Forbidden, AttributeError): except (discord.Forbidden, AttributeError):