pr0gag parser
This commit is contained in:
parent
179936f493
commit
04f4f36a5e
@ -10,7 +10,8 @@ import EventEmitter from "events";
|
|||||||
const colors = {
|
const colors = {
|
||||||
red: "\x0304$1\x0304",
|
red: "\x0304$1\x0304",
|
||||||
blue: "\x0312$1\x0312",
|
blue: "\x0312$1\x0312",
|
||||||
yellow: "\x0308$1\x0308"
|
yellow: "\x0308$1\x0308",
|
||||||
|
green: "\x0303$1\x0303"
|
||||||
};
|
};
|
||||||
const msgmodes = {
|
const msgmodes = {
|
||||||
normal: "PRIVMSG {recipient} :{msg}",
|
normal: "PRIVMSG {recipient} :{msg}",
|
||||||
|
@ -45,25 +45,33 @@ export default bot => {
|
|||||||
down: list.down,
|
down: list.down,
|
||||||
score: list.up - list.down,
|
score: list.up - list.down,
|
||||||
ratio: (list.up / (list.up + list.down)).toFixed(2),
|
ratio: (list.up / (list.up + list.down)).toFixed(2),
|
||||||
flags: flags[list.flags],
|
flag: flags[list.flags],
|
||||||
user: list.user,
|
user: list.user,
|
||||||
comments: item.comments.length,
|
comments: item.comments.length,
|
||||||
toptags: item.tags.splice(0, 3).map(tag => tag.tag),
|
toptags: item.tags.splice(0, 3).map(tag => tag.tag),
|
||||||
link: site + id.toString()
|
link: site + id.toString()
|
||||||
}))
|
}))
|
||||||
.then(meta => [
|
.then(meta => [
|
||||||
|
meta.link,
|
||||||
|
`${meta.score} ([color=green]${meta.up}[/color] / [color=red]${meta.down}[/color])`,
|
||||||
|
`user: ${meta.user}`,
|
||||||
|
`comments: ${meta.comments}`,
|
||||||
|
`toptags: ${meta.toptags.join(", ")} (${meta.flag})`
|
||||||
|
])
|
||||||
|
.then(out => e.reply(out.join(" - ")))
|
||||||
|
/*.then(meta => [
|
||||||
`c: ${meta.created}`,
|
`c: ${meta.created}`,
|
||||||
`u: ${meta.up}`,
|
`u: ${meta.up}`,
|
||||||
`d: ${meta.down}`,
|
`d: ${meta.down}`,
|
||||||
`s: ${meta.score}`,
|
`s: ${meta.score}`,
|
||||||
`r: ${meta.ratio}`,
|
`r: ${meta.ratio}`,
|
||||||
`f: ${meta.flags}`,
|
`f: ${meta.flag}`,
|
||||||
`u: ${meta.user}`,
|
`u: ${meta.user}`,
|
||||||
`co: ${meta.comments}`,
|
`co: ${meta.comments}`,
|
||||||
`t: ${meta.toptags}`,
|
`t: ${meta.toptags}`,
|
||||||
`l: ${meta.link}`
|
`l: ${meta.link}`
|
||||||
].join("; "))
|
].join("; "))
|
||||||
.then(out => e.reply(out))
|
.then(out => e.reply(out))*/
|
||||||
).catch(err => e.reply(err));
|
).catch(err => e.reply(err));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
Loading…
Reference in New Issue
Block a user