0
votes

I cant really figure out how to do this without iterating through all voicechannels and compare the user ids, but this is veeeery slow. Is there a better way? I want to know this, because my Music Bot should add a song to the queue if the User who wrote the command is in the same voice channel as the Bot

1

1 Answers

0
votes

You can use Member.voice and VoiceState.channel to get the current voice state of both the bot & the person that wrote it (ctx.author) to get the channels immediately without having to loop through anything. Voice returns None if they aren't currently in a VoiceChannel.