You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.23 00:06:22