Chat

Struct Chat 

Source
pub struct Chat {
Show 18 fields pub id: i64, pub kind: ChatKind, pub title: Option<String>, pub username: Option<String>, pub first_name: Option<String>, pub last_name: Option<String>, pub photo: Option<ChatPhoto>, pub bio: Option<String>, 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 sticker_set_name: Option<String>, pub can_get_sticker_set: Option<bool>, pub linked_chat_id: Option<i32>, pub location: Option<ChatLocation>,
}
Expand description

This object represents a chat.

Fields§

§id: i64

Unique identifier for this chat.

§kind: ChatKind

Type of chat.

§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

§photo: Option<ChatPhoto>

Chat photo. Returned only in getChat.

§bio: Option<String>

Bio of the other party in a private chat. 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>

Default chat member permissions, for groups and supergroups. 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.

§sticker_set_name: Option<String>

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

§can_get_sticker_set: Option<bool>

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

§linked_chat_id: Option<i32>

Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. Returned only in getChat.

§location: Option<ChatLocation>

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

Implementations§

Source§

impl Chat

Source

pub fn send_animation( &self, animation: impl Into<InputFileVariant>, ) -> SendAnimation

Source

pub fn send_audio(&self, audio: impl Into<InputFileVariant>) -> SendAudio

Source

pub fn send_chat_action(&self, action: ChatActionKind) -> SendChatAction

Source

pub fn send_contact( &self, phone_number: impl Into<String>, first_name: impl Into<String>, ) -> SendContact

Source

pub fn send_dice(&self) -> SendDice

Source

pub fn send_document( &self, document: impl Into<InputFileVariant>, ) -> SendDocument

Source

pub fn send_location( &self, latitude: f32, longitude: f32, horizontal_accuracy: f32, ) -> SendLocation

Source

pub fn send_media_group(&self) -> SendMediaGroup

Source

pub fn send_message(&self, text: impl Into<String>) -> SendMessage

Source

pub fn send_photo(&self, photo: impl Into<InputFileVariant>) -> SendPhoto

Source

pub fn send_poll( &self, question: impl Into<String>, options: Vec<String>, ) -> SendPoll

Source

pub fn send_quiz( &self, question: impl Into<String>, options: Vec<String>, correct_option_id: u32, ) -> SendPoll

Source

pub fn send_venue( &self, latitude: f32, longitude: f32, title: impl Into<String>, address: impl Into<String>, ) -> SendVenue

Source

pub fn send_video(&self, video: impl Into<InputFileVariant>) -> SendVideo

Source

pub fn send_video_note( &self, video_note: impl Into<InputFileVariant>, ) -> SendVideoNote

Source

pub fn send_voice(&self, voice: impl Into<InputFileVariant>) -> SendVoice

Source

pub fn ban(&self, user_id: i64) -> BanChatMember

Source

pub fn unban(&self, user_id: i64) -> UnbanChatMember

Source

pub fn restrict( &self, user_id: i64, permissions: ChatPermissions, ) -> RestrictChatMember

Source

pub fn promote(&self, user_id: i64) -> PromoteChatMember

Source

pub fn set_administrator_title( &self, user_id: i64, custom_title: impl Into<String>, ) -> SetChatAdministratorCustomTitle

Source

pub fn set_permissions( &self, permissions: ChatPermissions, ) -> SetChatPermissions

Source

pub fn approve_join(&self, user_id: i64) -> ApproveChatJoinRequest

Source

pub fn decline_join(&self, user_id: i64) -> DeclineChatJoinRequest

Source

pub fn set_photo(&self, photo: InputFile) -> SetChatPhoto

Source

pub fn delete_photo(&self) -> DeleteChatPhoto

Source

pub fn set_title(&self, title: impl Into<String>) -> SetChatTitle

Source

pub fn set_description( &self, description: impl Into<String>, ) -> SetChatDescription

Source

pub fn remove_description(&self) -> SetChatDescription

Source

pub fn pin_message(&self, message_id: i64) -> PinChatMessage

Source

pub fn unpin_message(&self, message_id: i64) -> UnpinChatMessage

Source

pub fn unpin_latest_message(&self) -> UnpinChatMessage

Source

pub fn unpin_all_messages(&self) -> UnpinAllChatMessages

Source

pub fn leave(&self) -> LeaveChat

Source

pub fn get_details(&self) -> GetChat

Source

pub fn get_administrators(&self) -> GetChatAdministrators

Source

pub fn get_member_count(&self) -> GetChatMemberCount

Source

pub fn get_member(&self, user_id: i64) -> GetChatMember

Source

pub fn set_sticker_set( &self, sticker_set_name: impl Into<String>, ) -> SetChatStickerSet

Source

pub fn delete_sticker_set(&self) -> DeleteChatStickerSet

Source

pub fn edit_text_of( &self, message_id: i64, text: impl Into<String>, ) -> EditMessageText

Source

pub fn remove_caption_of(&self, message_id: i64) -> EditMessageCaption

Source

pub fn edit_caption_of( &self, message_id: i64, caption: impl Into<String>, ) -> EditMessageCaption

Source

pub fn edit_media_of( &self, message_id: i64, media: impl Into<InputMedia>, ) -> EditMessageMedia

Source

pub fn remove_reply_markup_of(&self, message_id: i64) -> EditMessageReplyMarkup

Source

pub fn edit_reply_markup_of( &self, message_id: i64, reply_markup: impl Into<InlineKeyboardMarkup>, ) -> EditMessageReplyMarkup

Source

pub fn stop_poll(&self, message_id: i64) -> StopPoll

Source

pub fn delete_message(&self, message_id: i64) -> DeleteMessage

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

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