首页 > 解决方案 > 用 Python 编写 Discord 机器人 - 如何让机器人 ping @everyone?

问题描述

出于某种原因,我无法让我的机器人 ping 所有人。我试过这个-

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

那是行不通的。我也试过<@&role_id>,这是我用来 ping 某些角色的。但这也不起作用。我是编程新手,所以任何见解都将不胜感激。

标签: pythondiscord.py

解决方案


尝试使用默认角色:

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

推荐阅读