Chat

Struct Chat 

Source
pub struct Chat {
Show 41 fields pub id: i64, pub type: ChatType, pub title: String, pub photo: Option<ChatPhotoInfo>, pub accent_color_id: i32, pub background_custom_emoji_id: i64, pub profile_accent_color_id: i32, pub profile_background_custom_emoji_id: i64, pub permissions: ChatPermissions, pub last_message: Option<Message>, pub positions: Vec<ChatPosition>, pub chat_lists: Vec<ChatList>, pub message_sender_id: Option<MessageSender>, pub block_list: Option<BlockList>, pub has_protected_content: bool, pub is_translatable: bool, pub is_marked_as_unread: bool, pub view_as_topics: bool, pub has_scheduled_messages: bool, pub can_be_deleted_only_for_self: bool, pub can_be_deleted_for_all_users: bool, pub can_be_reported: bool, pub default_disable_notification: bool, pub unread_count: i32, pub last_read_inbox_message_id: i64, pub last_read_outbox_message_id: i64, pub unread_mention_count: i32, pub unread_reaction_count: i32, pub notification_settings: ChatNotificationSettings, pub available_reactions: ChatAvailableReactions, pub message_auto_delete_time: i32, pub emoji_status: Option<EmojiStatus>, pub background: Option<ChatBackground>, pub theme_name: String, pub action_bar: Option<ChatActionBar>, pub business_bot_manage_bar: Option<BusinessBotManageBar>, pub video_chat: VideoChat, pub pending_join_requests: Option<ChatJoinRequestsInfo>, pub reply_markup_message_id: i64, pub draft_message: Option<DraftMessage>, pub client_data: String,
}
Expand description

A chat. (Can be a private chat, basic group, supergroup, or secret chat)

Fields§

§id: i64

Chat unique identifier

§type: ChatType

Type of the chat

§title: String

Chat title

§photo: Option<ChatPhotoInfo>

Chat photo; may be null

§accent_color_id: i32

Identifier of the accent color for message sender name, and backgrounds of chat photo, reply header, and link preview

§background_custom_emoji_id: i64

Identifier of a custom emoji to be shown on the reply header and link preview background for messages sent by the chat; 0 if none

§profile_accent_color_id: i32

Identifier of the profile accent color for the chat’s profile; -1 if none

§profile_background_custom_emoji_id: i64

Identifier of a custom emoji to be shown on the background of the chat’s profile; 0 if none

§permissions: ChatPermissions

Actions that non-administrator chat members are allowed to take in the chat

§last_message: Option<Message>

Last message in the chat; may be null if none or unknown

§positions: Vec<ChatPosition>

Positions of the chat in chat lists

§chat_lists: Vec<ChatList>

Chat lists to which the chat belongs. A chat can have a non-zero position in a chat list even it doesn’t belong to the chat list and have no position in a chat list even it belongs to the chat list

§message_sender_id: Option<MessageSender>

Identifier of a user or chat that is selected to send messages in the chat; may be null if the user can’t change message sender

§block_list: Option<BlockList>

Block list to which the chat is added; may be null if none

§has_protected_content: bool

True, if chat content can’t be saved locally, forwarded, or copied

§is_translatable: bool

True, if translation of all messages in the chat must be suggested to the user

§is_marked_as_unread: bool

True, if the chat is marked as unread

§view_as_topics: bool

True, if the chat is a forum supergroup that must be shown in the “View as topics” mode, or Saved Messages chat that must be shown in the “View as chats”

§has_scheduled_messages: bool

True, if the chat has scheduled messages

§can_be_deleted_only_for_self: bool

True, if the chat messages can be deleted only for the current user while other users will continue to see the messages

§can_be_deleted_for_all_users: bool

True, if the chat messages can be deleted for all users

§can_be_reported: bool

True, if the chat can be reported to Telegram moderators through reportChat or reportChatPhoto

§default_disable_notification: bool

Default value of the disable_notification parameter, used when a message is sent to the chat

§unread_count: i32

Number of unread messages in the chat

§last_read_inbox_message_id: i64

Identifier of the last read incoming message

§last_read_outbox_message_id: i64

Identifier of the last read outgoing message

§unread_mention_count: i32

Number of unread messages with a mention/reply in the chat

§unread_reaction_count: i32

Number of messages with unread reactions in the chat

§notification_settings: ChatNotificationSettings

Notification settings for the chat

§available_reactions: ChatAvailableReactions

Types of reaction, available in the chat

§message_auto_delete_time: i32

Current message auto-delete or self-destruct timer setting for the chat, in seconds; 0 if disabled. Self-destruct timer in secret chats starts after the message or its content is viewed. Auto-delete timer in other chats starts from the send date

§emoji_status: Option<EmojiStatus>

Emoji status to be shown along with chat title; may be null

§background: Option<ChatBackground>

Background set for the chat; may be null if none

§theme_name: String

If non-empty, name of a theme, set for the chat

§action_bar: Option<ChatActionBar>

Information about actions which must be possible to do through the chat action bar; may be null if none

§business_bot_manage_bar: Option<BusinessBotManageBar>

Information about bar for managing a business bot in the chat; may be null if none

§video_chat: VideoChat

Information about video chat of the chat

§pending_join_requests: Option<ChatJoinRequestsInfo>

Information about pending join requests; may be null if none

§reply_markup_message_id: i64

Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat

§draft_message: Option<DraftMessage>

A draft of a message in the chat; may be null if none

§client_data: String

Application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used

Trait Implementations§

Source§

impl Clone for Chat

Source§

fn clone(&self) -> Chat

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Chat

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Chat

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Chat

Source§

fn eq(&self, other: &Chat) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Chat

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Chat

Auto Trait Implementations§

§

impl Freeze for Chat

§

impl RefUnwindSafe for Chat

§

impl Send for Chat

§

impl Sync for Chat

§

impl Unpin for Chat

§

impl UnwindSafe for Chat

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,