2
0

init wiki

This commit is contained in:
Cedric Hoelzl 2019-10-15 21:54:46 +02:00
parent abff2aab6d
commit c44e376d9c
2 changed files with 19 additions and 1 deletions

View File

@ -33,7 +33,8 @@ module.exports = function(){
let txt = `*Definitions of ${res.word}:*\n\n`;
for(let r of res.definitions){
txt+= `*${r.speech}:*\n`;
let t = r.speech!=''?r.speech:"Other"
txt+= `*${t}:*\n`;
for(let l of r.lines){
txt+= ` - _${l.define}_\n\n`;
}

View File

@ -145,3 +145,20 @@ var wiki = function () {
module.exports = wiki;
return wiki('gay').then(res=>{
let txt = `*Definitions of ${res.word}:*\n\n`;
for(let r of res.definitions){
console.log(r)
let t = r.speech!=''?r.speech:"Other"
txt+= `*${r.speech}:*\n`;
for(let l of r.lines){
txt+= ` - _${l.define}_\n\n`;
}
txt += `\n`;
}
console.log(txt);
}).catch(err=>{
})