fix: use ctx.api.sendMessage instead of ctx.reply for streaming

This commit is contained in:
admin
2026-05-05 13:45:45 +00:00
Unverified
parent f8a6edf4c7
commit e839f513de

View File

@@ -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;