Rodrigo Soriano
Rodrigo Soriano

Reputation: 129

Little image in embed titles, Discord.js

I've been trying to display little images in my embeds titles. But I can't make it work, the whole URL is displayed.
Code I tried to use:

    var embed = new Discord.RichEmbed()
        .setTitle(message.author.displayAvatar)
        //I tried displayAvatarURL too
        .setDescription('Test');
        channel.send(embed);

Upvotes: 2

Views: 22545

Answers (2)

Deep
Deep

Reputation: 1

If you want to add a little little image you need defaultAvatarUR

    var embed = new Discord.RichEmbed()
        .setAuthor(message.author.defaultAvatarUR)
        .setDescription('Test');
        channel.send(embed);

it's will be like this click here to see

Upvotes: 0

André
André

Reputation: 4497

That icon is from embed.setAuthor.

var embed = new Discord.RichEmbed()
    .setTitle("My Title")
    .setAuthor("My Name", message.author.avatarURL)
    .setDescription("My Description");
    channel.send(embed);

And also to get the URL from the user avatar, on the current Discord.js version is message.author.avatarURL and not displayAvatar.

Upvotes: 4

Related Questions