“Discord.js Tambahkan gambar ke embed” Kode Jawaban

cara mengirim pesan embed scord.js

let Embed = new Discord.MessageEmbed()
    .setTitle()
    .setAuthor()
    .setColor()
    .addField()
    .setDescription()
    .setThumbnail()
Xenophobic Xenomorph

Discord Embed Image dengan File Discord JS

// Before v13
const embed = new Discord.MessageEmbed().setTitle('Attachments').attachFiles(['./image1.png', './image2.jpg']);
channel.send(embed);
// v13
const embed = new Discord.MessageEmbed().setTitle('Attachment').setImage('attachment://image.png');
channel.send({ embeds: [embed], files: ['./image.png'] });
Testy Tarsier

Embed contoh discord.js

const embed = new Discord.RichEmbed() //Ver 11.5.1 of Discord.js
.setTitle("This is a title")
.setTitle("http://tryitands.ee")
.setDescription("This is a description")
.setTimestamp()
.setFooter("This is a footer")
.setAuthor("This is the author's name", //and this its profile pic)
.addField("This is a field", "this is its description")
.setImage("https://cdn.discordapp.com/avatars/449250687868469258/1709ab4f567c56eaa731518ff621747c.png?size=2048")
.setThumbnail("https://cdn.discordapp.com/avatars/449250687868469258/1709ab4f567c56eaa731518ff621747c.png?size=2048")
<message>.<channel>.send(embed)
Develify

Discord.js Tambahkan gambar ke embed

const embedHelper = async (title: string, desc: string) => {
            const rn = new Date()
            const creator = await getUserFromId('CREATOR ID HERE')
            const embed = new MessageEmbed()
            embed.setAuthor(client.user?.username!, client.user?.avatarURL()!)
            .setTitle(title)
            .setDescription(desc)
            .setTimestamp(rn)
            .setFooter(`Bot made by ${creator.tag}`, creator.avatarURL()!)
            .setURL('BOT SUPPORT SERVER')
            return embed
        }
const embed = await embedHelper('Yo', "Lol")
const attachment = new MessageAttachment(String(imgDir + img), img)
embed.setImage(`attachment://${img}`)
await message.reply({
  embeds: [embed],
  files: [
    attachment
  ]
})
TooMuchHam

Jawaban yang mirip dengan “Discord.js Tambahkan gambar ke embed”

Pertanyaan yang mirip dengan “Discord.js Tambahkan gambar ke embed”

Lebih banyak jawaban terkait untuk “Discord.js Tambahkan gambar ke embed” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya