Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

discord.py Problem : How to check the first user that joined in voice chat in discord

So I am making a bot that it do like when people joined in specific VC. It'll create new voice channel by using who joined in that specific vc first. Don't mind my english I know my english suck. :c I was trying on this

from discord.ext import commands
import discord 
import os

bot = commands.Bot(command_prefix = ">")
client = discord.Client()

@commands.command()
async def join_voice(self, ctx):
    connected = ctx.author.voice
    if connected:
      await create_voice_channel("I want to add a person who triggered the bot by join specific VC to  set name of new VC to their name.")
client.run(os.getenv('TOKEN'))
like image 583
timelessnesses Avatar asked Dec 07 '25 03:12

timelessnesses


1 Answers

I think what you're looking for is the on_voice_state_update coroutine function. I'm not quite sure what you want to do with the data which is passed to the function, but you can probably find what you want here.

For any other issues, try checking the discord.py API reference

like image 95
Jacob Lee Avatar answered Dec 10 '25 13:12

Jacob Lee



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!