debug voice activity

This commit is contained in:
Daniel afx 2022-03-28 04:39:37 +03:00
parent 5926ef055a
commit ce9d214a35

27
main.py
View file

@ -63,24 +63,25 @@ async def on_voice_state_update(member, before, after):
:param after: The member as they are after the change. :param after: The member as they are after the change.
:return: :return:
""" """
print('before: ' + str(before)) #print('before: ' + str(before))
print('after: ' + str(after)) #print('after: ' + str(after))
return #return
clients_before = len(before.channel.members)
if member.bot: if member.bot:
print("self event detection") print("self event detection")
return return
if str(before.voice_channel) == "None":
print(after.name + " joined " + str(after.voice_channel))
if str(after.channel.id) == voice_channel_id:
print("Connecting to voice channel " + voice_channel_id)
voiceChannel = await after.channel.connect()
elif str(after.voice_channel) == "None": debug_channel = bot.get_channel(text_channel_id)
print(after.name + " left " + str(before.voice_channel)) voice_channel = bot.get_channel(voice_channel_id)
member_ids = voice_channel.voice_states.keys()
await debug_channel.send('voice activity')
return
if str(after.channel.id) == voice_channel_id:
print("Connecting to voice channel " + voice_channel_id)
voiceChannel = await voice_channel.connect()
print("Disconnecting from voice channel " + voice_channel_id) print("Disconnecting from voice channel " + voice_channel_id)
voiceChannel = await after.channel.connect() voiceChannel = await after.channel.connect()
await voiceChannel.disconnect() await voiceChannel.disconnect()