How can I get the ID of the users on the voice channel?
More specific Can I check the number of people and their id's on the voice channel that also has the bot?
The VoiceChannel
class has a property called members
(Type: Collection
), which contains all members in a VoiceChannel
.
As an example, you can use Collection#map
to map each member by ID.
<VoiceChannel>.members.map(member => member.id);
// --> ["1234567890123456", "1234567890123456", "1234567890123456"] etc (Array)
Since VoiceChannel#members
is a Collection
, you can use size
to get how many items are in the aforementioned Collection
.
<VoiceChannel>.members.size;
// --> 25 (Integer)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.