keks
This commit is contained in:
parent
d7abf6a5b2
commit
4af52d6609
|
@ -1,4 +1,4 @@
|
|||
const https = require("https");
|
||||
const rp = require("request-promise");
|
||||
|
||||
const feed = "https://www.kernel.org/releases.json";
|
||||
|
||||
|
@ -9,18 +9,10 @@ module.exports = bot => {
|
|||
active: true,
|
||||
clients: ["irc", "tg"],
|
||||
f: e => {
|
||||
https.get(feed, res => {
|
||||
let content = "";
|
||||
res.on('data', chunk => content += chunk.toString());
|
||||
res.on('end', () => {
|
||||
const releases = JSON.parse(content).releases;
|
||||
const out = [];
|
||||
for (let entry in releases)
|
||||
out.push(`[b]${releases[entry].version}[/b] (${releases[entry].moniker}${releases[entry].iseol ? `, [i]EOL[/i]` : ""})`);
|
||||
e.reply(out.join(", "));
|
||||
});
|
||||
rp(feed).then(content => {
|
||||
const releases = JSON.parse(content).releases;
|
||||
e.reply(releases.map(entry => `[b]${entry.version}[/b] (${entry.moniker}${entry.iseol ? `, [i]EOL[/i]` : ""})`).join(", "));
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user