【发布时间】:2020-09-19 19:00:45
【问题描述】:
所以我使用 discord 文档编写了一个动态帮助命令。但为了吸引眼球,我想将其嵌入并显示到用户 DM 中。 这是一个小sn-p -
execute(client, message, args) {
const data = [];
const { commands } = message.client;
if (!args.length) {
data.push('Here\'s a list of all my commands:'); //push on data var to append the info you want
data.push(commands.map(command => command.name).join('\n'));
data.push(`\nYou can send \`${prefix}help [command name]\` to get info on a specific command!`);
return message.author.send(data, { split: true })
.then(() => {
if (message.channel.type === 'dm') return;
message.reply('I\'ve sent you a DM with all my commands!');
})
.catch(error => {
console.error(`Could not send help DM to ${message.author.tag}.\n`, error);
message.reply('it seems like I can\'t DM you! Do you have DMs disabled?');
});
}
无论如何我可以在嵌入中使用 data.push 吗?
【问题讨论】:
标签: discord discord.js