diff --git a/src/api/gramjs/apiBuilders/messages.ts b/src/api/gramjs/apiBuilders/messages.ts index f084b415..fa2ec54c 100644 --- a/src/api/gramjs/apiBuilders/messages.ts +++ b/src/api/gramjs/apiBuilders/messages.ts @@ -212,6 +212,10 @@ export function buildMessageDraft(draft: GramJs.TypeDraftMessage) { } export function buildMessageMediaContent(media: GramJs.TypeMessageMedia): ApiMessage['content'] | undefined { + if ('ttlSeconds' in media && media.ttlSeconds) { + return undefined; + } + const sticker = buildSticker(media); if (sticker) return { sticker }; @@ -278,10 +282,6 @@ function buildPhoto(media: GramJs.TypeMessageMedia): ApiPhoto | undefined { return undefined; } - if (media.ttlSeconds) { - return undefined; - } - return buildApiPhoto(media.photo); } @@ -405,10 +405,6 @@ function buildDocumentFromMedia(media: GramJs.TypeMessageMedia) { return undefined; } - if (media.ttlSeconds) { - return undefined; - } - return buildApiDocument(media.document); }