28 lines
872 B
JavaScript
28 lines
872 B
JavaScript
function format(seconds) {
|
|
function pad(s) {
|
|
return (s < 10 ? "0" : "") + s;
|
|
}
|
|
var hours = Math.floor(seconds / (60 * 60));
|
|
var minutes = Math.floor((seconds % (60 * 60)) / 60);
|
|
var seconds = Math.floor(seconds % 60);
|
|
|
|
return pad(hours) + ":" + pad(minutes) + ":" + pad(seconds);
|
|
}
|
|
|
|
exports.name = "ping";
|
|
exports.description = ":ping_pong: View service statistics.";
|
|
exports.usage = "<<ping";
|
|
exports.example = "<<ping";
|
|
exports.hidden = true;
|
|
exports.run = async (client, message, args) => {
|
|
message.channel.send("Fetching data...").then((m) => {
|
|
m.edit(
|
|
`🏓 Latency is **${
|
|
m.createdTimestamp - message.createdTimestamp
|
|
}ms**.\nAPI Latency is **${Math.round(
|
|
client.ws.ping
|
|
)}ms**.\n**Client uptime is ${format(process.uptime())}**`
|
|
);
|
|
});
|
|
};
|