我如何检查这样的人是否对消息做出反应并将其转移到discord.js中的另一个语音通道?
例如:
if(idpeoplereact !== "idbot"){
if(idpeoplereact.react === "✅"){
member.setVoiceChannel(`${idchannel}`);
}
}
答案 0 :(得分:0)
您可以使用messageReactionAdd
事件。例如:
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);
});