简体   繁体   中英

Programming a Discord bot in Python- How do I make the bot ping @everyone?

For some reason, I can't get my bot to ping everyone. I tried this-

@client.command()
async def test(ctx):
  await ctx.send("@everyone")

That doesn't work. I also tried <@&role_id> , which is what I use to ping certain roles. But that doesn't work either. I'm new to programming, so any insight would be greatly appreciated.

Try using the default role:

@bot.command()
async def test(ctx):
    await ctx.send(ctx.message.guild.default_role)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM