check channel type and show join/quits
This commit is contained in:
parent
40df1726da
commit
cf4585e647
1 changed files with 15 additions and 11 deletions
26
main.py
26
main.py
|
@ -97,20 +97,24 @@ async def on_voice_state_update(member, before, after):
|
||||||
#print("[INFO] self event detection")
|
#print("[INFO] self event detection")
|
||||||
return
|
return
|
||||||
|
|
||||||
voice_channel = await bot.fetch_channel(voice_channel_id)
|
|
||||||
debug_channel = await bot.fetch_channel(text_channel_id)
|
debug_channel = await bot.fetch_channel(text_channel_id)
|
||||||
|
voice_channel = await bot.fetch_channel(voice_channel_id)
|
||||||
member_ids = len(voice_channel.voice_states.keys())
|
member_ids = len(voice_channel.voice_states.keys())
|
||||||
|
|
||||||
try:
|
if before.channel is None:
|
||||||
if str(before.channel.id) == str(voice_channel_id):
|
prev_chan = "not_found"
|
||||||
member_msg = str(member.nick) + ' is in the void :eight_pointed_black_star:'
|
else:
|
||||||
if str(after.channel.id) == str(voice_channel_id):
|
prev_chan = str(before.channel.id)
|
||||||
member_msg = str(member.nick) + ' enjoys! :star:'
|
if prev_chan == str(voice_channel_id):
|
||||||
print('[INFO] ' + member_msg)
|
member_msg = str(member.nick) + ' is in the void :eight_pointed_black_star:'
|
||||||
#await debug_channel.send(member_msd)
|
if after.channel is None:
|
||||||
except:
|
next_chan = "not_found"
|
||||||
pass
|
else:
|
||||||
|
next_chan = str(after.channel.id)
|
||||||
|
if next_chan == str(voice_channel_id):
|
||||||
|
member_msg = str(member.nick) + ' enjoys! :star:'
|
||||||
|
print('[INFO] ' + member_msg)
|
||||||
|
#await debug_channel.send(member_msd)
|
||||||
|
|
||||||
if member_ids > 0 and isConnected == False:
|
if member_ids > 0 and isConnected == False:
|
||||||
isConnected = True
|
isConnected = True
|
||||||
|
|
Loading…
Reference in a new issue