pub struct IncomingMessage {
pub raw: Message,
}Expand description
A new or edited message.
Fields§
§raw: MessageThe underlying TL message object.
Implementations§
Source§impl IncomingMessage
impl IncomingMessage
Sourcepub fn sender_id(&self) -> Option<&Peer>
pub fn sender_id(&self) -> Option<&Peer>
The sender peer, if available (not set for anonymous channel posts).
Sourcepub fn edit_date(&self) -> Option<i32>
pub fn edit_date(&self) -> Option<i32>
Unix timestamp of the last edit, if the message has been edited.
Sourcepub fn forward_count(&self) -> Option<i32>
pub fn forward_count(&self) -> Option<i32>
Number of times the message has been forwarded (channels only).
Sourcepub fn view_count(&self) -> Option<i32>
pub fn view_count(&self) -> Option<i32>
View count for channel posts.
Sourcepub fn reply_count(&self) -> Option<i32>
pub fn reply_count(&self) -> Option<i32>
Reply count (number of replies in a thread).
Sourcepub fn reply_to_message_id(&self) -> Option<i32>
pub fn reply_to_message_id(&self) -> Option<i32>
ID of the message this one is replying to.
Sourcepub async fn reply_to_message(
&self,
client: &Client,
) -> Result<Option<IncomingMessage>, Error>
pub async fn reply_to_message( &self, client: &Client, ) -> Result<Option<IncomingMessage>, Error>
Fetch the message that this one is replying to.
Returns None if this message is not a reply or if the peer is unknown.
Unlike reply_to_message_id this actually performs an API call to
retrieve the full message object.
Sourcepub fn date_utc(&self) -> Option<DateTime<Utc>>
pub fn date_utc(&self) -> Option<DateTime<Utc>>
The message’s send time as a chrono::DateTime<chrono::Utc>.
This is a typed wrapper around the raw date() Unix timestamp.
Sourcepub fn edit_date_utc(&self) -> Option<DateTime<Utc>>
pub fn edit_date_utc(&self) -> Option<DateTime<Utc>>
The last edit time as a chrono::DateTime<chrono::Utc>, if edited.
Sourcepub fn media(&self) -> Option<&MessageMedia>
pub fn media(&self) -> Option<&MessageMedia>
The media attached to this message, if any.
Sourcepub fn entities(&self) -> Option<&Vec<MessageEntity>>
pub fn entities(&self) -> Option<&Vec<MessageEntity>>
Formatting entities (bold, italic, code, links, etc).
Sourcepub fn grouped_id(&self) -> Option<i64>
pub fn grouped_id(&self) -> Option<i64>
Group ID for album messages (multiple media in one).
Sourcepub fn reply_markup(&self) -> Option<&ReplyMarkup>
pub fn reply_markup(&self) -> Option<&ReplyMarkup>
Reply markup (inline keyboards, etc).
Sourcepub fn forward_header(&self) -> Option<&MessageFwdHeader>
pub fn forward_header(&self) -> Option<&MessageFwdHeader>
Forward info header, if this message was forwarded.
Sourcepub fn noforwards(&self) -> bool
pub fn noforwards(&self) -> bool
true if forwarding this message is restricted.
Source§impl IncomingMessage
impl IncomingMessage
Sourcepub fn download_location(&self) -> Option<InputFileLocation>
pub fn download_location(&self) -> Option<InputFileLocation>
Get the [InputFileLocation] for the media in this message, if any.
Returns None for messages without downloadable media.
Trait Implementations§
Source§impl Clone for IncomingMessage
impl Clone for IncomingMessage
Source§fn clone(&self) -> IncomingMessage
fn clone(&self) -> IncomingMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for IncomingMessage
impl RefUnwindSafe for IncomingMessage
impl Send for IncomingMessage
impl Sync for IncomingMessage
impl Unpin for IncomingMessage
impl UnsafeUnpin for IncomingMessage
impl UnwindSafe for IncomingMessage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more