Ping Command

Ping Command Tutorial (even though it already exists in the source, just for an example!)

To create our ping command, we will create a file in the commands folder called "ping.js" and we will paste the template into our file.

Coding the ping command

To make the ping command, we need to use the sendMessage function.. And that's about it

Here's an example:

const { osiris } = require("../../api/osiris.js");

function execute(XSessionToken, data, sharedObj) {
  const Channel = data.ChannelId;
  
  osiris.sendMessage(XSessionToken, Channel, `Pong! :ping_pong:`).then((message) => {
    console.log("[REVOLT]: SENT 'PONG'!");
  });
}

module.exports = {
  name: "ping",
  description: "A simple ping command we're using for this example.",
  native: true,
  category: "fun",
  usage: "ping",
  arguments: [],
  execute,
};

Last updated