F
F
Fixxers2020-06-01 17:09:47
Python
Fixxers, 2020-06-01 17:09:47

How to track the connection to the voice channel?

You need to track the user's connection to the channel. For example: A person joined the channel, and I received a message about it. In the documentation, I did not find an Event that would track this. But I still want to know if this is real.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-06-01
@Fixxers

on_voice_state_update

class MyClient(discord.Client):
    ...
    async def on_voice_state_update(self, member, before, after):
        if after.channel and after.channel!=before.channel:
            print(f"Пользователь {member.name} зашол на {after.channel.name}")
        if before.channel and after.channel!=before.channel:
            print(f"Пользователь {member.name} вышел с {before.channel.name}")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question