This repository has been archived on 2025-08-25. You can view files and clone it, but cannot push or open issues or pull requests.
Files
shiro-calculator/commands/ping.js
koneko 6b58361d31
All checks were successful
Deploy bot / build-and-deploy (push) Successful in 13s
a little more
2025-08-08 01:08:16 +02:00

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())}**`
);
});
};