【发布时间】:2022-07-06 06:53:35
【问题描述】:
如何通过频道 ID 获取语音的用户数? Discordjs v.13
async function usercount(channelId){
try {
let voiceChannel = Client.guilds.cache.get("guildId").channels.cache.get(channelId);
let membersInChannel = voiceChannel.members.size;
console.log(membersInChannel);
} catch (error) {
logger.error("Error while performing usercount")
console.log(error)
}
}
【问题讨论】:
-
有什么问题?
Client是什么? -
Client是 Discordjs 客户端。我想用语音通道的 ID 解决连接到特定语音通道的成员数量,但我没有从中获得任何价值
标签: javascript node.js discord.js