Merge pull request #146 from MSFTserver/patch-8

fix aliases
This commit is contained in:
filipnyquist 2018-07-13 11:18:23 +02:00 committed by GitHub
commit 5f9870e7e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,8 +13,9 @@ const supportbot = require('./modules/supportbot.js');
let aliases;
try {
aliases = require('./alias.json');
aliases = require("./alias.json");
} catch (e) {
console.log("No aliases defined")
//No aliases defined
aliases = {
test: {
@ -100,6 +101,7 @@ function checkMessageForCommand(msg, isEdit) {
return;
}
}
let cmd = aliases.hasOwnProperty(cmdTxt) ? commands[aliases[cmdTxt]] : commands[cmdTxt];
let alias = aliases[cmdTxt];
let cmd;
if (alias) {