Struct botapi::gen_types::ChatBuilder
source · pub struct ChatBuilder {
pub id: i64,
pub tg_type: String,
pub title: Option<String>,
pub username: Option<String>,
pub first_name: Option<String>,
pub last_name: Option<String>,
pub is_forum: Option<bool>,
}
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.
tg_type: String
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: Option<bool>
Optional. True, if the supergroup chat is a forum (has topics enabled)
Implementations§
source§impl ChatBuilder
impl ChatBuilder
pub fn new(id: i64) -> Self
sourcepub fn set_id(self, id: i64) -> Self
pub fn set_id(self, id: i64) -> Self
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.
sourcepub fn set_type(self, tg_type: String) -> Self
pub fn set_type(self, tg_type: String) -> Self
Type of the chat, can be either “private”, “group”, “supergroup” or “channel”
sourcepub fn set_title(self, title: String) -> Self
pub fn set_title(self, title: String) -> Self
Optional. Title, for supergroups, channels and group chats
sourcepub fn set_username(self, username: String) -> Self
pub fn set_username(self, username: String) -> Self
Optional. Username, for private chats, supergroups and channels if available
sourcepub fn set_first_name(self, first_name: String) -> Self
pub fn set_first_name(self, first_name: String) -> Self
Optional. First name of the other party in a private chat
sourcepub fn set_last_name(self, last_name: String) -> Self
pub fn set_last_name(self, last_name: String) -> Self
Optional. Last name of the other party in a private chat
sourcepub fn set_is_forum(self, is_forum: bool) -> Self
pub fn set_is_forum(self, is_forum: bool) -> Self
Optional. True, if the supergroup chat is a forum (has topics enabled)
pub fn build(self) -> Chat
Trait Implementations§
source§impl Clone for ChatBuilder
impl Clone for ChatBuilder
source§fn clone(&self) -> ChatBuilder
fn clone(&self) -> ChatBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ChatBuilder
impl Debug for ChatBuilder
source§impl Default for ChatBuilder
impl Default for ChatBuilder
source§fn default() -> ChatBuilder
fn default() -> ChatBuilder
source§impl<'de> Deserialize<'de> for ChatBuilder
impl<'de> Deserialize<'de> for ChatBuilder
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Hash for ChatBuilder
impl Hash for ChatBuilder
source§impl Ord for ChatBuilder
impl Ord for ChatBuilder
source§fn cmp(&self, other: &ChatBuilder) -> Ordering
fn cmp(&self, other: &ChatBuilder) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for ChatBuilder
impl PartialEq for ChatBuilder
source§fn eq(&self, other: &ChatBuilder) -> bool
fn eq(&self, other: &ChatBuilder) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ChatBuilder
impl PartialOrd for ChatBuilder
source§fn partial_cmp(&self, other: &ChatBuilder) -> Option<Ordering>
fn partial_cmp(&self, other: &ChatBuilder) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for ChatBuilder
impl Serialize for ChatBuilder
impl Eq for ChatBuilder
impl StructuralPartialEq for ChatBuilder
Auto Trait Implementations§
impl Freeze for ChatBuilder
impl RefUnwindSafe for ChatBuilder
impl Send for ChatBuilder
impl Sync for ChatBuilder
impl Unpin for ChatBuilder
impl UnwindSafe for ChatBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.