init wiki
This commit is contained in:
parent
bbe47ce309
commit
55d79bda90
17
config.js
17
config.js
@ -31,14 +31,17 @@ 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){
|
||||||
for(let r of res.definitions){
|
txt+= "_No definition found_";
|
||||||
let t = r.speech!=''?r.speech:"Other"
|
}else{
|
||||||
txt+= `*${t}:*\n`;
|
for(let r of res.definitions){
|
||||||
for(let l of r.lines){
|
let t = r.speech!=''?r.speech:"Other"
|
||||||
txt+= `${l.define}\n\n`;
|
txt+= `*${t}:*\n`;
|
||||||
|
for(let l of r.lines){
|
||||||
|
txt+= `${l.define}\n\n`;
|
||||||
|
}
|
||||||
|
txt += `\n`;
|
||||||
}
|
}
|
||||||
txt += `\n`;
|
|
||||||
}
|
}
|
||||||
return event.replyWithMarkdown(txt);
|
return event.replyWithMarkdown(txt);
|
||||||
}).catch(err=>{
|
}).catch(err=>{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user