pub struct Me {
pub user: User,
pub can_join_groups: bool,
pub can_read_all_group_messages: bool,
pub supports_inline_queries: bool,
}
Expand description
Returned only in GetMe
.
Fields§
§user: User
§can_join_groups: bool
true
, if the bot can be invited to groups.
can_read_all_group_messages: bool
true
, if privacy mode is disabled for the bot.
supports_inline_queries: bool
true
, if the bot supports inline queries.
Implementations§
Methods from Deref<Target = User>§
Sourcepub fn full_name(&self) -> String
pub fn full_name(&self) -> String
Returns full name of this user, ie first and last names joined with a space.
Sourcepub fn mention(&self) -> Option<String>
pub fn mention(&self) -> Option<String>
Returns a username mention of this user. Returns None
if
self.username.is_none()
.
Sourcepub fn url(&self) -> Url
pub fn url(&self) -> Url
Returns an URL that links to this user in the form of
tg://user/?id=<...>
.
Sourcepub fn tme_url(&self) -> Option<Url>
pub fn tme_url(&self) -> Option<Url>
Returns an URL that links to this user in the form of t.me/<...>
.
Returns None
if self.username.is_none()
.
Sourcepub fn preferably_tme_url(&self) -> Url
pub fn preferably_tme_url(&self) -> Url
Returns an URL that links to this user in the form of t.me/<...>
or
tg://user/?id=<...>
, preferring t.me
one when possible.
Sourcepub fn is_anonymous(&self) -> bool
pub fn is_anonymous(&self) -> bool
Returns true
if this is the special user used by telegram bot API to
denote an anonymous user that sends messages on behalf of a group.
Sourcepub fn is_channel(&self) -> bool
pub fn is_channel(&self) -> bool
Returns true
if this is the special user used by telegram bot API to
denote an anonymous user that sends messages on behalf of a channel.
Sourcepub fn is_telegram(&self) -> bool
pub fn is_telegram(&self) -> bool
Returns true
if this is the special user used by telegram itself.
It is sometimes also used as a fallback, for example when a channel post
is automatically forwarded to a group, bots in a group will get a
message where from
is the Telegram user.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Me
impl<'de> Deserialize<'de> for Me
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Me
impl StructuralPartialEq for Me
Auto Trait Implementations§
impl Freeze for Me
impl RefUnwindSafe for Me
impl Send for Me
impl Sync for Me
impl Unpin for Me
impl UnwindSafe for Me
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> Erasable for T
impl<T> Erasable for T
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