Creating a simple "Ping Pong" Command
At this page, you will learn how to create a simple "Ping Pong" command.
How to create a "Ping Pong" Command
const { NoCliCommandType } = require("nocli-handler.js");
/**
* @type {import("nocli-handler.js").ICommand}
*/
const Command = {
type: NoCliCommandType.Legacy,
description: "Checks client latency",
callback: ({ client, message, args, text }) => {
return `π Pong! \`${client.ws.ping}ms\``
}
}
module.exports = Command;import { ICommand, NoCliCommandType } from "nocli-handler.js";
export default {
type: NoCliCommandType.Legacy,
description: "Ping",
callback: ({ client, message, args, text }) => {
return `π Pong! \`${client.ws.ping}ms\``;
}
} as ICommand;Last updated

