Chat

Struct Chat 

Source
pub struct Chat {
Show 21 fields pub id: i64, pub kind: ChatKind, pub title: Option<String>, pub username: Option<String>, pub chat_user: Option<ChatUser>, pub photo: Option<ChatPhoto>, pub has_private_forwards: bool, pub has_restricted_voice_and_video_messages: bool, pub join_to_send_messages: bool, pub join_by_request: bool, pub description: Option<String>, pub invite_link: Option<String>, pub pinned_message: Option<Box<Message>>, pub permissions: Option<ChatPermissions>, pub slow_mode_delay: Option<i32>, pub message_auto_delete_time: Option<i32>, pub has_protected_content: bool, pub sticker_set_name: Option<String>, pub can_set_sticker_set: bool, pub linked_chat_id: Option<i64>, pub location: Option<ChatLocation>,
}
Expand description

This object represents a chat.

Fields§

§id: i64

Unique identifier for this chat.

This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

§kind: ChatKind

Type of chat, can be either “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

§chat_user: Option<ChatUser>

The user chat with in a private chat

§photo: Option<ChatPhoto>

Chat photo. Returned only in getChat.

§has_private_forwards: bool

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.

§has_restricted_voice_and_video_messages: bool

True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat.

§join_to_send_messages: bool

True, if users need to join the supergroup before they can send messages. Returned only in getChat.

§join_by_request: bool

True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat.

§description: Option<String>

Description, for groups, supergroups and channel chats. Returned only in getChat.

§invite_link: Option<String>

Primary invite link, for groups, supergroups and channel chats. Returned only in getChat.

§pinned_message: Option<Box<Message>>

The most recent pinned message (by sending date). Returned only in getChat.

§permissions: Option<ChatPermissions>

Default chat member permissions, for groups and supergroups. Returned only in getChat.

§slow_mode_delay: Option<i32>

For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in getChat.

§message_auto_delete_time: Option<i32>

The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat.

§has_protected_content: bool

True, if messages from the chat can’t be forwarded to other chats. Returned only in getChat.

§sticker_set_name: Option<String>

For supergroups, name of group sticker set. Returned only in getChat.

§can_set_sticker_set: bool

True, if the bot can change the group sticker set. Returned only in getChat.

§linked_chat_id: Option<i64>

Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat.

§location: Option<ChatLocation>

For supergroups, the location to which the supergroup is connected. Returned only in getChat.

Trait Implementations§

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> 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, 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>,