如何检查语音频道中有多少成员?
有没有办法检查语音频道中有多少成员或在Discord.js中为空的成员(V. 13.8.1)?
我已经尝试过
async function usercount(voiceState){
let users = await(voiceState.channel.fetch.memberCount);
console.log(users)
}
Is there a way to check how many members are in a voice channel or if it's empty in discord.js (V. 13.8.1)?
I have already tried this
async function usercount(voiceState){
let users = await(voiceState.channel.fetch.memberCount);
console.log(users)
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是基于语音的频道中成员的集合。集合具有
size
属性,因此类似的东西应该有效:VoiceChannel#members
is a collection of the members in a voice-based channel. Collection's have asize
property, so something like this should work:可以使用
voicechannel.members.size
来获取频道中有多少成员。这是一个例子:
Can use the
VoiceChannel.members.size
to get how many members are in the channel.Here's an example: