diff --git a/src/bot/message-sender.js b/src/bot/message-sender.js index 627c4cba..1f6b876e 100644 --- a/src/bot/message-sender.js +++ b/src/bot/message-sender.js @@ -55,13 +55,13 @@ export async function sendStreamingMessage(ctx, text, options = {}) { try { logger.info('📡 Starting streaming for message of length:', text.length); - // Send initial placeholder message - const sentMsg = await ctx.reply('⌨️ ⌨️', { parse_mode: 'Markdown' }); - logger.info('📡 Initial message sent:', JSON.stringify({ - message_id: sentMsg?.message_id, - chat_id: sentMsg?.chat?.id, - full_obj: Object.keys(sentMsg || {}) - })); + // Send initial placeholder message using ctx.api.sendMessage directly + const sentMsg = await ctx.api.sendMessage(ctx.chat.id, '⌨️ ⌨️', { parse_mode: 'Markdown' }); + + logger.info('📡 Reply response type:', typeof sentMsg); + logger.info('📡 Reply response keys:', sentMsg ? Object.keys(sentMsg) : 'null'); + logger.info('📡 Message ID:', sentMsg?.message_id); + logger.info('📡 Chat ID:', sentMsg?.chat?.id); // Extract IDs safely const messageId = sentMsg?.message_id;