python - 用 Python 编写 Discord 机器人 - 如何让机器人 ping @everyone?
问题描述
出于某种原因,我无法让我的机器人 ping 所有人。我试过这个-
@client.command()
async def test(ctx):
await ctx.send("@everyone")
那是行不通的。我也试过<@&role_id>
,这是我用来 ping 某些角色的。但这也不起作用。我是编程新手,所以任何见解都将不胜感激。
解决方案
尝试使用默认角色:
@bot.command()
async def test(ctx):
await ctx.send(ctx.message.guild.default_role)
推荐阅读
- asp.net-mvc - 如何在 Kendo UI asp.net mvc Pivot 网格中隐藏总和列和行
- r - geom_boxplot,如何根据组专门为异常值着色并保持所有内容为黑色?
- c++ - 使用 tbb 运行时,Opencv 未定义对符号“_ZN3tbb18task_group_contextD1Ev”的引用
- scala - 不支持的文字类型类 scala.collection.immutable.HashSet$HashTrieSet
- android - Android约束布局,重量视图?
- php - 模拟我的班级私人服务财产
- java - 使用带有 Spring 缓存抽象的大数据(千兆字节)的磁盘缓存
- clickhouse - 在 ClickHouse 中过滤计数
- sql-server - '>' 附近的语法不正确
- python - 如何在python上发布表单请求