fix: use cached chatId and messageId for editMessageText

This commit is contained in:
admin
2026-05-05 13:43:49 +00:00
Unverified
parent 494596c0a9
commit 429b8a1633

View File

@@ -57,9 +57,11 @@ export async function sendStreamingMessage(ctx, text, options = {}) {
// Send initial placeholder message
const sentMsg = await ctx.reply('⌨️ ⌨️', { parse_mode: 'Markdown' });
logger.info('📡 Initial message sent:', sentMsg.message_id);
logger.info('📡 Initial message sent:', sentMsg.message_id, 'chat:', sentMsg.chat.id);
let sentText = '';
const chatId = sentMsg.chat.id;
const messageId = sentMsg.message_id;
if (charMode) {
// Character-by-character streaming
@@ -71,8 +73,8 @@ export async function sendStreamingMessage(ctx, text, options = {}) {
try {
await ctx.api.editMessageText(sentText, {
message_id: sentMsg.message_id,
chat_id: sentMsg.chat.id,
chat_id: chatId,
message_id: messageId,
parse_mode: 'Markdown'
});
} catch (editErr) {
@@ -92,8 +94,8 @@ export async function sendStreamingMessage(ctx, text, options = {}) {
try {
await ctx.api.editMessageText(sentText, {
message_id: sentMsg.message_id,
chat_id: sentMsg.chat.id,
chat_id: chatId,
message_id: messageId,
parse_mode: 'Markdown'
});
} catch (editErr) {