Skip to content

Latest commit

 

History

History
31 lines (27 loc) · 700 Bytes

messageCommands.md

File metadata and controls

31 lines (27 loc) · 700 Bytes

MessageCommands (With Aliases)

Format

import { MessageCommand } from "../types.js";

export const MsgCommand: MessageCommand = {
    name: "commandName",
    // Other Command Options
    aliases: ["commandName2", "commandName3"], // Optional to be provided.
    run: async(client, message, args): Promise<void> => {
        // Code Here
    }
};

Example Code

import { MessageCommand } from "../types.js";

export const MsgCommand: MessageCommand = {
    name: "ping",
    // Other Command Options
    aliases: ["pong"],
    run: (client, message, args): void => {
        message.channel.send({
            content: `My ping is ${client.ws.ping}ms.`
        });
    }
};