[NoFlippedTables] Guild check first

This commit is contained in:
aikaterna
2020-09-09 12:59:39 -07:00
committed by GitHub
parent 2a27d9012e
commit d9587b9c75

View File

@@ -83,10 +83,10 @@ class NoFlippedTables(commands.Cog):
async def on_message(self, message): async def on_message(self, message):
channel = message.channel channel = message.channel
user = message.author user = message.author
if not channel.permissions_for(message.guild.me).send_messages:
return
if not message.guild: if not message.guild:
return return
if not channel.permissions_for(message.guild.me).send_messages:
return
if hasattr(user, "bot") and user.bot is True: if hasattr(user, "bot") and user.bot is True:
return return
toggle = await self.config.guild(message.guild).TOGGLE() toggle = await self.config.guild(message.guild).TOGGLE()