Skip to content
This repository has been archived by the owner on Jan 28, 2024. It is now read-only.

How to command

Elias Schaut edited this page Dec 21, 2021 · 9 revisions

Add a command

  1. Create a new JS file named <command name>.js inside a folder in the folder commands.
    Note: Every command has to be in a folder in the folder commands. A command, which is directly in the folder commands or in a folder in a folder in commands is not allowed! But you can create own folders in commands.
  2. Fill the newly created JS file with the command skeleton
  3. Set the command modifications and write your execution code.

Command Skeleton

const { get_text: gt } = require("../../lang/lang_helper")
const s = "commands.<name>."

module.exports = {
    name: '<name>',
    description: async function (msg) { return await gt(msg, s + "help") },
    aliases: ['<alias_1>', '<alias_2>'],
    args_needed: false,
    args_min_length: 0,
    args_max_length: 0,
    usage: async function (msg) { return await gt(msg, s + "usage") },
    guild_only: false,
    dm_only: false,
    need_permission: ['<permission1>', '<permission2>'],
    admin_only: false,
    nsfw: false,
    disabled: false,
    enable_slash: false,
    async execute(msg, args) {  // msg = discord.js 'Message' object; args = given arguments as list
        // your lovely code to execute
    },
};
Clone this wiki locally