Hey im trying to check if a Specific User is in a Voice Channel. Retrieving the users in a channel works but i can't find out with "if" if a certain id is in there. Im getting the User id from a Python list. I dont know what to do please help :)
@client.command()
async def foo(ctx):
t = len(memberlist)
countermem = 0
for _ in range(t):
voice_channel = client.get_channel(802195467278352407)
voice_state = ctx.member.voice
ids = voice_channel.voice_states.keys()
userid = memberlist[(countermem)]
channelid = discord.VoiceChannel
voice_state = userid.member.voice
if voice_state is None:
print ("Somesssssssssssng")
print(channelid)
print ("Some thing")
id = memberlist[(countermem)]
print(id)
fullstring = voice_channel.voice_states.keys()
substring = "700388090631421982"
if memberlist[(countermem)] in voice_channel.voice_states.keys():
print("is in a channel")
if id in voicestats:
voicestats[id] += 10
_savestats()
print("it worked")
else:
print("was not in stats file")
voicestats[id] = 10
_savestats()
else:
print("not in a channel")
countermem += 1