fix: use ctx.api.sendMessage instead of ctx.reply for streaming
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user