fix: cocoreact no longer tries to check guild configs while in dms
This commit is contained in:
parent
b41fb3c085
commit
7f210d016d
1 changed files with 8 additions and 7 deletions
|
@ -67,13 +67,14 @@ class Galaxy(commands.Cog):
|
||||||
|
|
||||||
@commands.Cog.listener('on_message')
|
@commands.Cog.listener('on_message')
|
||||||
async def cocoreact(self, message):
|
async def cocoreact(self, message):
|
||||||
emoji = self.bot.get_emoji(await self.config.guild(message.guild).cocoemoji())
|
if message.guild is not None:
|
||||||
cocotarget = await self.config.guild(message.guild).cocotarget()
|
emoji = self.bot.get_emoji(await self.config.guild(message.guild).cocoemoji())
|
||||||
if cocotarget == 0:
|
cocotarget = await self.config.guild(message.guild).cocotarget()
|
||||||
return
|
if cocotarget == 0:
|
||||||
if not message.author.id == cocotarget:
|
return
|
||||||
return
|
if not message.author.id == cocotarget:
|
||||||
await message.add_reaction(emoji)
|
return
|
||||||
|
await message.add_reaction(emoji)
|
||||||
|
|
||||||
@commands.group(autohelp=False, invoke_without_command=True)
|
@commands.group(autohelp=False, invoke_without_command=True)
|
||||||
@commands.guild_only()
|
@commands.guild_only()
|
||||||
|
|
Loading…
Reference in a new issue