【发布时间】:2021-08-04 23:20:07
【问题描述】:
我见过很多这样的不和谐嵌入代码:
(这是一个老问题,我对编码很陌生......)
const { MessageEmbed } = require('discord.js');
const exampleEmbed = new MessageEmbed()
.setColor('#0099ff')
.setTitle('Some title')
.setURL('https://discord.js.org/')
.setAuthor('Some name', 'https://i.imgur.com/AfFp7pu.png', 'https://discord.js.org')
.setDescription('Some description here')
.setThumbnail('https://i.imgur.com/AfFp7pu.png')
.addFields(
{ name: 'Regular field title', value: 'Some value here' },
{ name: '\u200B', value: '\u200B' },
{ name: 'Inline field title', value: 'Some value here', inline: true },
{ name: 'Inline field title', value: 'Some value here', inline: true },
)
.addField('Inline field title', 'Some value here', true)
.setImage('https://i.imgur.com/AfFp7pu.png')
.setTimestamp()
.setFooter('Some footer text here', 'https://i.imgur.com/AfFp7pu.png');
channel.send({ embeds: [exampleEmbed] });
那么,我不明白的是什么是触发器?就像您应该为 pong 输入 .ping 一样,对吗?那么我输入什么来让我的机器人类型嵌入这个?
【问题讨论】:
-
在开始创建 Discord 机器人之前,请先查看一些指南和教程。 This 是一个很棒的 discord.js 初学者指南,YouTube 上有大量的视频教程。如果您通过这些教程学习如何正确使用 djs,它将为您节省大量时间,因此您不必陷入创建不和谐机器人的每一步并在这里提出一个又一个问题。问这个问题很像试图跳过一个你一无所知的复杂游戏的教程。当你不能轻易做到时,你会迷失和困惑。
标签: discord.js