2
0

init wiki

This commit is contained in:
Cedric Hoelzl 2019-10-15 21:58:26 +02:00
parent bbe47ce309
commit 55d79bda90

View File

@ -31,14 +31,17 @@ module.exports = function(){
return dic(message.text_arg).then(res=>{
let txt = `*Definitions of ${res.word}:*\n\n`;
for(let r of res.definitions){
let t = r.speech!=''?r.speech:"Other"
txt+= `*${t}:*\n`;
for(let l of r.lines){
txt+= `${l.define}\n\n`;
if(res.definitions.length ==0){
txt+= "_No definition found_";
}else{
for(let r of res.definitions){
let t = r.speech!=''?r.speech:"Other"
txt+= `*${t}:*\n`;
for(let l of r.lines){
txt+= `${l.define}\n\n`;
}
txt += `\n`;
}
txt += `\n`;
}
return event.replyWithMarkdown(txt);
}).catch(err=>{