【发布时间】:2021-08-13 11:06:22
【问题描述】:
我需要帮助我目前的方法没有得到正确的反应表情符号。但我希望它获得正确的表情符号。有人可以帮我吗?
bot.on('messageReactionAdd', async (reaction, user) => {
const message = reaction.message
if (reaction.partial) {
try {
await reaction.fetch();
} catch (error) {
console.error('Something went wrong when fetching the message: ', error);
return;
}
if(user.bot) return;
if(reaction.emoji == "????"){
reaction.message.channel.send("Right emoji")
reaction.message.reactions.cache.get("????").remove(user);
reaction.message.react("????")
let category = message.guild.channels.cache.find(cat=> cat.name === "my category")
if(category == null){
message.guild.channels.create('my category', { type: 'category' })
.catch(console.error);
category = message.guild.channels.cache.find(cat=> cat.name === "my category")
}
setTimeout(createShopTicketChannel, 2000, message, category, user, "????")
}else if(reaction.emoji == "????"){
reaction.message.channel.send("Wrong emoji")
reaction.message.reactions.cache.get("????").remove(user);
reaction.message.react("????")
let category = message.guild.channels.cache.find(cat=> cat.name === "my category")
if(category == null){
message.guild.channels.create('my category', { type: 'category' })
.catch(console.error);
category = message.guild.channels.cache.find(cat=> cat.name === "my category")
}
setTimeout(createShopTicketChannel, 2000, message, category, user, "????")
}else{
message.channel.send("Wrong emoooji")
}
}
输出是:错误的表情符号,即使我对正确的表情做出反应。
【问题讨论】:
标签: node.js discord discord.js