#Add thumbnail embed from locally running api

9 messages · Page 1 of 1 (latest)

lusty cairn
#

As the title says, is there a way to add an image as embed thumbnail without having to deploy the api online? I'm new to writing rest api, and was wondering if it's possible to do this

humble quiverBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
  • Marked as resolved by OP
hollow rock
#

do you mean local files?

lusty cairn
#

I know local files are not supported for embed thumbnail
But I'm planning to deploy a website someday, and I'm starting to test stuff to learn how to use apis, and I came across this interrogation
If I'm running a rest api locally with every image etc that the bot as well as the website would use, could I also store embed thumnails and use them from there?

hollow rock
#

local files are supported though

dry iglooBOT
#

Files in embeds should be attached via the message option object and referenced in the embed:

const attachment = new AttachmentBuilder('./image.png', { name: 'image1.png' });
const embed = new EmbedBuilder()
  .setTitle('Attachments')
  .setImage(`attachment://${attachment.name}`);

channel.send({
  embeds: [embed],
  files: [attachment]
});
bitter imp
#

basically the same but with setThumbnail instead

#

though if you really want to make a website you only need a file server, which is much easier to setup since doesn't even require code

#

but that's outside the scope of djs, you'd need to ask in #1081585952654360687