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,7 +31,9 @@ module.exports = function(){
return dic(message.text_arg).then(res=>{ return dic(message.text_arg).then(res=>{
let txt = `*Definitions of ${res.word}:*\n\n`; let txt = `*Definitions of ${res.word}:*\n\n`;
if(res.definitions.length ==0){
txt+= "_No definition found_";
}else{
for(let r of res.definitions){ for(let r of res.definitions){
let t = r.speech!=''?r.speech:"Other" let t = r.speech!=''?r.speech:"Other"
txt+= `*${t}:*\n`; txt+= `*${t}:*\n`;
@ -40,6 +42,7 @@ module.exports = function(){
} }
txt += `\n`; txt += `\n`;
} }
}
return event.replyWithMarkdown(txt); return event.replyWithMarkdown(txt);
}).catch(err=>{ }).catch(err=>{
bot.error(err); bot.error(err);