From 6392e4d9bfade0345b8c2b70433f0aa0f1e37789 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Sun, 30 Dec 2018 21:00:41 +0000 Subject: [PATCH] Actually bail if length of emojis is 0 --- discordbot/titanembeds/bot.py | 2 +- discordbot/titanembeds/socketio/socketiointerface.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/discordbot/titanembeds/bot.py b/discordbot/titanembeds/bot.py index 0fa4a55..5ddb28a 100644 --- a/discordbot/titanembeds/bot.py +++ b/discordbot/titanembeds/bot.py @@ -181,7 +181,7 @@ class Titan(discord.AutoShardedClient): await self.redisqueue.update_guild(guild) if len(after) == 0: await self.socketio.on_guild_emojis_update(before) - elif len(before) == 0: + else: await self.socketio.on_guild_emojis_update(after) async def on_webhooks_update(self, channel): diff --git a/discordbot/titanembeds/socketio/socketiointerface.py b/discordbot/titanembeds/socketio/socketiointerface.py index 1268438..3acc93f 100644 --- a/discordbot/titanembeds/socketio/socketiointerface.py +++ b/discordbot/titanembeds/socketio/socketiointerface.py @@ -50,6 +50,8 @@ class SocketIOInterface: await self.io.emit('GUILD_MEMBER_UPDATE', data=user, room=str("GUILD_"+str(member.guild.id)), namespace='/gateway') async def on_guild_emojis_update(self, emojis): + if len(emojis) == 0: + return emotes = get_formatted_emojis(emojis) await self.io.emit('GUILD_EMOJIS_UPDATE', data=emotes, room=str("GUILD_"+str(emojis[0].guild.id)), namespace='/gateway')