ping discord
how do i access discord api ping?
code that i tried
code that i tried
const { Client, SlashCommandBuilder, WebSocketManager } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with Pong!'),
async execute(interaction) {
let now = Date.now();
await interaction.reply('calculating...').then((interaction) => interaction.edit(`Pong : **${Date.now() - now}**ms\nDiscord API: ${WebSocketManager.ping}`));
},
};const { Client, SlashCommandBuilder, WebSocketManager } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with Pong!'),
async execute(interaction) {
let now = Date.now();
await interaction.reply('calculating...').then((interaction) => interaction.edit(`Pong : **${Date.now() - now}**ms\nDiscord API: ${WebSocketManager.ping}`));
},
};