From 272cbcf18f204df78ccf82dc45b0d27ba4341693 Mon Sep 17 00:00:00 2001 From: gavrielc Date: Wed, 11 Mar 2026 12:06:28 +0200 Subject: [PATCH 1/2] fix: update sendMessage test expectations for Markdown parse_mode The sendTelegramMessage helper now passes { parse_mode: 'Markdown' } to bot.api.sendMessage, but three tests still expected only two args. Co-Authored-By: Claude Opus 4.6 --- src/channels/telegram.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/channels/telegram.test.ts b/src/channels/telegram.test.ts index 9a97223..564a20e 100644 --- a/src/channels/telegram.test.ts +++ b/src/channels/telegram.test.ts @@ -710,6 +710,7 @@ describe('TelegramChannel', () => { expect(currentBot().api.sendMessage).toHaveBeenCalledWith( '100200300', 'Hello', + { parse_mode: 'Markdown' }, ); }); @@ -723,6 +724,7 @@ describe('TelegramChannel', () => { expect(currentBot().api.sendMessage).toHaveBeenCalledWith( '-1001234567890', 'Group message', + { parse_mode: 'Markdown' }, ); }); @@ -739,11 +741,13 @@ describe('TelegramChannel', () => { 1, '100200300', 'x'.repeat(4096), + { parse_mode: 'Markdown' }, ); expect(currentBot().api.sendMessage).toHaveBeenNthCalledWith( 2, '100200300', 'x'.repeat(904), + { parse_mode: 'Markdown' }, ); }); From 845da49fa39fa27b4378b607e6c8f58e11f7af5c Mon Sep 17 00:00:00 2001 From: gavrielc Date: Wed, 11 Mar 2026 12:08:52 +0200 Subject: [PATCH 2/2] fix: prettier formatting for telegram.ts Pre-existing formatting issue that causes CI format check to fail. Co-Authored-By: Claude Opus 4.6 --- src/channels/telegram.ts | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/channels/telegram.ts b/src/channels/telegram.ts index c7d19e5..7b95924 100644 --- a/src/channels/telegram.ts +++ b/src/channels/telegram.ts @@ -117,8 +117,15 @@ export class TelegramChannel implements Channel { } // Store chat metadata for discovery - const isGroup = ctx.chat.type === 'group' || ctx.chat.type === 'supergroup'; - this.opts.onChatMetadata(chatJid, timestamp, chatName, 'telegram', isGroup); + const isGroup = + ctx.chat.type === 'group' || ctx.chat.type === 'supergroup'; + this.opts.onChatMetadata( + chatJid, + timestamp, + chatName, + 'telegram', + isGroup, + ); // Only deliver full message for registered groups const group = this.opts.registeredGroups()[chatJid]; @@ -161,8 +168,15 @@ export class TelegramChannel implements Channel { 'Unknown'; const caption = ctx.message.caption ? ` ${ctx.message.caption}` : ''; - const isGroup = ctx.chat.type === 'group' || ctx.chat.type === 'supergroup'; - this.opts.onChatMetadata(chatJid, timestamp, undefined, 'telegram', isGroup); + const isGroup = + ctx.chat.type === 'group' || ctx.chat.type === 'supergroup'; + this.opts.onChatMetadata( + chatJid, + timestamp, + undefined, + 'telegram', + isGroup, + ); this.opts.onMessage(chatJid, { id: ctx.message.message_id.toString(), chat_jid: chatJid, @@ -176,9 +190,7 @@ export class TelegramChannel implements Channel { this.bot.on('message:photo', (ctx) => storeNonText(ctx, '[Photo]')); this.bot.on('message:video', (ctx) => storeNonText(ctx, '[Video]')); - this.bot.on('message:voice', (ctx) => - storeNonText(ctx, '[Voice message]'), - ); + this.bot.on('message:voice', (ctx) => storeNonText(ctx, '[Voice message]')); this.bot.on('message:audio', (ctx) => storeNonText(ctx, '[Audio]')); this.bot.on('message:document', (ctx) => { const name = ctx.message.document?.file_name || 'file';