【发布时间】:2021-12-03 20:17:06
【问题描述】:
最近我一直在做一些开发,但我不明白为什么它不起作用 它没有出错,但它仍然不起作用我知道为什么如果有人可以帮助我,那将非常感激。 (仅供参考,我的 discord.js 是 12.5.3 版本) 脚本是这样的:
const { MessageEmbed } = require('discord.js')
const Discord = require('discord.js')
const client = new Discord.Client();
client.on('message', async (message) => {
if (message.content.toLowerCase() === 'ip') {
let embed = new Discord.MessageEmbed()
.setColor('#000000')
.setTitle('Région Loxydienne')
.setAuthor('Rayden')
.addFields({
name: '**IP**',
value: 'DaddyTermi.aternos.me'
}, {
name: '**VERSION**',
value: 'MC 1.17.1'
}, {
name: '**IP DYNAMIQUE**',
value: 'Demande à Tormi'
})
.setTimestamp()
.setImage('https://img.wallpapersafari.com/desktop/1680/1050/6/72/8xbBhw.jpg')
.setDescription('bon toutou!')
.setThumbnail('https://imgur.com/gallery/BqUcRTF')
channel.send(embed);
}
})
【问题讨论】:
-
您确定您在控制台中完全没有出现任何错误吗?如果没有错误,我只能想到在
.setThumbnail('https://imgur.com/gallery/BqUcRTF')之后添加;,如下所示:.setThumbnail('https://imgur.com/gallery/BqUcRTF'); -
您确认您的消息事件发出并且 if 语句触发了吗?尝试一些调试
标签: discord.js embed message