在执行命令并移至node.js中的其他语音通道后,我如何检查此人的语音通道ID?
我需要在执行命令后检查人员所在的语音通道ID。如果它在此频道上,我希望该机器人移至另一个所需的频道。
var idchannel = member.get.voiceChannelID;
if(idchannel === "ID"){
//command
// and i need to move this user to another channel.
}
else {
message.reply("You are not on the correct Channel.");
}
回答如下:您可以使用GuildMember.voiceChannel
引用用户连接到的语音通道。然后对照期望的ID检查通道的GuildMember.voiceChannel
属性。
要将成员从一个语音通道移动到另一个语音通道,可以使用id
方法。
id
请确保从您的承诺中捕获任何错误。参见GuildMember.setVoiceChannel()
。
在执行命令并移至node.js中的其他语音通道后,我如何检查此人的语音通道ID?
我需要在执行命令后检查人员所在的语音通道ID。如果它在此频道上,我希望该机器人移至另一个所需的频道。
var idchannel = member.get.voiceChannelID;
if(idchannel === "ID"){
//command
// and i need to move this user to another channel.
}
else {
message.reply("You are not on the correct Channel.");
}
回答如下:您可以使用GuildMember.voiceChannel
引用用户连接到的语音通道。然后对照期望的ID检查通道的GuildMember.voiceChannel
属性。
要将成员从一个语音通道移动到另一个语音通道,可以使用id
方法。
id
请确保从您的承诺中捕获任何错误。参见GuildMember.setVoiceChannel()
。