How to use local file as thumbnail in DiscordJS embedded message?

前端 未结 2 821
甜味超标
甜味超标 2020-12-21 06:14

Is it possible to use a local file as a thumbnail for an embedded message with DiscordJs?

\"thumbnail\": {
  \"url\": \"../img/025.png\"
},

2条回答
  •  暖寄归人
    2020-12-21 07:09

    Other way to do, I hope it helps

    const attachment = new Discord.MessageAttachment('fileRoute', 'nameOfYourPicture');
    const embed = new Discord.MessageEmbed()
      .setTitle('Nueva Tarea')
      .setColor('#8fda81')
      .addField('Mensaje Enviado', textoEnviar)
      .attachFiles(attachment)
      .setThumbnail('attachment://nameOfYourPicture');
    message.channel.send(embed);
    

提交回复
热议问题