From 7f210d016d26eb46dc48b609b7e083af7db0a30d Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Mon, 7 Aug 2023 20:41:23 -0400 Subject: [PATCH] fix: cocoreact no longer tries to check guild configs while in dms --- galaxy/galaxy.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/galaxy/galaxy.py b/galaxy/galaxy.py index fac9c88..fae1276 100644 --- a/galaxy/galaxy.py +++ b/galaxy/galaxy.py @@ -67,13 +67,14 @@ class Galaxy(commands.Cog): @commands.Cog.listener('on_message') async def cocoreact(self, message): - emoji = self.bot.get_emoji(await self.config.guild(message.guild).cocoemoji()) - cocotarget = await self.config.guild(message.guild).cocotarget() - if cocotarget == 0: - return - if not message.author.id == cocotarget: - return - await message.add_reaction(emoji) + if message.guild is not None: + emoji = self.bot.get_emoji(await self.config.guild(message.guild).cocoemoji()) + cocotarget = await self.config.guild(message.guild).cocotarget() + if cocotarget == 0: + return + if not message.author.id == cocotarget: + return + await message.add_reaction(emoji) @commands.group(autohelp=False, invoke_without_command=True) @commands.guild_only()