fixing
This commit is contained in:
parent
ce6f9d28e3
commit
080e625066
12
config.js
12
config.js
@ -10,15 +10,17 @@ const Extra = require('telegraf/extra');
|
||||
//=== TOOL FUNCTIONS
|
||||
|
||||
function get_echo_obj(cmd,ans){
|
||||
this.ans = ans;
|
||||
this.cmd = cmd;
|
||||
return {
|
||||
trigger : cmd,
|
||||
trigger : this.cmd,
|
||||
requirements : (bot,event,message)=>{
|
||||
return new Promise((resolve, reject)=>{
|
||||
return resolve({error:false});
|
||||
});
|
||||
},
|
||||
action : (bot,event,message)=>{
|
||||
return event.reply(ans);
|
||||
return event.reply(this.ans);
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -50,11 +52,11 @@ module.exports = function(echo_list,regex_list){
|
||||
|
||||
for(var i in echo_list){
|
||||
var element = echo_list[i];
|
||||
echoobj.text.push[get_echo_obj(element.cmd,element.ans)]
|
||||
echoobj.text.push[new get_echo_obj(element.cmd,element.ans)]
|
||||
}
|
||||
for(var i in regex_list){
|
||||
var element = echo_list[i];
|
||||
echoobj.regex.push[get_echo_obj(element.cmd,element.ans)];
|
||||
var element = regex_list[i];
|
||||
echoobj.regex.push[new get_echo_obj(element.cmd,element.ans)];
|
||||
}
|
||||
|
||||
return echoobj;
|
||||
|
Loading…
x
Reference in New Issue
Block a user