Creating Custom Commands

Tutorial on how to create custom commands for Osiris

Making your own commands

To create your own Osiris commands, you need to:

  • Go to the commands folder

  • Create a new file with the name of your command (Or whatever you want to name it)

  • Create your command using the following template:

function execute (XSessionToken, data, sharedObj) {

    // Your code here

}

module.exports = {
    name: "command name",
    description: "command description",
    native: false, // This currently has no use but will be used to easily identify custom commands in the future so just leave it as false
    category: "category", // This is used to group commands together there will be a list of categories in the future
    usage: "command usage", // This is used to show how to use the command in the help command (Might be removed later, just make it the same as the name)
    arguments: []
    /*

        There are 3 types of arguments:
        STRING
        NUMBER
        USER, USER_MENTION, MENTION (All of these are the same thing, oh well)

        To add an argument, just add it to the array like this:
        arguments: [
            {
                name: "A person",
                type: "USER"
            },
            {
                name: "A number",
                type: "NUMBER"
            },
            {
                name: "A string",
                type: "STRING"
            }
        ]


    */
    execute,
};

Last updated