【发布时间】:2021-01-04 21:05:10
【问题描述】:
我尝试调试,但一切正常,然后什么也没发生
澄清filename是包含文件的文件路径
async def playing_video(ctx, filename):
global vc
voice_channel = ctx.author.voice.channel
channel = None
# Check if user is in a voice channel
if voice_channel != None:
channel=voice_channel.name
print(f"Voice Channel: {voice_channel}")
vc = await voice_channel.connect()
# It reaches here with the right path to the file and what looks like the right vc but then nothing happens.
vc.play(discord.FFmpegPCMAudio(filename), after=lambda e: print('done', e))
else:
await ctx.send("You must use *join first!")
我发现的只是一个和我有同样问题的人,但他只是写了“我解决了它”而没有说明如何解决。
【问题讨论】:
标签: python-3.x discord.py-rewrite