From 817203a9e1977489cf32ba1fedcb16485547d419 Mon Sep 17 00:00:00 2001 From: Mar0xy Date: Mon, 25 Sep 2023 19:43:59 +0200 Subject: [PATCH] fix: fileid min length issue --- packages/megalodon/src/misskey.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/megalodon/src/misskey.ts b/packages/megalodon/src/misskey.ts index 6024f2bf9..9807f0cc7 100644 --- a/packages/megalodon/src/misskey.ts +++ b/packages/megalodon/src/misskey.ts @@ -1145,7 +1145,7 @@ export default class Misskey implements MegalodonInterface { status?: string spoiler_text?: string sensitive?: boolean - media_ids?: Array + media_ids?: Array | null poll?: { options?: Array; expires_in?: number; multiple?: boolean; hide_totals?: boolean } visibility?: "public" | "unlisted" | "private" | "direct" } @@ -1155,10 +1155,12 @@ export default class Misskey implements MegalodonInterface { text: _options.status } if (_options) { - if (_options.media_ids) { + if (_options.media_ids && _options.media_ids.length > 0) { params = Object.assign(params, { fileIds: _options.media_ids }) + } else { + _options.media_ids = null; } if (_options.poll) { let pollParam = {