|
|
@ -50,13 +50,14 @@ matrixClient.on('Room.timeline', function(event, room, resetTimeline) {
|
|
|
|
subcommand.exec(args, room, event);
|
|
|
|
subcommand.exec(args, room, event);
|
|
|
|
}, (fail) => { // command not found
|
|
|
|
}, (fail) => { // command not found
|
|
|
|
let tmp = commands.suggestFix(body, commands.projects);
|
|
|
|
let tmp = commands.suggestFix(body, commands.projects);
|
|
|
|
|
|
|
|
if(tmp !== null){ //when the regex matches nothing
|
|
|
|
let suggestions = "";
|
|
|
|
let suggestions = "";
|
|
|
|
for(let i = 0; i < tmp.length; i++){
|
|
|
|
for(let i = 0; i < tmp.length; i++){
|
|
|
|
suggestions += "\n"+tmp[i];
|
|
|
|
suggestions += "\n"+tmp[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
matrixClient.sendNotice(room.roomId, 'Unrecognized command.\n' +
|
|
|
|
matrixClient.sendNotice(room.roomId, 'Unrecognized command.\n' +
|
|
|
|
'Did you mean:'+suggestions);
|
|
|
|
'Did you mean:'+suggestions);
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|