diff --git a/discordbot/titanembeds/bot.py b/discordbot/titanembeds/bot.py index 5ddb28a..1d4b0cd 100644 --- a/discordbot/titanembeds/bot.py +++ b/discordbot/titanembeds/bot.py @@ -229,7 +229,8 @@ class Titan(discord.AutoShardedClient): me = channel.guild.get_member(self.user.id) if channel.permissions_for(me).read_messages: message = await channel.get_message(message_id) - await self.on_reaction_add(message.reactions[0], None) + if len(message.reactions): + await self.on_reaction_add(message.reactions[0], None) async def on_raw_reaction_remove(self, payload): message_id = payload.message_id diff --git a/discordbot/titanembeds/redisqueue.py b/discordbot/titanembeds/redisqueue.py index 5be81af..79474e7 100644 --- a/discordbot/titanembeds/redisqueue.py +++ b/discordbot/titanembeds/redisqueue.py @@ -139,8 +139,11 @@ class RedisQueue: guild = self.bot.get_guild(int(params["guild_id"])) query = params["query"] result = None - members = guild.members - if len(query) > 5 and query[-5] == '#': + if guild: + members = guild.members + else: + members = None + if members and len(query) > 5 and query[-5] == '#': potential_discriminator = query[-4:] result = discord.utils.get(members, name=query[:-5], discriminator=potential_discriminator) if not result: