【发布时间】:2021-11-27 14:55:54
【问题描述】:
我正在开发一个命令,以向特定用户发送一个嵌入的命令,该命令是我项目中的帮助菜单。我成功发送了正常消息,但我无法了解如何在 DM 中发送嵌入!,我读到它需要另一种类型的嵌入。
module.exports = {
name: 'costietare',
description: "This is a help command.",
async execute(client, message, args, Discord) {
message.delete({timeout: 10});
let dUser =
message.guild.member(message.mentions.users.first()) ||
message.guild.members.get(args[0]);
if (!dUser) return message.channel.send("Can't find user!");
if (!message.member.hasPermission('ADMINISTRATOR'))
return message.reply("Insufficient Permissions!");
let embed = new Discord.MessageEmbed()
.setTitle('General Information')
.setColor('YELLOW')
.addFields(
{name: 'Developer', value: '[m1](https://steamcommunity.com/id/catshvh)', inline:false},
{name: '!commands', value: 'More Commands & Usage for the bot', inline:true},
{name: 'BUY/Support', value: "[Click here to buy](https://discord.gg/4Qt3238jCy)", inline:true},
)
.setTimestamp()
dUser.send(`Sunt tare, stiu`); << Here is the normal message that its perfectly fine and
dUser.send(`${embed}`); << this reply with **[object Object]**
message.author.send(
`${message.author} You have sent your message to ${dUser}`
);
}
}
【问题讨论】:
-
你使用的是哪个 discordjs 版本
标签: javascript discord embed