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

Discord.js中messageReactionAdd事件无法触发该如何解决?

Discord messageReactionAdd 事件触发异常问题

我遇到了messageReactionAdd事件的相关问题,该事件仅在Discord内发送新消息后才会生效,我尝试在事件回调开头添加console.log打印日志,也完全没有触发。

我的代码如下:

module.exports = async (client, reaction, user) => {    
    if(reaction.message.partial) await reaction.message.fetch();    
    if(reaction.partial) await reaction.fetch();    
    if(user.bot) return;    
    if(reaction.message.channel.id === '837981337658589204') {        
        reaction.users.remove(user);        
        if(reaction.emoji.name === '🐬') {            
            // 业务逻辑代码
        }    
    }
}

partials配置如下:

const client = new discord.Client({ partials: ['MESSAGE', 'REACTION']});

我已经尝试过本站能找到的所有解决方法,但问题仍然没有解决。

最终解决方案

该问题的最终解决方法是在机器人管理页面开启Privileged Gateway Intents即可。

内容的提问来源于stack exchange,提问作者vvv

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.10.18 14:09:04