2
2
20two.may2020-10-23 17:05:31
JavaScript
20two.may, 2020-10-23 17:05:31

How to check how many people are in a voice channel? How to check if the user's microphone is on?

In general, my bot checks all voice channels every minute, and the one who sits in the voice chat is credited with coins.
And this system turned out to be a little clumsy, because the bot does not make additional checks for the microphone being turned on and the presence of two people in the voice channel, and it follows from this that coins can simply be farmed. But I have no idea how to add these checks, I would be very grateful if someone could help with this.
*I use the function:

@client.event
async def on_voice_state_update(member, before, after):

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Daniil Igorevich, 2016-04-13
@Petr_Anisimov

Better use setInterval

D
Dmitry, 2016-04-13
@mytmid

while(1){
   Looper();
}

U
UberPool, 2020-10-23
@20two_may

I also made such a system)
Check for the number of users.

if after.channel.name != "афк комната" and len(after.channel.members) > 1:
    #добавляешь коины

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question