mirror of
https://github.com/misenhower/splatoon3.ink.git
synced 2026-04-25 07:18:35 -05:00
Convert image to JPEG and upload properly
This commit is contained in:
parent
c17c7545b5
commit
bccf0f63e3
|
|
@ -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 },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user