FAXES Documentation > Overflow Bot > Adding Commands

Adding Commands

FAXES

Adding commands to OverflowBot is easy as ever. Below you can find an example command file and the download for it the displayed file.

Once you have made your command you can add it to the commands folder. If you're adding it into the extensions folder ensure the file name starts with cmd_.

const Discord = require("discord.js");
const config = require("./../config.json");
const fs = require("fs");
const ms = require("ms");

module.exports.run = async (bot, message, args, connection) => {
    message.channel.send('test message here...').then(msg => { // Send the message to the channel the command is entered in.
        msg.delete({timeout: 5000}) // Then delete the message after 5000ms (5 secs).
    });
};

module.exports.help = {
    name: "test", // The primary command name.
    name2: "longertest", // The secondary command name. Optional.
    category: 2, // The category for the command. See the below links.
    perm: 4, // Permission level needed to use the command. See the below links.
    description: "My test command.", // The command description. This is used in the help command.
    whitelistedChannels: [], // A string array of channels IDs to whitelist this command to only execute in.
    blacklistedChannels: [] // A string array of channels IDs to blacklist this command from executing in.
}

Categories: https://docs.faxes.zone/c/overflow/commandtypes

Permissions: https://docs.faxes.zone/c/overflow/customperms