
Live chat software to provide immediate response to clients.Ĭreate stunning posters, logos, greeting cards, brochures, etc.Ĭonnect your data and build smooth workflowsīuild customer trust with a custom domain name if ( builder to build websites in minutesĬhatbot builder to build chatbots without coding
When your script is modified, it becomes as follows.
In this case, I think that the MP3 file can be played without creating the temporal file using the stream. In your script, you download the MP3 file and save it as a temporal file, and then you try to play the MP3 file using the temporal file. If my understanding is correct, how about this answer? Please think of this as just one of several possible answers. You want to know about the method for downloading the MP3 file and playing it using the downloaded file. You have already been able to use Drive API. You have already been able to play the MP3 file at the voice channel. You want to play a MP3 file at the voice channel on Discord. get(), but I got the same error:Īn error occurred while running the command: TypeError: (.).pipe is not a function.įor clarification, I already know how to make the bot join a Discord voice channel and make it play an audio file, I just need to know how to get the file(s) I need from Google Drive, and if possible, what'd be the best approach for a queue/playlist system.Īny advice is welcome, thanks in advance. Here is the relevant part of my code, following the Google Drive API docs about file downloads: if () ) Īn error occurred while running the command: TypeError: (.).on is not a function. I would accept any kind of suggestions as to how stream the file instead of downloading it if that provides any large benefits/is significantly easier to code, otherwise how to download it and temporarily store it while it plays (bear in mind that the hosting service I'm using has limited storage available so downloading the entire folder isn't an option), and as to how to approach loading/pre-loading and queueing of the playlist (the entire music folder) in an efficient way for the bot to stream. I have also not found a way to stream the audio file itself, but I am rather downloading it and storing it in a temporary mp3 file.
Before getting to the entire folder, I've been trying to get a single file to stream, and that's where I'm stuck at. I ideally want to stream a playlist/specific song, all songs from a same genre will be in the same folder, so my idea is to do say !play electronic and the bot will play all the files in a specific folder. So I am trying to set up a music library I can access from my discord.js bot.