grammers
grammers copied to clipboard
Refetch message and mutate it
/// Refetch this message, mutating all of its properties in-place.
///
/// No changes will be made to the message if it fails to be fetched.
///
/// Shorthand for `Client::get_messages_by_id`.
pub async fn refetch(&self) -> Result<(), InvocationError> {
// When fetching a single message, if it fails, Telegram should respond with RPC error.
// If it succeeds we will have the single message present which we can unwrap.
self.client
.get_messages_by_id(&self.chat(), &[self.raw.id])
.await?
.pop()
.unwrap()
.unwrap();
todo!("actually mutate self after get_messages_by_id returns `Message`")
}
Why hasn't the message mutation been done here ?
It hasn't been implemented fully. Maybe returning the Message is better / more obvious.
It hasn't been implemented fully. Maybe returning the
Messageis better / more obvious.
yeah, returning the new mesage here is good.