不和谐嵌入-调整缩略图

时间:2018-11-18 13:25:14

标签: embed discord

因此,您可以在嵌入中设置缩略图,但是很遗憾,它很小。有没有办法调整位置和大小?

代码:

if (message.content === prefix + 'aot') {
   const embed = new RichEmbed()
     .setColor(0xFF0000)
     .setTitle("Attack on Titan")
     .setThumbnail("https://orig00.deviantart.net/f9ca/f/2013/145/9/b/shingeki_no_kyojin_render_v1_by_bryan1213-d66iwnc.png")
     .addField("Episodes:", "49")
     .addField("Genres:", "Action, Mystery, Drama")
     .addField("Story","Several hundred years ago, humans were nearly exterminated by titans. Titans are typically several stories tall, seem to have no intelligence, devour human beings and, worst of all, seem to do it for the pleasure rather than as a food source. A small percentage of humanity survived by walling themselves in a city protected by extremely high walls, even taller than the biggest of titans.")
     .setTimestamp();
     message.channel.send(embed);

3 个答案:

答案 0 :(得分:1)

嘿,不知道是否需要它,但是对于其他所有消息,可以在嵌入消息中为图像指定宽度和高度:

https://discordapp.com/developers/docs/resources/channel#embed-object-embed-image-structure

{
  "embed": {
    "title": "title",
    "thumbnail": {
      "url": "https://cdn.discordapp.com/embed/avatars/0.png"
      "width": 600,
      "height": 400
    }
  }
}

答案 1 :(得分:0)

由于在智能手机等不同类型的设备上都可以使用discord,因此在嵌入时不允许过多的自定义。嵌入的图像和文本内容的呈现方式适合于客户端,因此发件人无法指定。 设置缩略图仅意味着指定图像的URL,API目前无法对此进行任何设置。

答案 2 :(得分:-1)

您可以改用 .setImage("https://placekitten.com/700/500")

A screenshot showing the difference between .setThumbnail and .setImage