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";
|
const feed = "https://www.kernel.org/releases.json";
|
||||||
|
|
||||||
|
@ -9,18 +9,10 @@ module.exports = bot => {
|
||||||
active: true,
|
active: true,
|
||||||
clients: ["irc", "tg"],
|
clients: ["irc", "tg"],
|
||||||
f: e => {
|
f: e => {
|
||||||
https.get(feed, res => {
|
rp(feed).then(content => {
|
||||||
let content = "";
|
const releases = JSON.parse(content).releases;
|
||||||
res.on('data', chunk => content += chunk.toString());
|
e.reply(releases.map(entry => `[b]${entry.version}[/b] (${entry.moniker}${entry.iseol ? `, [i]EOL[/i]` : ""})`).join(", "));
|
||||||
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(", "));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user