为什么我的discord.py机器人托管在Heroku上时没有声音?

时间:2020-07-24 08:15:06

标签: heroku ffmpeg discord.py

我的机器人已安装并运行,一切正常,除了声音:他加入了频道,但没有播放音频。我听到了许多不同的说法,其原因是什么(没有使用ffmpeg.exe的权限,缺少buildpack,缺少依赖项,Heroku阻止了免费用户的UDP ...)-但我希望这里的人能真正知道问题所在,因为我无法在网上找到任何明确的原因。

这是漫游器的代码:https://github.com/FlyingThunder/DiscordBot/blob/master/main.py 我的机器上一切正常。 这是Heroku记录给我的唯一错误: 2020-07-24T06:28:30.329937+00:00 app[worker.1]: PermissionError: [Errno 13] Permission denied: 'res/ffmpeg.exe'

我已经尝试将https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git添加到我的构建包中,并且我将cffi==1.14.0添加到我的requirements.txt中-这两种解决方案都可以解决这个确切的问题。

1 个答案:

答案 0 :(得分:1)

要在heroku上托管音乐机器人,您需要:

  • Opus和FFmpeg构建包(当然还有python):
https://github.com/kitcast/buildpack-ffmpeg.git
https://github.com/xrisk/heroku-opus.git
  • requirements.txt中的以下软件包:
PyNaCl
wheel
ffmpeg

如果在安装这些软件包和buildpack后仍无法解决问题,请共享代码中的音乐部分。