mirror of
https://github.com/misenhower/splatoon3.ink.git
synced 2026-09-14 19:45:44 -05:00
Convert image to JPEG and upload properly
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import sharp from "sharp";
|
||||
import threads from "threads-api";
|
||||
import Client from "./Client.mjs";
|
||||
|
||||
@@ -17,9 +18,11 @@ export default class ThreadsClient extends Client {
|
||||
}
|
||||
|
||||
async send(status, generator) {
|
||||
let jpeg = await sharp(status.media[0].file).jpeg().toBuffer();
|
||||
|
||||
await this.#api.publish({
|
||||
text: status.status,
|
||||
image: status.media[0].file,
|
||||
image: { type: "image/jpeg", data: jpeg },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user