【发布时间】:2020-10-16 18:53:12
【问题描述】:
我有兴趣使用 python 制作一个不和谐的机器人。 我正在尝试制作一个可以加入语音频道的机器人。 这是我的代码,我已经运行了它,但它不起作用。 我已经在网上做了一些研究,但我认为这段代码完全没问题?
#Join Command
@client.command()
async def join(ctx):
if(ctx.author.voice): #If in voice channel
channel = ctx.author.voice.channel
await channel.connect()
else: #If not in voice channel
await ctx.send("You must be in voice channel first !")
那么知道为什么我的代码不起作用吗? 这是我第一次使用python btw。
【问题讨论】: