Discord.js V13机器人发送@everyone无法触发全员提醒问题
Discord.js V13 @everyone 无法触发全员提醒的解决方法
问题根源
Discord.js V13 中,interaction.reply() 默认会过滤 @everyone 这类全局提及,即便机器人已开启对应权限,也需要显式配置允许提及规则才能触发提醒。
解决方案1:显式配置允许提及
修改代码,在 reply 方法中添加 allowedMentions 参数,明确允许提及 everyone:
const discord = require('discord.js'); module.exports = { info: { name: "announcement", description: "Announcement!", }, name: "announcement", description: "Announcement!", async execute(Discord, client, interaction){ await interaction.reply({ content: "@everyone", allowedMentions: { parse: ['everyone'] } }); } }
解决方案2:使用官方提及常量
结合 Discord.MessageMentions 提供的标准提及常量,配合权限配置实现提醒:
const discord = require('discord.js'); module.exports = { info: { name: "announcement", description: "Announcement!", }, name: "announcement", description: "Announcement!", async execute(Discord, client, interaction){ await interaction.reply({ content: Discord.MessageMentions.EVERYONE, allowedMentions: { parse: ['everyone'] } }); } }
注意事项
- 确保机器人在目标频道已启用「提及@everyone」权限(你已确认开启此权限,可忽略此检查)
- 若后续发送嵌入消息(Embed),可在
allowedMentions中添加repliedUser: false,避免额外提及交互发起者
内容的提问来源于stack exchange,提问作者user19735869
相关产品推荐
相关产品推荐

