Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/433.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何制作反应日志?_Javascript_Node.js_Discord.js - Fatal编程技术网

Javascript 如何制作反应日志?

Javascript 如何制作反应日志?,javascript,node.js,discord.js,Javascript,Node.js,Discord.js,我不想为我的服务器做一个反应日志,但我一直得到未定义的 代码如下: client.on("messageReactionAdd", async function (messageReaction, user, message) { const channel = messageReaction.channel let reaction = await client.channels.fetch('CHANNEL ID'); reaction.send(`A rea

我不想为我的服务器做一个反应日志,但我一直得到未定义的

代码如下:

client.on("messageReactionAdd", async function (messageReaction, user, message) {
  const channel = messageReaction.channel
  let reaction = await client.channels.fetch('CHANNEL ID');
  reaction.send(`A reaction has been added to a message by ${user} \nin ${channel}`);
});

您需要从
messageReaction.message

client.on("messageReactionAdd", async function (messageReaction, user, message) {
  const channel = messageReaction.message.channel
  let reaction = await client.channels.fetch('CHANNEL ID');
  reaction.send(`A reaction has been added to a message by ${user} \nin ${channel}`);
});

关于哪个变量返回未定义?通道未定义的文档