#How to send the image inside the embed?

4 messages · Page 1 of 1 (latest)

proud fable
#

The image is sent outside the embed as a regular attachment

royal yokeBOT
#
  • 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!
proud fable
#
async function sendProfileImage(user, profile) {
    const attachment = new AttachmentBuilder(profile.url, 'profile.png');

    const embed = new EmbedBuilder()
        .setColor('Blurple')
        .setAuthor({ name: `${user.username}'s profile`, iconURL: user.displayAvatarURL({ dynamic: true }) })
        .setImage('attachment://profile.png');

    await profileLogger.send({
        username: user.username,
        avatarURL: user.displayAvatarURL({ dynamic: true }),
        embeds: [embed],
        files: [attachment]
    });
}