📌  相关文章
📜  discord.js 将图像添加到嵌入 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:42.078000             🧑  作者: Mango

代码示例3
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
  ]
})