Close #48, also allow people with role to ping others with role
This commit is contained in:
parent
85643788e3
commit
f48a4b827f
1 changed files with 10 additions and 3 deletions
|
@ -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,
|
||||||
|
|
Loading…
Add table
Reference in a new issue