Javascript 在discord.js上嵌入ping命令

Javascript 在discord.js上嵌入ping命令,javascript,node.js,discord,discord.js,Javascript,Node.js,Discord,Discord.js,我正在尝试创建一个漂亮的ping命令,其中包含ping的消息是一个嵌入的命令,如下所示: 但是,我不希望对嵌入进行编辑。我希望在ping完成后将其作为单独的消息发送 这是我的密码: module.exports={ 名称:'平', description:“显示bot/的ping”, 执行(消息、参数、嵌入){ message.channel.send('**Ping inator!**\nPinging…')。然后((msg)=>{ var ping=msg.createdTimestamp

我正在尝试创建一个漂亮的ping命令,其中包含ping的消息是一个嵌入的命令,如下所示:

但是,我不希望对嵌入进行编辑。我希望在ping完成后将其作为单独的消息发送

这是我的密码:

module.exports={
名称:'平',
description:“显示bot/的ping”,
执行(消息、参数、嵌入){
message.channel.send('**Ping inator!**\nPinging…')。然后((msg)=>{
var ping=msg.createdTimestamp-message.createdTimestamp;
msg.edit(“**Ping输入程序!***\nPong!bot的Ping是”“+Ping+'ms`.”);
});
},
};

如果您不想编辑它,只需发送另一条消息即可

message.channel.send('**Ping inator!**\nping…')。然后((msg)=>{
ping=msg.createdTimestamp-message.createdTimestamp;
const embed=new Discord.MessageEmbed()
.setColor(`RANDOM`)
.setTitle(`Ping`)
.setDescription(
“**Ping inator!***\nPong!bot的Ping是”“+Ping+'ms`.”
);
message.channel.send(嵌入);
msg.delete();
});

您无法编辑消息并隐藏已编辑的标记。它将出现在每一条编辑过的消息上,无论是从bot还是用户发送的

您可以做的是,您可以删除旧邮件并发送新邮件,而不是编辑邮件。这样,就不会显示已编辑的标记


我举了一个简单的例子:

client.on('message',(message)=>{
if(message.author.bot)返回false;
const Embed=new Discord.MessageEmbed()
.setDescription('正在检查ping…')
.setColor(“#4287f5”);
message.channel.send(嵌入)。然后((嵌入消息)=>{
setTimeout(异步()=>{
Embed.setDescription('Pong!ping是'2000ms`!');
等待embedMessage.delete().catch((错误)=>console.log(错误));
message.channel.send(嵌入);
}, 2000);
});
});

我需要一个嵌入,就像我在上面的imgur链接中所显示的那样。这真的很简单。整个命令都非常简单,我已经编辑了我的答案以进行嵌入(同样,这非常简单,如果你知道javascript和discord.js,你就不需要我们的帮助)