getAvailableCommands
获取当前 artyom 中所有的命令
例子
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 !Last updated
Was this helpful?