Skip to main content

Chat

Struct Chat 

Source
pub struct Chat {
    pub id: i64,
    pub type_: ChatType,
    pub title: Option<String>,
    pub username: Option<String>,
    pub first_name: Option<String>,
    pub last_name: Option<String>,
    pub is_forum: bool,
}
Expand description

This object represents a chat.

API Reference: link

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.

§type_: ChatType

Type of the chat, can be either “private”, “group”, “supergroup” or “channel”

§title: Option<String>

Optional. Title, for supergroups, channels and group chats

§username: Option<String>

Optional. Username, for private chats, supergroups and channels if available

§first_name: Option<String>

Optional. First name of the other party in a private chat

§last_name: Option<String>

Optional. Last name of the other party in a private chat

§is_forum: bool

Optional. True, if the supergroup chat is a forum (has topics enabled)

Implementations§

Source§

impl Chat

Source

pub fn full_name(&self) -> String

Trait Implementations§

Source§

impl Clone for Chat

Source§

fn clone(&self) -> Chat

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Default for Chat

Source§

fn default() -> Chat

Returns the “default value” for a type. 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 (const: unstable) · 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 TgChat for &Chat

Source§

fn id(&self) -> i64

Source§

fn full_name(&self) -> impl AsRef<str>

Source§

fn username(&self) -> Option<impl AsRef<str>>

Source§

fn get_url(&self) -> String

Source§

fn unpin_all_messages<'a>( &'a self, api: &'a API, ) -> UnpinAllChatMessagesRequest<'a>

Source§

fn get_member_count<'a>(&'a self, api: &'a API) -> GetChatMemberCountRequest<'a>

Source§

fn get_administrators<'a>( &'a self, api: &'a API, ) -> GetChatAdministratorsRequest<'a>

Source§

fn get_member<'a>( &'a self, api: &'a API, user_id: impl Into<i64>, ) -> GetChatMemberRequest<'a>

Source§

fn get_full<'a>(&'a self, api: &'a API) -> GetChatRequest<'a>

Source§

fn ban_member<'a>( &'a self, api: &'a API, user_id: impl Into<i64>, ) -> BanChatMemberRequest<'a>

Source§

fn unban_member<'a>( &'a self, api: &'a API, user_id: impl Into<i64>, ) -> UnbanChatMemberRequest<'a>

Source§

fn ban_sender_chat<'a>( &'a self, api: &'a API, sender_chat_id: impl Into<i64>, ) -> BanChatSenderChatRequest<'a>

Source§

fn unban_sender_chat<'a>( &'a self, api: &'a API, sender_chat_id: impl Into<i64>, ) -> UnbanChatSenderChatRequest<'a>

Source§

fn set_administrator_custom_title<'a>( &'a self, api: &'a API, user_id: impl Into<i64>, custom_title: impl Into<String>, ) -> SetChatAdministratorCustomTitleRequest<'a>

Source§

fn set_title<'a>( &'a self, api: &'a API, title: impl Into<String>, ) -> SetChatTitleRequest<'a>

Source§

fn set_description<'a>( &'a self, api: &'a API, description: Option<impl Into<String>>, ) -> SetChatDescriptionRequest<'a>

Source§

fn set_permissions<'a>( &'a self, api: &'a API, permissions: impl Into<ChatPermissions>, ) -> SetChatPermissionsRequest<'a>

Source§

fn set_photo<'a>( &'a self, api: &'a API, photo: impl Into<InputFile>, ) -> SetChatPhotoRequest<'a>

Source§

fn set_sticker_set<'a>( &'a self, api: &'a API, sticker_set_name: impl Into<String>, ) -> SetChatStickerSetRequest<'a>

Source§

fn send_action<'a>( &'a self, api: &'a API, action: impl Into<SendChatActionAction>, ) -> SendChatActionRequest<'a>

Source§

fn leave<'a>(&'a self, api: &'a API) -> LeaveChatRequest<'a>

Source§

fn delete_photo<'a>(&'a self, api: &'a API) -> DeleteChatPhotoRequest<'a>

Source§

fn delete_sticker_set<'a>( &'a self, api: &'a API, ) -> DeleteChatStickerSetRequest<'a>

Source§

fn approve_join_request<'a>( &'a self, api: &'a API, user_id: impl Into<i64>, ) -> ApproveChatJoinRequestRequest<'a>

Source§

fn decline_join_request<'a>( &'a self, api: &'a API, user_id: impl Into<i64>, ) -> DeclineChatJoinRequestRequest<'a>

Source§

fn promote_member<'a>( &'a self, api: &'a API, user_id: impl Into<i64>, ) -> PromoteChatMemberRequest<'a>

Source§

fn restrict_member<'a>( &'a self, api: &'a API, user_id: impl Into<i64>, permissions: impl Into<ChatPermissions>, ) -> RestrictChatMemberRequest<'a>

Source§

impl TgChat for &mut Chat

Source§

fn id(&self) -> i64

Source§

fn full_name(&self) -> impl AsRef<str>

Source§

fn username(&self) -> Option<impl AsRef<str>>

Source§

fn get_url(&self) -> String

Source§

fn unpin_all_messages<'a>( &'a self, api: &'a API, ) -> UnpinAllChatMessagesRequest<'a>

Source§

fn get_member_count<'a>(&'a self, api: &'a API) -> GetChatMemberCountRequest<'a>

Source§

fn get_administrators<'a>( &'a self, api: &'a API, ) -> GetChatAdministratorsRequest<'a>

Source§

fn get_member<'a>( &'a self, api: &'a API, user_id: impl Into<i64>, ) -> GetChatMemberRequest<'a>

Source§

fn get_full<'a>(&'a self, api: &'a API) -> GetChatRequest<'a>

Source§

fn ban_member<'a>( &'a self, api: &'a API, user_id: impl Into<i64>, ) -> BanChatMemberRequest<'a>

Source§

fn unban_member<'a>( &'a self, api: &'a API, user_id: impl Into<i64>, ) -> UnbanChatMemberRequest<'a>

Source§

fn ban_sender_chat<'a>( &'a self, api: &'a API, sender_chat_id: impl Into<i64>, ) -> BanChatSenderChatRequest<'a>

Source§

fn unban_sender_chat<'a>( &'a self, api: &'a API, sender_chat_id: impl Into<i64>, ) -> UnbanChatSenderChatRequest<'a>

Source§

fn set_administrator_custom_title<'a>( &'a self, api: &'a API, user_id: impl Into<i64>, custom_title: impl Into<String>, ) -> SetChatAdministratorCustomTitleRequest<'a>

Source§

fn set_title<'a>( &'a self, api: &'a API, title: impl Into<String>, ) -> SetChatTitleRequest<'a>

Source§

fn set_description<'a>( &'a self, api: &'a API, description: Option<impl Into<String>>, ) -> SetChatDescriptionRequest<'a>

Source§

fn set_permissions<'a>( &'a self, api: &'a API, permissions: impl Into<ChatPermissions>, ) -> SetChatPermissionsRequest<'a>

Source§

fn set_photo<'a>( &'a self, api: &'a API, photo: impl Into<InputFile>, ) -> SetChatPhotoRequest<'a>

Source§

fn set_sticker_set<'a>( &'a self, api: &'a API, sticker_set_name: impl Into<String>, ) -> SetChatStickerSetRequest<'a>

Source§

fn send_action<'a>( &'a self, api: &'a API, action: impl Into<SendChatActionAction>, ) -> SendChatActionRequest<'a>

Source§

fn leave<'a>(&'a self, api: &'a API) -> LeaveChatRequest<'a>

Source§

fn delete_photo<'a>(&'a self, api: &'a API) -> DeleteChatPhotoRequest<'a>

Source§

fn delete_sticker_set<'a>( &'a self, api: &'a API, ) -> DeleteChatStickerSetRequest<'a>

Source§

fn approve_join_request<'a>( &'a self, api: &'a API, user_id: impl Into<i64>, ) -> ApproveChatJoinRequestRequest<'a>

Source§

fn decline_join_request<'a>( &'a self, api: &'a API, user_id: impl Into<i64>, ) -> DeclineChatJoinRequestRequest<'a>

Source§

fn promote_member<'a>( &'a self, api: &'a API, user_id: impl Into<i64>, ) -> PromoteChatMemberRequest<'a>

Source§

fn restrict_member<'a>( &'a self, api: &'a API, user_id: impl Into<i64>, permissions: impl Into<ChatPermissions>, ) -> RestrictChatMemberRequest<'a>

Source§

impl TgChat for Chat

Source§

fn id(&self) -> i64

Source§

fn full_name(&self) -> impl AsRef<str>

Source§

fn username(&self) -> Option<impl AsRef<str>>

Source§

fn get_url(&self) -> String

Source§

fn unpin_all_messages<'a>( &'a self, api: &'a API, ) -> UnpinAllChatMessagesRequest<'a>

Source§

fn get_member_count<'a>(&'a self, api: &'a API) -> GetChatMemberCountRequest<'a>

Source§

fn get_administrators<'a>( &'a self, api: &'a API, ) -> GetChatAdministratorsRequest<'a>

Source§

fn get_member<'a>( &'a self, api: &'a API, user_id: impl Into<i64>, ) -> GetChatMemberRequest<'a>

Source§

fn get_full<'a>(&'a self, api: &'a API) -> GetChatRequest<'a>

Source§

fn ban_member<'a>( &'a self, api: &'a API, user_id: impl Into<i64>, ) -> BanChatMemberRequest<'a>

Source§

fn unban_member<'a>( &'a self, api: &'a API, user_id: impl Into<i64>, ) -> UnbanChatMemberRequest<'a>

Source§

fn ban_sender_chat<'a>( &'a self, api: &'a API, sender_chat_id: impl Into<i64>, ) -> BanChatSenderChatRequest<'a>

Source§

fn unban_sender_chat<'a>( &'a self, api: &'a API, sender_chat_id: impl Into<i64>, ) -> UnbanChatSenderChatRequest<'a>

Source§

fn set_administrator_custom_title<'a>( &'a self, api: &'a API, user_id: impl Into<i64>, custom_title: impl Into<String>, ) -> SetChatAdministratorCustomTitleRequest<'a>

Source§

fn set_title<'a>( &'a self, api: &'a API, title: impl Into<String>, ) -> SetChatTitleRequest<'a>

Source§

fn set_description<'a>( &'a self, api: &'a API, description: Option<impl Into<String>>, ) -> SetChatDescriptionRequest<'a>

Source§

fn set_permissions<'a>( &'a self, api: &'a API, permissions: impl Into<ChatPermissions>, ) -> SetChatPermissionsRequest<'a>

Source§

fn set_photo<'a>( &'a self, api: &'a API, photo: impl Into<InputFile>, ) -> SetChatPhotoRequest<'a>

Source§

fn set_sticker_set<'a>( &'a self, api: &'a API, sticker_set_name: impl Into<String>, ) -> SetChatStickerSetRequest<'a>

Source§

fn send_action<'a>( &'a self, api: &'a API, action: impl Into<SendChatActionAction>, ) -> SendChatActionRequest<'a>

Source§

fn leave<'a>(&'a self, api: &'a API) -> LeaveChatRequest<'a>

Source§

fn delete_photo<'a>(&'a self, api: &'a API) -> DeleteChatPhotoRequest<'a>

Source§

fn delete_sticker_set<'a>( &'a self, api: &'a API, ) -> DeleteChatStickerSetRequest<'a>

Source§

fn approve_join_request<'a>( &'a self, api: &'a API, user_id: impl Into<i64>, ) -> ApproveChatJoinRequestRequest<'a>

Source§

fn decline_join_request<'a>( &'a self, api: &'a API, user_id: impl Into<i64>, ) -> DeclineChatJoinRequestRequest<'a>

Source§

fn promote_member<'a>( &'a self, api: &'a API, user_id: impl Into<i64>, ) -> PromoteChatMemberRequest<'a>

Source§

fn restrict_member<'a>( &'a self, api: &'a API, user_id: impl Into<i64>, permissions: impl Into<ChatPermissions>, ) -> RestrictChatMemberRequest<'a>

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 UnsafeUnpin 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> FormatMention for T
where T: TgChat,

Source§

fn mention<'a>(&self, ft: &'a mut FormattedText) -> &'a mut FormattedText

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WrapRequest for T

Source§

fn wrap<ReturnType>( &self, ) -> impl Future<Output = Result<ReturnType, ConogramError>>
where for<'a> &'a Self: IntoFuture<Output = Result<ReturnType, ConogramError>>, Self: Sized,

Source§

fn wrap_background<ReturnType>(self)
where for<'a> &'a Self: IntoFuture<Output = Result<ReturnType, ConogramError>> + Send + Sync, Self: IntoFuture<Output = Result<ReturnType, ConogramError>> + Send + Sync + Sized + 'static, ReturnType: Send, for<'a> <&'a Self as IntoFuture>::IntoFuture: Send,

Source§

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