How to use ffmpeg on Railway by writing in nixpacks.toml?

I developed a Discord Bot on Heroku and am considering migrating from Heroku to Railway. I used the following buildpacks on Heroku. https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git https://github.com/Crazycatz00/heroku-buildpack-libopus.git I would like to know how to write in nixpacks.toml in Railway. I am not looking to create a music bot, I am looking to create a bot that reads text on discord. I understand that knowing how to do this may encourage the creation of music bots, so could you please DM me about how to do this? Incidentally, the following description does not seem to work.
[phases.setup].
nixPkgs = ['python39','ffmpeg','libopus'].
[phases.setup].
nixPkgs = ['python39','ffmpeg','libopus'].
I get an error like this
Ignoring exception in on_message
Traceback (most recent call last):
File "/opt/venv/lib/python3.9/site-packages/discord/client.py", line 382, in _run_event
await coro(*args, **kwargs)
File "/app/SSTalk.py", line 224, in on_message
message.guild.voice_client.play(source)
File "/opt/venv/lib/python3.9/site-packages/discord/voice_client.py", line 652, in play
self.encoder = opus.Encoder()
File "/opt/venv/lib/python3.9/site-packages/discord/opus.py", line 380, in __init__
_OpusStruct.get_opus_version()
File "/opt/venv/lib/python3.9/site-packages/discord/opus.py", line 373, in get_opus_version
raise OpusNotLoaded()
discord.opus.OpusNotLoaded
Ignoring exception in on_message
Traceback (most recent call last):
File "/opt/venv/lib/python3.9/site-packages/discord/client.py", line 382, in _run_event
await coro(*args, **kwargs)
File "/app/SSTalk.py", line 224, in on_message
message.guild.voice_client.play(source)
File "/opt/venv/lib/python3.9/site-packages/discord/voice_client.py", line 652, in play
self.encoder = opus.Encoder()
File "/opt/venv/lib/python3.9/site-packages/discord/opus.py", line 380, in __init__
_OpusStruct.get_opus_version()
File "/opt/venv/lib/python3.9/site-packages/discord/opus.py", line 373, in get_opus_version
raise OpusNotLoaded()
discord.opus.OpusNotLoaded
GitHub
GitHub - jonathanong/heroku-buildpack-ffmpeg-latest: A Heroku build...
A Heroku buildpack for ffmpeg that always downloads the latest static build - GitHub - jonathanong/heroku-buildpack-ffmpeg-latest: A Heroku buildpack for ffmpeg that always downloads the latest sta...
GitHub
GitHub - Crazycatz00/heroku-buildpack-libopus
Contribute to Crazycatz00/heroku-buildpack-libopus development by creating an account on GitHub.
13 Replies
JustJake
JustJake3y ago
If you host music bots on the platform you’re probably gonna get banned Just a heads up ^^Know that you said you weren’t I’m putting this disclaimer there for people who find this thread
たけ
たけ3y ago
As I stated in the text of my question, I fully understand that hosting MUSIC BOTS is prohibited. I will never host a music bot, and if I do, you can ban me. This is a technical question for running a build with nixpacks.toml on Railway and I believe it is a useful question for users to use Railway's services. And I understand that this method should not be made public, so please let me know how to do this via direct message. What is your final conclusion? In this case, does it mean that we cannot build & deploy in the way we describe in nixpacks.toml? Why am I getting an error when I have libopus in nixpacks.toml?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
たけ
たけ3y ago
Project ID:8153aade-2cb8-4e3e-a2c6-36ad01e8f5fd
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
たけ
たけ3y ago
I will paste the log file again.
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
たけ
たけ3y ago
Yes it does. But I get a raise OpusNotLoaded() error as I wrote above. Is there something wrong with the way libopus was introduced?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
たけ
たけ3y ago
I see...(´;ω;`). Let me know if you find out anything.
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
_Alex_
_Alex_2y ago
@granato did you find a solution ? i'm stuck at that too
milo
milo2y ago
please make your own thread
Want results from more Discord servers?
Add your server