fix
This commit is contained in:
parent
ce40596ecc
commit
2d46490da5
39
config.js
39
config.js
@ -28,26 +28,29 @@ module.exports = function(){
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
action : (bot,event,message)=>{
|
action : (bot,event,message)=>{
|
||||||
|
if(message.text_args){
|
||||||
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){
|
if(res.definitions.length ==0){
|
||||||
txt+= "_No definition found_";
|
txt+= "_No definition found_";
|
||||||
}else{
|
}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`;
|
||||||
for(let l of r.lines){
|
for(let l of r.lines){
|
||||||
txt+= `${l.define}\n\n`;
|
txt+= `${l.define}\n\n`;
|
||||||
|
}
|
||||||
|
txt += `\n`;
|
||||||
}
|
}
|
||||||
txt += `\n`;
|
|
||||||
}
|
}
|
||||||
}
|
return event.replyWithMarkdown(txt);
|
||||||
return event.replyWithMarkdown(txt);
|
}).catch(err=>{
|
||||||
}).catch(err=>{
|
//bot.error(err);
|
||||||
//bot.error(err);
|
return event.reply("No word in dictionary");
|
||||||
return event.reply("No word in dictionary");
|
})
|
||||||
})
|
}else{
|
||||||
|
return event.reply("No word give");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user