debug: add logging for edit_message to diagnose 'Message not found' error
- Log chat_id, message_id, text length before calling edit_message_text - Log success or exact TDLib error - This will help identify the root cause Temporary debug commit to investigate issue.
This commit is contained in:
@@ -320,16 +320,24 @@ impl MessageManager {
|
|||||||
clear_draft: true,
|
clear_draft: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
eprintln!("[EDIT] Calling edit_message_text: chat_id={}, message_id={}, text_len={}",
|
||||||
|
chat_id.as_i64(), message_id.as_i64(), text.len());
|
||||||
|
|
||||||
let result =
|
let result =
|
||||||
functions::edit_message_text(chat_id.as_i64(), message_id.as_i64(), content, self.client_id).await;
|
functions::edit_message_text(chat_id.as_i64(), message_id.as_i64(), content, self.client_id).await;
|
||||||
|
|
||||||
match result {
|
match result {
|
||||||
Ok(tdlib_rs::enums::Message::Message(msg)) => self
|
Ok(tdlib_rs::enums::Message::Message(msg)) => {
|
||||||
.convert_message(&msg)
|
eprintln!("[EDIT] Success! Edited message ID: {}", msg.id);
|
||||||
.await
|
self.convert_message(&msg)
|
||||||
.ok_or_else(|| "Не удалось конвертировать отредактированное сообщение".to_string()),
|
.await
|
||||||
|
.ok_or_else(|| "Не удалось конвертировать отредактированное сообщение".to_string())
|
||||||
|
}
|
||||||
Ok(_) => Err("Неожиданный тип сообщения".to_string()),
|
Ok(_) => Err("Неожиданный тип сообщения".to_string()),
|
||||||
Err(e) => Err(format!("Ошибка редактирования: {:?}", e)),
|
Err(e) => {
|
||||||
|
eprintln!("[EDIT] Error from TDLib: {:?}", e);
|
||||||
|
Err(format!("Ошибка редактирования: {:?}", e))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user