mirror of
https://github.com/LBRYFoundation/lbry-wunderbot.git
synced 2025-09-03 12:30:16 +00:00
fix aliases
to use aliases youll need to create a alias.json in the folder with bot.js Example: ``` { "tests":"stats" } ```
This commit is contained in:
parent
ed08975c53
commit
298479ea9c
1 changed files with 5 additions and 2 deletions
|
@ -13,8 +13,11 @@ const supportbot = require('./modules/supportbot.js');
|
|||
|
||||
var aliases;
|
||||
try {
|
||||
aliases = require('./alias.json');
|
||||
aliases = require("./alias.json");
|
||||
console.log("aliases")
|
||||
console.log(aliases)
|
||||
} catch (e) {
|
||||
console.log("No aliases defined")
|
||||
//No aliases defined
|
||||
aliases = {
|
||||
test: {
|
||||
|
@ -76,7 +79,7 @@ function checkMessageForCommand(msg, isEdit) {
|
|||
}
|
||||
let alias = aliases[cmdTxt];
|
||||
if (alias) {
|
||||
var cmd = alias;
|
||||
var cmd = commands[alias];
|
||||
} else {
|
||||
var cmd = commands[cmdTxt];
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue