timelessnesses
timelessnesses

Reputation: 90

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'))

Upvotes: 3

Views: 165

Answers (1)

Jacob Lee
Jacob Lee

Reputation: 4700

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

Upvotes: 1

Related Questions