admin管理员组文章数量:815012
Discordjs bot嵌入gif文件
我的机器人是随机发送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"]})
}
回答如下:您需要先做
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)
本文标签: Discordjs bot嵌入gif文件
版权声明:本文标题:Discordjs bot嵌入gif文件 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/biancheng/1715203582a822455.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论