嵌入标题中的小图像,Discord.js

时间:2018-05-05 16:09:49

标签: javascript embed discord discord.js avatar

我一直试图在我的嵌入标题中显示小图像。但我无法使其工作,显示整个网址 我尝试使用的代码:

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

2 个答案:

答案 0 :(得分:3)

该图标来自embed.setAuthor

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

另外,要获取用户头像的网址,目前的Discord.js版本为message.author.avatarURL,而不是displayAvatar

答案 1 :(得分:0)

如果你想添加一点小图片,你需要typedef struct Nodes { char *mgmt; char *ops; ~Node() { free(mgmt); free(ops); } } Nodes; Nodes n = { strdup(mgmt.str().c_str()), strdup(ops.str().c_str())};

defaultAvatarUR

它会是这样的 click here to see