Javascript 我如何检查这样的人是否对消息有反应,并将该用户移动到discord.js中的另一个voicechannel?
我如何检查这样的人是否对某条消息有反应,并将这些人移动到discord.js中的另一个语音频道 例如:Javascript 我如何检查这样的人是否对消息有反应,并将该用户移动到discord.js中的另一个voicechannel?,javascript,node.js,discord,discord.js,Javascript,Node.js,Discord,Discord.js,我如何检查这样的人是否对某条消息有反应,并将这些人移动到discord.js中的另一个语音频道 例如: if(idpeoplereact !== "idbot"){ if(idpeoplereact.react === "✅"){ member.setVoiceChannel(`${idchannel}`); } } let channelID = "29383093093983"; // The Channel ID where the member will be mov
if(idpeoplereact !== "idbot"){
if(idpeoplereact.react === "✅"){
member.setVoiceChannel(`${idchannel}`);
}
}
let channelID = "29383093093983"; // The Channel ID where the member will be moved
client.on("messageReactionAdd", (reaction, user) => { // When a reaction is added
if(user.bot) return; // If the user who reacted is a bot, return
if(reaction.emoji.name !== "✅") return; // If the emoji is not a ✅, return
let member = reaction.message.guild.members.get(user.id); // Fetch the guild member who added the reaction
member.setVoiceChannel(reaction.message.guild.channels.get(channelID);
});
您可以使用
messageReactionAdd
事件。例如:
if(idpeoplereact !== "idbot"){
if(idpeoplereact.react === "✅"){
member.setVoiceChannel(`${idchannel}`);
}
}
let channelID = "29383093093983"; // The Channel ID where the member will be moved
client.on("messageReactionAdd", (reaction, user) => { // When a reaction is added
if(user.bot) return; // If the user who reacted is a bot, return
if(reaction.emoji.name !== "✅") return; // If the emoji is not a ✅, return
let member = reaction.message.guild.members.get(user.id); // Fetch the guild member who added the reaction
member.setVoiceChannel(reaction.message.guild.channels.get(channelID);
});
尝试使用.waitingreactions()
函数