到目前为止,我已经有了这段代码,但它仅用于两个反应,我想知道是否有人可以帮助我做两个以上的反应?自定义表情符号最可取的是,我将非常感谢您的帮助。
const customEmoji = client.emojis.cache.get('707879839943753758');
message.react(customEmoji).then(() => message.react('?'));
const filter = (reaction, user) => {
return user.id === message.author.id;
};
message.awaitReactions(filter, {
max: 1,
time: 60000,
errors: ['time']
})
.then(collected => {
const reaction = collected.first();
if (reaction.emoji.id === customEmoji.id) {
message.reply('report something');
}
if (reaction.emoji.name === '?') {
message.reply('did not report anything');
}
})
.catch(collected => {
message.reply('you reacted with neither a thumbs up, nor a thumbs down.');
});
答案 0 :(得分:0)
您可以在message.react()
中使用:nameofemoji:idofemoji如果\:youremoji:
,您可以获得id表情符号类型custom emoji
const emo0 = (':nameofemoji:idofemoji')
const emo1 = (':nameofemoji:idofemoji')
message.react(`${emo0}`)
.then(() => message.react('?'))
.then(() => message.react(`${emo1}`))
.catch(() => console.error('One of the emojis failed to react.'));