#[non_exhaustive]pub struct Chat {
pub id: i64,
pub chat_type: String,
pub title: Option<String>,
pub username: Option<String>,
pub first_name: Option<String>,
pub last_name: Option<String>,
pub is_forum: Option<bool>,
pub is_direct_messages: Option<bool>,
}Expand description
This object represents a chat.
Corresponds to the Bot API Chat object.
As of Bot API 7.3 most extended fields have moved to
ChatFullInfo.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: i64Unique identifier for this chat.
chat_type: StringType of chat: "private", "group", "supergroup" or "channel".
title: Option<String>Title, for supergroups, channels and group chats.
username: Option<String>Username, for private chats, supergroups and channels if available.
first_name: Option<String>First name of the other party in a private chat.
last_name: Option<String>Last name of the other party in a private chat.
is_forum: Option<bool>true if the supergroup chat is a forum (has topics enabled).
is_direct_messages: Option<bool>true if the chat is the direct messages chat of a channel.
Implementations§
Source§impl Chat
impl Chat
Sourcepub fn is_private(&self) -> bool
pub fn is_private(&self) -> bool
Returns true if this is a private (one-on-one) chat.
Sourcepub fn is_supergroup(&self) -> bool
pub fn is_supergroup(&self) -> bool
Returns true if this is a supergroup chat.
Sourcepub fn is_channel(&self) -> bool
pub fn is_channel(&self) -> bool
Returns true if this is a channel.
Sourcepub fn effective_name(&self) -> Option<&str>
pub fn effective_name(&self) -> Option<&str>
Returns the chat’s effective display name.
For groups/supergroups/channels this is the title; for private chats it is the
other party’s first name. Returns None if neither is available.