我的机器人正在发送随机GIF,但未嵌入。我想发送带有嵌入的随机GIF。我怎么能这样?
代码:
if (msg.author.bot) return;
if (msg.content.toLowerCase() === prefix + 'xgif' ) {
number = 100;
imageNumber = Math.floor (Math.random() * (number -1 + 1)) + 1;
client.channels.cache.get(`channelID`).send( {files: ["./images/" + imageNumber + ".gif"]})
}
答案 0 :(得分:0)
您需要先做
const { RichEmbed } = require('discord.js')
这将为您获得RichEmbed。然后,
const embed = new RichEmbed()
您可以做很多事情来更改嵌入。有
.setColor(hexidecimal)
.setThumbnail(normally user.displayAvatarURL)
.setFooter(whatever you want)
.setTimestamp()
.setDescription(whatever you want)
.setAuthor(whatever you want)
.addField(stuff)