我的 discord bot 不播放 mp3 文件,也没有错误

时间:2021-01-04 11:17:19

标签: python-3.x discord.py-rewrite

我试过调试,但一切正常,然后什么也没发生

澄清 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!")

我发现的只是一个和我有同样问题的人,但他只是写了“我解决了”而没有说明如何解决。

1 个答案:

答案 0 :(得分:0)

我觉得自己像个白痴。问题是机器人没有发言权。

我不做这件事是因为我相信有人会这样做。