情绪和不和谐反应

Emotions and discord reactions

我想要它,当我添加表情符号作为反应时,它会向添加的人发送私人消息。 例子: https://youtu.be/tcBhXB4Kmqk

您可以使用 client.on('messageReactionAdd', listener) 来听取反应。
listener 函数中,您可以检查消息 ID,然后发送消息。
这是一个示例:

// let's say that the message ID is stored in my_id
client.on('messageReactionAdd', (reaction, user) => {
  // this is to avoid the bot sending messages to everyone that reacts anywhere
  if (reaction.message.id == my_id) user.send('Your message.');
});

您还可以根据添加的反应发送不同的消息:您可以使用 ReactionEmoji.name 来检查。
要获取内置表情符号的 Unicode 值,请输入带有反斜杠的表情符号(例如:\:joy: 将导致 </code>)。</p> <pre><code>if (reaction.message.id == my_id) { if (reaction.name == '') user.send('Ayy lmao!11!!'); else user.send('This is another emoji.'); }