How do I mention @everyone in discord.py?

Viewed 4173

How do I mention @everyone in discord.py? Yes, the bot has all the permissions required.
I tried the basic:

await ctx.send("@everyone")

And from this answer:

await ctx.send(ctx.message.guild.default_role)

Both times, the bot did indeed send a @everyone message, however, it is just a message, there is no actual ping. I checked my inbox and asked others too. See image:

Actual Ping Bot Ping

The first is an actual ping and it shows up in my inbox too, however, the second is the bot ping and it's just text.

What am I doing wrong here? and How should I ping @everyone?

2 Answers

After looking around in the docs, here is what worked for me:

allowed_mentions = discord.AllowedMentions(everyone = True)
await ctx.send(content = "@everyone", allowed_mentions = allowed_mentions)

You can also set AllowedMentions.all to allow everything.

You have to add a specific property when initializing the bot:

const bot = new Discord.Client({disableEveryone: False});
Related