Coded
This commit is contained in:
parent
bcb5a955ad
commit
475a790b51
19
config.js
19
config.js
@ -67,7 +67,7 @@ const cbt = {
|
|||||||
sel:"s",
|
sel:"s",
|
||||||
}
|
}
|
||||||
|
|
||||||
function gen_kb(bot, parr,lang){
|
function gen_kb(bot, p_en, parr,lang){
|
||||||
let bck_nxt = "";
|
let bck_nxt = "";
|
||||||
let bck = "";
|
let bck = "";
|
||||||
let kb = [];
|
let kb = [];
|
||||||
@ -88,6 +88,9 @@ function gen_kb(bot, parr,lang){
|
|||||||
}
|
}
|
||||||
if(ntmr){
|
if(ntmr){
|
||||||
for(let k of Object.keys(ntmr)){
|
for(let k of Object.keys(ntmr)){
|
||||||
|
if(p_en.indexOf(k.toString()) == -1){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
let ctmr = ntmr[k];
|
let ctmr = ntmr[k];
|
||||||
if(ctmr.sub){
|
if(ctmr.sub){
|
||||||
let str = ctmr.desc[lang];
|
let str = ctmr.desc[lang];
|
||||||
@ -107,15 +110,11 @@ function gen_kb(bot, parr,lang){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(parr.length > 0)
|
||||||
kb.push(bot.mkcb("Back",cbt.sel,bck));
|
kb.push(bot.mkcb("Back",cbt.sel,bck));
|
||||||
return kb;
|
return kb;
|
||||||
}
|
}
|
||||||
|
|
||||||
let bot ={
|
|
||||||
mkcb(x,y,z)=>{return y+"_"+z};
|
|
||||||
}
|
|
||||||
console.log(gen_kb(bot,["atrium","basic"],0))
|
|
||||||
|
|
||||||
module.exports = function(arr){
|
module.exports = function(arr){
|
||||||
this.arr = arr;
|
this.arr = arr;
|
||||||
@ -142,7 +141,7 @@ module.exports = function(arr){
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
action : (bot,event,message)=>{
|
action : (bot,event,message)=>{
|
||||||
var kb = gen_kb(bot,this.arr,event.master.lang);
|
var kb = gen_kb(bot,this.arr,[],event.master.lang);
|
||||||
|
|
||||||
return event.reply("Select An Option", {"reply_markup":Markup.inlineKeyboard(kb),"parse_mode":"Markdown"});
|
return event.reply("Select An Option", {"reply_markup":Markup.inlineKeyboard(kb),"parse_mode":"Markdown"});
|
||||||
}
|
}
|
||||||
@ -160,11 +159,11 @@ module.exports = function(arr){
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
action : (bot,event,data)=>{
|
action : (bot,event,data)=>{
|
||||||
let arr = this.arr;
|
let arr = [];
|
||||||
|
|
||||||
if(data != "") arr = data.split("_");
|
if(data != "") arr = data.split("_");
|
||||||
|
|
||||||
let kb = gen_kb(bot,arr,event.master.lang);
|
let kb = gen_kb(bot,this.arr,arr,event.master.lang);
|
||||||
|
|
||||||
return event.editMessageText("Select An Option", {"reply_markup":Markup.inlineKeyboard(kb),"parse_mode":"Markdown"});
|
return event.editMessageText("Select An Option", {"reply_markup":Markup.inlineKeyboard(kb),"parse_mode":"Markdown"});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user