【发布时间】:2021-09-12 20:31:05
【问题描述】:
所以我想在机器人的消息中添加一个表情符号反应。但是不知道用什么代码来制作它。
我只知道响应命令消息的代码。
else if(command === "guessage"){
message.channel.send({ embed: {
color: 16758465,
title: "Are you...",
description: Math.floor((Math.random() * 20) + 11) + " " + "years old?"
}
})
message.react('????').then(() => message.react('????'));
const filter = (reaction, user) => {
return ['????', '????'].includes(reaction.emoji.name) && user.id === message.author.id;
};
message.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
.then(collected => {
const reaction = collected.first();
if (reaction.emoji.name === '????') {
message.reply('you reacted with a thumbs up.');
} else {
message.reply('you reacted with a thumbs down.');
}
})
.catch(collected => {
message.reply('you reacted with neither a thumbs up, nor a thumbs down.');
});
}
【问题讨论】:
标签: javascript visual-studio-code discord discord.js