madmax3365 / node-red-node-discord

Discord nodes for node-red
6 stars 9 forks source link

TypeError: msg.attachments.forEach is not a function #21

Closed chrzr closed 3 years ago

chrzr commented 3 years ago

Hi there!

I'm trying to attach a picture from a local IP-Cam to a message. I use the HTTP Request node to GET the picture and return it as a binary buffer to msg.payload. I then use a function node to build msg.attachments:

image

However, I only get "TypeError: msg.attachments.forEach is not a function".

image

Any idea what could cause this?

Thanks in advance!

madmax3365 commented 3 years ago

Hi @chrzr . I think the attachments property must be an array. Try to pass an array containing your image object.

chrzr commented 3 years ago

Ah damn, that's it! Thank you! :-)