ÎÊÌâÃèÊö
ÎÒÕýÔÚ³¢ÊÔʹÓà node.js ±àдһ¸ö²»ºÍгµÄ»úÆ÷ÈË£¬µ«ÎÒÓöµ½ÁË messageReactionAdd µÄÎÊÌâÎÒÏÖÔÚ²»Ã÷°×Ϊʲôµ±ÎÒ¶Ô±íÇé·ûºÅ×ö³ö·´Ó¦Ê±»úÆ÷ÈËʲô¶¼²»×ö.
I'am trying to code a discord bot with node.js, but i have a problem with messageReactionAdd I don't now why the bot does nothing when i react with an emoji.
ÎҵĴúÂë:
bot.on('messageReactionRemove', (reaction, user) => {
console.log("that work 1");
if(reaction.emoji.name === "white_check_mark") {
console.log("that work 2");
}})
ÍƼö´ð°¸
ʼþ messageReactionAdd
ºÍ messageReactionRemove
½öÊÊÓÃÓÚ»º´æÏûÏ¢.ÄúÐèÒªÔÚ´úÂëÖÐÌí¼ÓÔʼʼþÒÔ´¥·¢ÈκÎÏûÏ¢.https://github.com/AnIdiotsGuide/discordjs-bot-guide/blob/master/coding-guides/raw-events.md
Events messageReactionAdd
and messageReactionRemove
working only for cached messages. You need add raw event to your code for trigger any message.
https://github.com/AnIdiotsGuide/discordjs-bot-guide/blob/master/coding-guides/raw-events.md
Õâƪ¹ØÓÚΪʲô messageReactionAdd ʲô¶¼²»×ö discord.jsµÄÎÄÕ¾ͽéÉܵ½ÕâÁË£¬Ï£ÍûÎÒÃÇÍƼöµÄ´ð°¸¶Ô´ó¼ÒÓÐËù°ïÖú£¬Ò²Ï£Íû´ó¼Ò¶à¶àÖ§³Ö¸ú°æÍø£¡