|
|
@ -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);
|
|
|
|
let suggestions = "";
|
|
|
|
if(tmp !== null){ //when the regex matches nothing
|
|
|
|
for(let i = 0; i < tmp.length; i++){
|
|
|
|
let suggestions = "";
|
|
|
|
suggestions += "\n"+tmp[i];
|
|
|
|
for(let i = 0; i < tmp.length; i++){
|
|
|
|
|
|
|
|
suggestions += "\n"+tmp[i];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
matrixClient.sendNotice(room.roomId, 'Unrecognized command.\n' +
|
|
|
|
|
|
|
|
'Did you mean:'+suggestions);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
matrixClient.sendNotice(room.roomId, 'Unrecognized command.\n' +
|
|
|
|
|
|
|
|
'Did you mean:'+suggestions);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|