所以基本上我正在尝试制作一个youtube播放器命令,它可以通过语音聊天播放音频,我一直在测试这个命令,它一直在说“disfunctional(变量名)是一个缺少的必要参数”,我提供了这个链接,但它仍然说它丢失了,我可能只是哑巴,但我几乎肯定这应该是有效的
@client.command(pass_context=True)
async def yt(self, ctx,*, dysfunctional):
channel = ctx.message.author.voice.voice_channel
if dysfunctional.startswith('https://www.youtube.com'):
voice = await client.join_voice_channel(channel)
player = await voice.create_ytdl_player(dysfunctional)
player.start()
if dysfunctional == "stop":
player.stop()
disconnect()
您不在cog类中,因此无法获取self参数。尝试使用以下代码
相关问题 更多 >
编程相关推荐