Skip to content

Commit 8bb1fc8

Browse files
committed
upgrade upload images to v2
1 parent 608185f commit 8bb1fc8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/nestjs-libraries/src/integrations/social/x.provider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ export class XProvider extends SocialAbstract implements SocialProvider {
319319
return {
320320
id: await this.runInConcurrent(
321321
async () =>
322-
client.v1.uploadMedia(
322+
client.v2.uploadMedia(
323323
m.path.indexOf('mp4') > -1
324324
? Buffer.from(await readOrFetch(m.path))
325325
: await sharp(await readOrFetch(m.path), {
@@ -331,7 +331,7 @@ export class XProvider extends SocialAbstract implements SocialProvider {
331331
.gif()
332332
.toBuffer(),
333333
{
334-
mimeType: lookup(m.path) || '',
334+
media_type: (lookup(m.path) || '') as any,
335335
}
336336
),
337337
true

0 commit comments

Comments
 (0)