[Core, Alias, Customcom] Moved bot checks to user_allowed (#454)

More selfbot friendliness for modded Reds
This commit is contained in:
Caleb Johnson 2016-11-13 20:36:38 -06:00 committed by Twentysix
parent 36216a4058
commit 70afff5b5f
3 changed files with 5 additions and 7 deletions

View File

@ -108,8 +108,7 @@ class Alias:
await self.bot.say("There are no aliases on this server.") await self.bot.say("There are no aliases on this server.")
async def check_aliases(self, message): async def check_aliases(self, message):
if message.author == self.bot.user or \ if len(message.content) < 2 or message.channel.is_private:
len(message.content) < 2 or message.channel.is_private:
return return
msg = message.content msg = message.content

View File

@ -106,8 +106,7 @@ class CustomCommands:
await self.bot.say("There are no custom commands in this server. Use addcom [command] [text]") await self.bot.say("There are no custom commands in this server. Use addcom [command] [text]")
async def checkCC(self, message): async def checkCC(self, message):
if message.author == self.bot.user or\ if len(message.content) < 2 or message.channel.is_private:
len(message.content) < 2 or message.channel.is_private:
return return
msg = message.content msg = message.content

6
red.py
View File

@ -141,11 +141,11 @@ def user_allowed(message):
author = message.author author = message.author
mod = bot.get_cog('Mod') if author.bot or author == bot.user:
if author.bot:
return False return False
mod = bot.get_cog('Mod')
if mod is not None: if mod is not None:
if settings.owner == author.id: if settings.owner == author.id:
return True return True