Get an array with all the commands of artyom.

This method allows you to retrieve all the loaded commands to artyom in the moment that is executed. It won't return the entire command but an array of objects with the following structure:

  • indexes : All the possibilities to activate the command
  • smart : if the command is smart
  • description: If the command has a description.

Example

Load a new command in case that it doesn't exists:

let artyom = new Artyom();

// Some code that adds commands

var commands = artyom.getAvailableCommands();

for(var i = 0;i < commands.length;i++){
    var command = comanddos[i];

    // If NOT exists a command triggered by hello, add it . 
    if(!command.indexOf("hello")){
        artyom.addCommands([
            {
                description:"Says hello to the user",
                indexes:["hello","whats up"],
                action:function(){
                    artyom.say("Hey what's your budget");
                }
            }
        ]);

        break;//Stop search in commands
    }
}

// Now we can say hello !