X
X
xis22482020-07-31 22:10:09
Python
xis2248, 2020-07-31 22:10:09

How to prevent a bot from pinging people with @everyone?

I need that when a person writes the say command, the bot could not ping everyone
For example:
Human: !say @everyone hello
Bot: @everyone hello(pings everyone)
How can I remove the ability to ping everyone by the bot?

@bot.command()
async def say(ctx, *arg):
    await ctx.message.delete()
    author = ctx.message.author
    msg = ctx.message.content
    print(author, msg)
    await ctx.send(' '.join(arg))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vlad, 2020-07-31
@xis2248

Add check for ping text. If it's equal to @everyone - don't execute the function. If it's not equal, do it. Or you can check if the message does not contain @everyone

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question