gpt4 book ai didi

python - discord.py 问题 : How to check the first user that joined in voice chat in discord

转载 作者:行者123 更新时间:2023-12-04 03:42:08 25 4
gpt4 key购买 nike

所以我正在制作一个机器人,当人们加入特定的 VC 时它会喜欢它。它将通过使用首先加入该特定 vc 的人来创建新的语音 channel 。不要介意我的英语,我知道我的英语很烂。 :C我正在尝试这个

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

最佳答案

我认为您正在寻找的是 on_voice_state_update 协程函数。我不太确定你想对传递给函数的数据做什么,但你可能会找到你想要的 here .

对于任何其他问题,请尝试检查 discord.py API reference

关于python - discord.py 问题 : How to check the first user that joined in voice chat in discord,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65820138/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com