Hi there, this command is supposed to allow the user to upload a .mp3 file for the bot to play, but I cannot get it to work. Here's how I wanted to work. 1. User requests /playmp3 and has the option to upload an attachment (.mp3) to play (see photo for example). 2. The bot then plays that given .mp3 file in the voice channel. I have already gotten this to work for raw .mp3 file links, but I also want attachment support. However, I am getting this error:
Error executing playmp3TypeError [ERR_INVALID_ARG_TYPE]: The "body" argument must be of type function or an instance of Blob, ReadableStream, WritableStream, Stream, Iterable, AsyncIterable, or Promise or { readable, writable } pair. Received an instance of Attachment
Error executing playmp3TypeError [ERR_INVALID_ARG_TYPE]: The "body" argument must be of type function or an instance of Blob, ReadableStream, WritableStream, Stream, Iterable, AsyncIterable, or Promise or { readable, writable } pair. Received an instance of Attachment
I'm assuming Discord.js doesn't support attachments for playing? How could I approach this? Maybe be downloading the .mp3 locally to a folder temporarily and playing it through there? Here is my current code, thanks in advance!
Recent Announcements
Continue the conversation
Join the Discord to ask follow-up questions and connect with the community
d-Iaa
discord.js - Imagine an app
Support server for discord.js, a Node.js module to interact with Discord's apps API.