reverting to older fix
This commit is contained in:
parent
3df9bd1c25
commit
cd186631d0
9
bot.js
9
bot.js
@ -68,22 +68,15 @@ async function postFeed() {
|
|||||||
);
|
);
|
||||||
await download_image(metadata.image, path);
|
await download_image(metadata.image, path);
|
||||||
|
|
||||||
let rstream = fs.createReadStream(path);
|
|
||||||
rstream.on("open", async (fd) => {
|
|
||||||
let mediaup = await M.post("media", {
|
let mediaup = await M.post("media", {
|
||||||
file: rstream,
|
file: fs.createReadStream(path),
|
||||||
});
|
});
|
||||||
|
|
||||||
await M.post("statuses", {
|
await M.post("statuses", {
|
||||||
status: `${item.title}\n\n#NeoVibe #${process.env.POST_HASHTAG}\n\n${item.link}`,
|
status: `${item.title}\n\n#NeoVibe #${process.env.POST_HASHTAG}\n\n${item.link}`,
|
||||||
media_ids: [mediaup.data.id],
|
media_ids: [mediaup.data.id],
|
||||||
});
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
|
||||||
rstream.on("error", (err) => {
|
|
||||||
// error on the stream
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user