Close #48, also allow people with role to ping others with role

This commit is contained in:
Zeva Rose 2021-07-19 13:23:44 -06:00
parent 85643788e3
commit f48a4b827f

View file

@ -103,9 +103,10 @@ async def on_message(message: Message):
) )
if ( if (
massmention["value"] > 0 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( db.jarvis.warns.insert_one(
{ {
"user": message.author.id, "user": message.author.id,
@ -143,7 +144,13 @@ async def on_message(message: Message):
for mention in message.mentions: for mention in message.mentions:
for role in mention.roles: for role in mention.roles:
roles.append(role.id) 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( db.jarvis.warns.insert_one(
{ {
"user": message.author.id, "user": message.author.id,