From 3cb14cf81af82216ac4e4cc2f5d43b4a438d8b3f Mon Sep 17 00:00:00 2001 From: Muhammed Mukhthar CM Date: Mon, 26 Jan 2026 06:55:21 +0000 Subject: [PATCH] telegram-user: align capabilities and media limits --- extensions/telegram-user/src/channel.ts | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/extensions/telegram-user/src/channel.ts b/extensions/telegram-user/src/channel.ts index 0aa2094ac..161f6fae0 100644 --- a/extensions/telegram-user/src/channel.ts +++ b/extensions/telegram-user/src/channel.ts @@ -7,6 +7,7 @@ import { deleteAccountFromConfigSection, formatPairingApproveHint, normalizeAccountId, + resolveChannelMediaMaxBytes, setAccountEnabledInConfigSection, type ChannelGroupContext, type ChannelPlugin, @@ -101,10 +102,10 @@ export const telegramUserPlugin: ChannelPlugin = { }, }, capabilities: { - chatTypes: ["direct", "group"], + chatTypes: ["direct", "group", "thread"], polls: true, - reactions: false, - threads: false, + reactions: true, + threads: true, media: true, nativeCommands: false, blockStreaming: true, @@ -236,11 +237,21 @@ export const telegramUserPlugin: ChannelPlugin = { }); return { channel: "telegram-user", ...result }; }, - sendMedia: async ({ to, text, mediaUrl, accountId, threadId }) => { + sendMedia: async ({ cfg, to, text, mediaUrl, accountId, threadId }) => { + const maxBytes = resolveChannelMediaMaxBytes({ + cfg, + resolveChannelLimitMb: ({ cfg, accountId }) => + resolveTelegramUserAccount({ + cfg: cfg as CoreConfig, + accountId, + }).config.mediaMaxMb, + accountId, + }); const result = await sendMediaTelegramUser(to, text, { accountId: accountId ?? undefined, mediaUrl, threadId, + ...(maxBytes ? { maxBytes } : {}), }); return { channel: "telegram-user", ...result }; },