#Webhook Error
22 messages · Page 1 of 1 (latest)
Show the full error including stacktrace
Can I ask what your node and djs version is?
Actually looking at the code I’m guessing you passed something funky into the files property
node : 18.17
djs : 14.15.3
What does that mean 🤔
I am using webhookClient.send() to send :
- username
- avatarURL
- embeds
- files
- components
Files and embed keep changing, others are static
The files are the issue. What do you pass when you receive that error?
It appears you pass something that is neither a string nor a Buffer nor a Stream nor an Attachment as one of the files so resolveFile gets called with undefined
I create an image then pass it as an attachment to send it thru the webhook, any idea how can I check the image if it's valid or not before sending?
Show the code how you create it and pass it
You should do what Qjuh said and show the entire code. Also, is it not toBuffer rather then encode? Never seen encode before
The code is too big and can't show it all here, idk about toBuffer, I always used encode
I believe toBuffer used to give me errors
show the parts that are relevant
And the part where you send everything?
Updated
Looks like they create a new url x)
My best guess is one of the images is undefined. But I’m sure one of the others in this thread may know more
Show how those two methods get called (and how the result of the first one ends up in the call of the second one)