From f48a4b827f010651141d884531fd9fe1d173b8d7 Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Mon, 19 Jul 2021 13:23:44 -0600 Subject: [PATCH] Close #48, also allow people with role to ping others with role --- jarvis/__init__.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/jarvis/__init__.py b/jarvis/__init__.py index 567b959..0a401cb 100644 --- a/jarvis/__init__.py +++ b/jarvis/__init__.py @@ -103,9 +103,10 @@ async def on_message(message: Message): ) if ( massmention["value"] > 0 - and len(message.mentions) > massmention["value"] + and len(message.mentions) + - (1 if message.author in message.mentions else 0) + > massmention["value"] ): - await message.delete() db.jarvis.warns.insert_one( { "user": message.author.id, @@ -143,7 +144,13 @@ async def on_message(message: Message): for mention in message.mentions: for role in mention.roles: roles.append(role.id) - if roleping and any(x.id in roleping["value"] for x in roles): + if ( + roleping + and any(x in roleping["value"] for x in roles) + and not any( + x.id in roleping["value"] for x in message.author.roles + ) + ): db.jarvis.warns.insert_one( { "user": message.author.id,