Closed Karrq closed 4 years ago
I think It's tdlib data questions. You see that json data.
{"@type":"messages","total_count":1,"messages":[null]}
"messages":[null]
the messages is Vec<null>
and the rtdlib it's Optional<Vec<Message>>
pub struct Messages {
#[doc(hidden)]
#[serde(rename(serialize = "@type", deserialize = "@type"))]
td_name: String,
/// Approximate total count of messages found
total_count: i64,
/// List of messages; messages may be null
messages: Option<Vec<Message>>,
}
According to the annotation type provided by tdlibjson (List of messages; messages may be null
), it should be Option<Vec<Message>>
, not Vec<Option<Message>>
But now the returned data is [null]
, then rtdlib will be updated in the near future to fix this issue.
Hi @Karrq the reference commit fix this bug, If you have any question, please ping me. you need change dependence to last version.
Hi, I was messing around and I tried to retrieve from the api a message that was just deleted.
Basically I registered the handler for
on_update_delete_messages
to emit a log and callapi.get_messages
with the chat_id and the message_ids that were in the update.I also register a handler for
on_messages
to read the messages received there but it is not called when I'm trying to get a deleted message.Here's the log (which is why I'm opening the issue)