debug voice activity
This commit is contained in:
parent
5926ef055a
commit
ce9d214a35
1 changed files with 14 additions and 13 deletions
23
main.py
23
main.py
|
@ -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":
|
debug_channel = bot.get_channel(text_channel_id)
|
||||||
print(after.name + " joined " + str(after.voice_channel))
|
voice_channel = bot.get_channel(voice_channel_id)
|
||||||
if str(after.channel.id) == 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)
|
print("Connecting to voice channel " + voice_channel_id)
|
||||||
voiceChannel = await after.channel.connect()
|
voiceChannel = await voice_channel.connect()
|
||||||
|
|
||||||
|
|
||||||
elif str(after.voice_channel) == "None":
|
|
||||||
print(after.name + " left " + str(before.voice_channel))
|
|
||||||
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()
|
||||||
|
|
Loading…
Reference in a new issue