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)=>{
|
||||
|
||||
return dic(message.text_arg).then(res=>{
|
||||
let txt = `*Definitions of ${res.word}:*\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`;
|
||||
if(message.text_args){
|
||||
return dic(message.text_arg).then(res=>{
|
||||
let txt = `*Definitions of ${res.word}:*\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=>{
|
||||
//bot.error(err);
|
||||
return event.reply("No word in dictionary");
|
||||
})
|
||||
return event.replyWithMarkdown(txt);
|
||||
}).catch(err=>{
|
||||
//bot.error(err);
|
||||
return event.reply("No word in dictionary");
|
||||
})
|
||||
}else{
|
||||
return event.reply("No word give");
|
||||
}
|
||||
}
|
||||
},
|
||||
],
|
||||
|
Loading…
x
Reference in New Issue
Block a user