S
S
Shokweiv2022-03-05 20:03:28
Node.js
Shokweiv, 2022-03-05 20:03:28

How to make embeds send an image to the ds js13 discord channel?

my code is

const file = new MessageAttachment('s:/BASE/a/b/c/1.jpg');
message.channel.send({
embeds: [
{
title: "txt",
color: [0, 255, 0],
description: "txt",
image: file

}
]

});


};

It prints embed with given parameters without image

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
getaxe, 2022-03-06
@getaxe

The image contains a string (link to the image)
When loading from a folder with a code, you can use:

const file = `/img/1.jpg`; // при условии что код embed сообщения находиться в главной папке бота
const file = `../img/1.jpg`; // при условии что код embed сообщения находиться на одну "назад";
// ну и картинка должна лежать в моем примере в папке img в главной папке.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question