“Discord.js fügen dem Einbetten Bild hinzu” Code-Antworten

So senden Sie eine Einbettungsnachricht Discord.js

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

Discord ist das Bild mit Datei Discord JS eingebettet

// 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

Einbettete Beispiel diskord.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 fügen dem Einbetten Bild hinzu

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

Ähnliche Antworten wie “Discord.js fügen dem Einbetten Bild hinzu”

Fragen ähnlich wie “Discord.js fügen dem Einbetten Bild hinzu”

Weitere verwandte Antworten zu “Discord.js fügen dem Einbetten Bild hinzu” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen