mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 11:48:55 -05:00
parent
aa76966f99
commit
919bb01128
11
cogs/mod.py
11
cogs/mod.py
@ -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)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user