【问题标题】:My discord bot doesn't play mp3 file and it gives no errors我的 discord bot 不播放 mp3 文件并且没有错误
【发布时间】: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


    【解决方案1】:

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

    我将保留此内容,因为我确信有人会这样做。

    【讨论】:

      猜你喜欢
      • 2020-09-04
      • 1970-01-01
      • 2021-04-07
      • 1970-01-01
      • 2020-11-29
      • 1970-01-01
      • 1970-01-01
      • 2021-11-07
      • 2019-09-06
      相关资源
      最近更新 更多