pub struct Chat {
pub id: ChatId,
pub kind: ChatKind,
pub photo: Option<ChatPhoto>,
pub pinned_message: Option<Box<Message>>,
pub message_auto_delete_time: Option<u32>,
pub has_hidden_members: bool,
pub has_aggressive_anti_spam_enabled: bool,
}
Expand description
This object represents a chat.
Fields§
§id: ChatId
A unique identifier for this chat.
kind: ChatKind
§photo: Option<ChatPhoto>
A chat photo. Returned only in GetChat
.
pinned_message: Option<Box<Message>>
The most recent pinned message (by sending date). Returned only in
GetChat
.
message_auto_delete_time: Option<u32>
The time after which all messages sent to the chat will be automatically
deleted; in seconds. Returned only in GetChat
.
true
, if non-administrators can only get the list of bots and
administrators in the chat. Returned only in GetChat
.
has_aggressive_anti_spam_enabled: bool
true
, if aggressive anti-spam checks are enabled in the supergroup.
The field is only available to chat administrators. Returned only in
GetChat
.
Implementations§
source§impl Chat
impl Chat
pub fn is_private(&self) -> bool
pub fn is_group(&self) -> bool
pub fn is_supergroup(&self) -> bool
pub fn is_channel(&self) -> bool
pub fn is_chat(&self) -> bool
source§impl Chat
impl Chat
Getters
sourcepub fn username(&self) -> Option<&str>
pub fn username(&self) -> Option<&str>
A username, for private chats, supergroups and channels if available.
sourcepub fn linked_chat_id(&self) -> Option<i64>
pub fn linked_chat_id(&self) -> Option<i64>
Unique identifier for the linked chat, i.e. the discussion group
identifier for a channel and vice versa. Returned only in GetChat
.
sourcepub fn permissions(&self) -> Option<ChatPermissions>
pub fn permissions(&self) -> Option<ChatPermissions>
A default chat member permissions, for groups and supergroups. Returned
only from GetChat
.
sourcepub fn sticker_set_name(&self) -> Option<&str>
pub fn sticker_set_name(&self) -> Option<&str>
For supergroups, name of group sticker set. Returned only from
GetChat
.
sourcepub fn can_set_sticker_set(&self) -> Option<bool>
pub fn can_set_sticker_set(&self) -> Option<bool>
true
, if the bot can change the group sticker set. Returned only
from GetChat
.
sourcepub fn slow_mode_delay(&self) -> Option<u32>
pub fn slow_mode_delay(&self) -> Option<u32>
The minimum allowed delay between consecutive messages sent by each
unpriviledged user. Returned only from GetChat
.
sourcepub fn location(&self) -> Option<&ChatLocation>
pub fn location(&self) -> Option<&ChatLocation>
The location to which the supergroup is connected. Returned only in
GetChat
.
sourcepub fn join_to_send_messages(&self) -> Option<True>
pub fn join_to_send_messages(&self) -> Option<True>
True, if users need to join the supergroup before they can send
messages. Returned only in GetChat
.
sourcepub fn join_by_request(&self) -> Option<True>
pub fn join_by_request(&self) -> Option<True>
True, if all users directly joining the supergroup need to be approved
by supergroup administrators. Returned only in GetChat
.
sourcepub fn description(&self) -> Option<&str>
pub fn description(&self) -> Option<&str>
A description, for groups, supergroups and channel chats. Returned
only in GetChat
.
sourcepub fn invite_link(&self) -> Option<&str>
pub fn invite_link(&self) -> Option<&str>
A chat invite link, for groups, supergroups and channel chats. Each
administrator in a chat generates their own invite links, so the
bot must first generate the link using
ExportChatInviteLink
. Returned only in
GetChat
.
sourcepub fn has_protected_content(&self) -> Option<True>
pub fn has_protected_content(&self) -> Option<True>
True
, if messages from the chat can’t be forwarded to other chats.
Returned only in GetChat
.
sourcepub fn first_name(&self) -> Option<&str>
pub fn first_name(&self) -> Option<&str>
A first name of the other party in a private chat.
sourcepub fn bio(&self) -> Option<&str>
pub fn bio(&self) -> Option<&str>
Bio of the other party in a private chat. Returned only in GetChat
.
sourcepub fn has_private_forwards(&self) -> Option<True>
pub fn has_private_forwards(&self) -> Option<True>
True
, if privacy settings of the other party in the private chat
allows to use tg://user?id=<user_id> links only in chats with the
user. Returned only in GetChat
.
sourcepub fn mentioned_users(&self) -> impl Iterator<Item = &User>
pub fn mentioned_users(&self) -> impl Iterator<Item = &User>
Returns all users that are “contained” in this Chat
structure.
This might be useful to track information about users.
Note that this function can return duplicate users.