Discord Ping in bot message

Hi, glitchers! How to display real Discord ping in Discord bot message.

Can you elaborate? This is not enough for me to understand. :wink:

1 Like

What do you mean by “real” ping?

Yea. I dont know either

1 Like

Please, help. How to display Discord ping in Discord bot message.

What do you mean Real ping?

Do you mean the API Ping / Bot Ping / MS?

For what I understood, you want the ping of the bot?
This code will get you the API ping and bot ping:

message.channel.send('Pinging...').then(m => {
  // If you are using v11.x of discord.js, it is client.ping, not client.ws.ping
  let apiPing = client.ws.ping
  let msgPing = m.createdTimestamp - message.createdTimestamp
  m.edit(`Bot ping: ${msgPing}\n API ping: ${apiPing}`)
})

@TheBigerGamer is that v11 discord.js or v12 discord.js im dumb i use v12.

@DaRealMiniToon check the commented line.