#`options attachments` array contains
1 messages · Page 1 of 1 (latest)
i console.log(options) and it return me this:
message: 'ogarnąłem trch komende z permisjami (front)\n' +
'zostało mi zrobić backend i będzie tyle na dziś ',
embeds: [],
attachments: [
{
id: '1046501359110848603',
filename: 'image.png',
size: 72131,
url: 'https://cdn.discordapp.com/attachments/997275526974689450/1046501359110848603/image.png',
proxy_url: 'https://media.discordapp.net/attachments/997275526974689450/1046501359110848603/image.png',
width: 637,
height: 547,
content_type: 'image/png'
}
],
components: [ { type: 1, components: [Array] } ],
mentions: false,
name: 'Darek',
icon: 'https://cdn.discordapp.com/avatars/637206828572475392/a_f42e053328ff97bbcb5b9eb8c7628964.gif'
}
options.attachments is not undefined
BaseMessageOptions
The base message options for messages.
Nothing there's matches your data
ik ab it
console.log(options.attachments)
return await hook.send({
content: options.message,
username: options.name,
avatarURL: options.icon,
embeds: options.embeds,
files: options.attachments,
components: options.components,
allowedMentions: {parse: []}
});
i used files
in message options
and options.attachments is right
but i got error
TypeError: Cannot read properties of undefined (reading 'path')
at findName (C:\Users\pawli\Desktop\thunder-shards\node_modules\discord.js\src\structures\MessagePayload.js:244:17)
at MessagePayload.resolveFile (C:\Users\pawli\Desktop\thunder-shards\node_modules\discord.js\src\structures\MessagePayload.js:258:31)
at C:\Users\pawli\Desktop\thunder-shards\node_modules\discord.js\src\structures\MessagePayload.js:225:85
at Array.map (<anonymous>)
at MessagePayload.resolveFiles (C:\Users\pawli\Desktop\thunder-shards\node_modules\discord.js\src\structures\MessagePayload.js:225:56)
at Webhook.send (C:\Users\pawli\Desktop\thunder-shards\node_modules\discord.js\src\structures\Webhook.js:221:50)
at Object.sendWebhook (C:\Users\pawli\Desktop\thunder-shards\src\lib\Utils\Functions.js:62:35)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
The data in options.attachments is not what files array expected to be.
options.attachments includes file (image)
{
id: '1046501359110848603',
filename: 'image.png',
size: 72131,
url: 'https://cdn.discordapp.com/attachments/997275526974689450/1046501359110848603/image.png',
proxy_url: 'https://media.discordapp.net/attachments/997275526974689450/1046501359110848603/image.png',
width: 637,
height: 547,
content_type: 'image/png'
}
its file
This object is not BufferResolvable, JSONEncodable<AttachmentPayload>, Attachment or AttachmentBuilder
Map it to url. URL is BufferResolvable
