From 70afff5b5f6ae38fa795238f224683849aa60df3 Mon Sep 17 00:00:00 2001 From: Caleb Johnson Date: Sun, 13 Nov 2016 20:36:38 -0600 Subject: [PATCH] [Core, Alias, Customcom] Moved bot checks to user_allowed (#454) More selfbot friendliness for modded Reds --- cogs/alias.py | 3 +-- cogs/customcom.py | 3 +-- red.py | 6 +++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/cogs/alias.py b/cogs/alias.py index 6b628c756..f048f4f3a 100644 --- a/cogs/alias.py +++ b/cogs/alias.py @@ -108,8 +108,7 @@ class Alias: await self.bot.say("There are no aliases on this server.") async def check_aliases(self, message): - if message.author == self.bot.user or \ - len(message.content) < 2 or message.channel.is_private: + if len(message.content) < 2 or message.channel.is_private: return msg = message.content diff --git a/cogs/customcom.py b/cogs/customcom.py index 29109966f..157edb9a2 100644 --- a/cogs/customcom.py +++ b/cogs/customcom.py @@ -106,8 +106,7 @@ class CustomCommands: await self.bot.say("There are no custom commands in this server. Use addcom [command] [text]") async def checkCC(self, message): - if message.author == self.bot.user or\ - len(message.content) < 2 or message.channel.is_private: + if len(message.content) < 2 or message.channel.is_private: return msg = message.content diff --git a/red.py b/red.py index aaadae329..91632dd7f 100644 --- a/red.py +++ b/red.py @@ -141,11 +141,11 @@ def user_allowed(message): author = message.author - mod = bot.get_cog('Mod') - - if author.bot: + if author.bot or author == bot.user: return False + mod = bot.get_cog('Mod') + if mod is not None: if settings.owner == author.id: return True