“discord.js ajouter une image à intégrer” Réponses codées

Comment envoyer un message intégré Discord.js

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

Discord Embed Image avec Fichier 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

Intégrer l'exemple de 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 ajouter une image à intégrer

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

Réponses similaires à “discord.js ajouter une image à intégrer”

Questions similaires à “discord.js ajouter une image à intégrer”

Plus de réponses similaires à “discord.js ajouter une image à intégrer” dans JavaScript

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code