Discord.js 获取机器人自己的消息

Discord.js 获取机器人自己的消息,discord.js,Discord.js,正在尝试发出ping命令,要编辑ping。。。命令与嵌入,但不知道如何才能获得ping的信息。。。命令 这是我的密码: }else if(command === "ping"){ const msg = message.channel.send('Pinging...');//.then(fetch); const msginfo = Discord.TextChannel.messag

正在尝试发出ping命令,要编辑ping。。。命令与嵌入,但不知道如何才能获得ping的信息。。。命令

这是我的密码:

        }else if(command === "ping"){
            
            const msg = message.channel.send('Pinging...');//.then(fetch);
            const msginfo = Discord.TextChannel.message.fetch(msg);
            console.log(msginfo);
            
            const embedPing = new Discord.MessageEmbed()
            .setColor(0xC1CCDE)
            .setTitle('Pong!')
            .setDescription(`Bot Latency is **${Math.floor(msg.createdTimestamp - message.createdTimestamp)} ms** \nAPI Latency is **${Math.round(client.ws.ping)} ms**`);
            
            setTimeout(() =>  message.channel.send(embedPing), 100);
您只需将wait添加到message.channel.send,然后使用延迟信息编辑消息

const msg=wait message.channel.send'Pinging; msg.edit`Bot延迟为**${Math.floormsg.createdTimestamp-message.createdTimestamp}ms**\nAPI延迟为**${Math.roundclient.ws.ping}ms**;