Promises lul

This commit is contained in:
Flummi 2018-09-14 21:32:49 +02:00
parent 6624995377
commit f900ad6467

View File

@ -36,10 +36,15 @@ export default bot => {
fetch(apis.pr0gag.item + id.toString()),
id
])
.then(([list, item, id]) => [
list.json().items.filter(item => item.id === id)[0],
.then(([list, item, id]) => Promise.all([
list.json(),
item.json(),
id
]))
.then(([list, item, id]) => [
list.items.filter(item => item.id === id)[0],
item,
id
])
.then(([list, item, id]) => ({
created: list.created,