Command Handler working

This commit is contained in:
ahoZiorce
2018-07-01 22:15:42 +02:00
parent c6c9dbf1c5
commit fa000a6c37
5 changed files with 25 additions and 13 deletions

View File

@@ -7,7 +7,7 @@ exports.endpoint = function endpoint (match, handler) {
exports.apply = function apply (command, context) {
let keys = Object.keys(commands);
for (let i = 0; i < keys.length; i++) {
let match = command.match(keys[i]);
let match = command.match(new RegExp(keys[i]));
if (match) {
commands[keys[i]](match, context);
return true;