Answer the question
In order to leave comments, you need to log in
Python | How to get the total number of users in the voice channels of my Discord server?
I need to get the number of users in the voice channels of my Discord server, but I can’t even imagine how to implement this.
From what is available:
@bot.event
async def on_voice_state_update(member, before, after):
voice = member.guild.voice_channels
voiceonline = member.guild.voice_channels.members
Answer the question
In order to leave comments, you need to log in
As always, just read the documentation carefully.
Guild.voice_channels : List[VoiceChannel
] this is a list, and you pull some extraneous properties from it.
A separate VoiceChannel indeed has a members property : List[Member].
sum(len(vc.members) for vc in member.guild.voice_channels)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question