Discord音乐漫游器NoneType'对象没有属性'play'

时间:2020-10-04 11:34:56

标签: python discord.py-rewrite

这是我的代码:

voice.play(discord.FFmpegPCMAudio("song.mp3"), after=lambda e: print("Song done!"))
voice.source = discord.PCMVolumeTransformer(voice.source)
voice.source.volume = 0.07

我收到此错误:

discord.ext.commands.errors.CommandInvokeError:命令引发了 异常:AttributeError:'NoneType'对象没有属性'play'

1 个答案:

答案 0 :(得分:0)

这意味着声音为无...

您尝试连接到频道吗? 您是否在与该频道相同的公会中执行命令?

https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild.voice_channels https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild.voice_client