This commit is contained in:
Flummi 2018-08-30 18:36:54 +02:00
parent 302cb8ffe4
commit 6f92f401b2

View File

@ -19,13 +19,16 @@ const site = "https://pr0gramm.com/new/";
export default bot => { export default bot => {
bot._trigger.set("pr0gag", new bot.trigger({ bot._trigger.set("pr0gag", new bot.trigger({
call: /img\.programm\.com.*/i, call: /img\.pr0gramm\.com.*/i,
set: "uwe", set: "uwe",
f: e => { f: e => {
const link = e.message.match(regex)[0]; const link = "https://"+e.message.match(regex)[0];
const tmp = url.parse(link).path.substr(1); const tmp = url.parse(link).path.substr(1);
rp(apis.reverse + tmp) rp(apis.reverse + tmp)
.then(res => JSON.parse(res).id) .then(res => {
console.log(res);
return JSON.parse(res).id;
})
.then(id => Promise.all([ .then(id => Promise.all([
rp(apis.pr0gag.list + id.toString()), rp(apis.pr0gag.list + id.toString()),
rp(apis.pr0gag.item + id.toString()), rp(apis.pr0gag.item + id.toString()),