diff --git a/config.js b/config.js index ec225a4..dfa342c 100644 --- a/config.js +++ b/config.js @@ -72,6 +72,13 @@ function gen_kb(bot, p_en, parr,lang){ let bck = ""; let kb = []; let ntmr = tmr; + for(let k of Object.keys(ntmr)){ + if(p_en.indexOf(k.toString()) == -1){ + ntmr[k]=false; + continue; + } + + } for(let pp of parr){ try{ if(ntmr[pp].sub){ @@ -88,16 +95,13 @@ function gen_kb(bot, p_en, parr,lang){ } if(ntmr){ for(let k of Object.keys(ntmr)){ - if(p_en.indexOf(k.toString()) == -1){ - continue; - } let ctmr = ntmr[k]; if(ctmr.sub){ let str = ctmr.desc[lang]; kb.push(bot.mkcb(str,cbt.sel,k)); }else if(ctmr.tmr){ let str = ctmr.desc[lang]; - let c = arr.join("_") + "_" + k.toString(); + let c = parr.join("_") + "_" + k.toString(); kb.push(bot.mkcb(str,cbt.sel,c)); } @@ -115,6 +119,10 @@ function gen_kb(bot, p_en, parr,lang){ return kb; } +// let bot ={ +// mkcb:(x,y,z)=>{return y+"_"+z} +// } +// console.log(gen_kb(bot,["atrium"],["atrium"],0)) module.exports = function(arr){ this.arr = arr;