1
0
Fork 0
mirror of synced 2024-05-24 06:19:39 +12:00

Work with nonexistant channels

This commit is contained in:
phxntxm 2017-09-25 15:16:41 -05:00
parent 2b4e098d67
commit 549f72d660

View file

@ -75,7 +75,10 @@ class StatsUpdate:
except (IndexError, TypeError, KeyError):
return
channel = guild.get_channel(int(channel_id))
if channel_id:
channel = guild.get_channel(int(channel_id))
else:
return
try:
await channel.send(join_message.format(server=guild.name, member=member.mention))
except (discord.Forbidden, discord.HTTPException, AttributeError):
@ -103,7 +106,10 @@ class StatsUpdate:
except (IndexError, TypeError, KeyError):
return
channel = guild.get_channel(int(channel_id))
if channel_id:
channel = guild.get_channel(int(channel_id))
else:
return
try:
await channel.send(leave_message.format(server=guild.name, member=member.name))
except (discord.Forbidden, discord.HTTPException, AttributeError):