I have made a custom discord bot for a fan server, which is hosted by Heroku so it can stay online when I'm not. What I want to do is to have the bot play an mp3 file from its folder when someone gives a specific command for it, but I want the music to play in a specific voice channel.
First, I tried treating it, the same as an image file. For example:
if (message.content == "Play the Funky Tune.")
{
message.reply("Of course, I hope you enjoy!", { files: ["./Music/FunkyTune.mp3"] });
}
However this causes the bot to put the music file there, and while you can click on it and play it, the moment you click on another channel, the music is paused. I want it to play the song in a specific voice channel so that it continues playing when the user clicks on another channel.
When doing research for this, every topic is always asking for a YouTube video link, which converts it into audio, but this is not what I want, since anything can happen to YouTube videos.
P.S. I am not interested in using already made bots, I want to integrate this music feature into my own bot.