[Mod] Bots are ignored by the filter

Fixes #735
This commit is contained in:
Twentysix 2017-04-29 00:24:15 +02:00
parent aa76966f99
commit 919bb01128

View File

@ -1581,11 +1581,16 @@ class Mod:
await _delete_helper(self.bot, message) await _delete_helper(self.bot, message)
async def on_message(self, message): async def on_message(self, message):
if message.channel.is_private or self.bot.user == message.author \ author = message.author
or not isinstance(message.author, discord.Member): if message.server is None or self.bot.user == author:
return return
elif self.is_mod_or_superior(message):
valid_user = isinstance(author, discord.Member) and not author.bot
# Bots and mods or superior are ignored from the filter
if not valid_user or self.is_mod_or_superior(message):
return return
deleted = await self.check_filter(message) deleted = await self.check_filter(message)
if not deleted: if not deleted:
deleted = await self.check_duplicates(message) deleted = await self.check_duplicates(message)