Struct carapax::types::ChatMemberRestricted
source · pub struct ChatMemberRestricted {Show 17 fields
pub user: User,
pub can_add_web_page_previews: bool,
pub can_change_info: bool,
pub can_invite_users: bool,
pub can_manage_topics: bool,
pub can_pin_messages: Option<bool>,
pub can_send_audios: Option<bool>,
pub can_send_documents: Option<bool>,
pub can_send_messages: bool,
pub can_send_other_messages: bool,
pub can_send_photos: Option<bool>,
pub can_send_polls: bool,
pub can_send_video_notes: Option<bool>,
pub can_send_videos: Option<bool>,
pub can_send_voice_notes: Option<bool>,
pub is_member: bool,
pub until_date: i64,
}
Expand description
Represents a restricted user.
Fields§
§user: User
Information about the user.
can_add_web_page_previews: bool
Indicates whether the user may add web page previews to his messages.
can_change_info: bool
Indicates whether the user allowed to change the chat title, photo and other settings.
can_invite_users: bool
Indicates whether the user allowed to invite new users to the chat.
can_manage_topics: bool
Indicates whether the user is allowed to create forum topics.
can_pin_messages: Option<bool>
Indicates whether the user allowed to pin messages; groups and supergroups only.
can_send_audios: Option<bool>
Indicates whether the user is allowed to send audios.
can_send_documents: Option<bool>
Indicates whether the user is allowed to send documents.
can_send_messages: bool
Indicates whether the user can send text messages, contacts, locations and venues.
can_send_other_messages: bool
Indicates whether the user can send animations, games, stickers and use inline bots.
can_send_photos: Option<bool>
Indicates whether the user is allowed to send photos.
can_send_polls: bool
Indicates whether the user is allowed to send polls.
can_send_video_notes: Option<bool>
Indicates whether the user is allowed to send video notes.
can_send_videos: Option<bool>
Indicates whether the user is allowed to send videos.
can_send_voice_notes: Option<bool>
Indicates whether the user is allowed to send voice notes.
is_member: bool
Indicates whether the user is a member of the chat at the moment of the request.
until_date: i64
Date when restrictions will be lifted for this user; unix time.
Implementations§
source§impl ChatMemberRestricted
impl ChatMemberRestricted
sourcepub fn new(user: User, until_date: i64) -> ChatMemberRestricted
pub fn new(user: User, until_date: i64) -> ChatMemberRestricted
Creates a new ChatMemberRestricted
§Arguments
user
- Information about the user.until_date
- Date when restrictions will be lifted for this user; unix time.
sourcepub fn with_can_add_web_page_previews(self, value: bool) -> ChatMemberRestricted
pub fn with_can_add_web_page_previews(self, value: bool) -> ChatMemberRestricted
Sets a new value for a can_add_web_page_previews
flag.
§Arguments
value
- Indicates whether the user may add web page previews to his messages.
sourcepub fn with_can_change_info(self, value: bool) -> ChatMemberRestricted
pub fn with_can_change_info(self, value: bool) -> ChatMemberRestricted
Sets a new value for a can_change_info
flag.
§Arguments
value
- Indicates whether the user allowed to change the chat title, photo and other settings.
sourcepub fn with_can_invite_users(self, value: bool) -> ChatMemberRestricted
pub fn with_can_invite_users(self, value: bool) -> ChatMemberRestricted
Sets a new value for a can_invite_users
flag.
§Arguments
value
- Indicates whether the user allowed to invite new users to the chat.
sourcepub fn with_can_manage_topics(self, value: bool) -> ChatMemberRestricted
pub fn with_can_manage_topics(self, value: bool) -> ChatMemberRestricted
Sets a new value for a can_manage_topics
flag.
§Arguments
value
- Indicates whether the user is allowed to create forum topics.
sourcepub fn with_can_pin_messages(self, value: bool) -> ChatMemberRestricted
pub fn with_can_pin_messages(self, value: bool) -> ChatMemberRestricted
Sets a new value for a can_pin_messages
flag.
§Arguments
value
- Indicates whether the user allowed to pin messages; groups and supergroups only.
sourcepub fn with_can_send_audios(self, value: bool) -> ChatMemberRestricted
pub fn with_can_send_audios(self, value: bool) -> ChatMemberRestricted
Sets a new value for a can_send_audios
flag.
§Arguments
value
- Indicates whether the user is allowed to send audios.
sourcepub fn with_can_send_documents(self, value: bool) -> ChatMemberRestricted
pub fn with_can_send_documents(self, value: bool) -> ChatMemberRestricted
Sets a new value for a can_send_documents
flag.
§Arguments
value
- Indicates whether the user is allowed to send documents.
sourcepub fn with_can_send_messages(self, value: bool) -> ChatMemberRestricted
pub fn with_can_send_messages(self, value: bool) -> ChatMemberRestricted
Sets a new value for a can_send_messages
flag.
§Arguments
value
- Indicates whether the user can send text messages, contacts, locations and venues.
sourcepub fn with_can_send_other_messages(self, value: bool) -> ChatMemberRestricted
pub fn with_can_send_other_messages(self, value: bool) -> ChatMemberRestricted
Sets a new value for a can_send_other_messages
flag.
§Arguments
value
- Indicates whether the user can send animations, games, stickers and use inline bots.
sourcepub fn with_can_send_photos(self, value: bool) -> ChatMemberRestricted
pub fn with_can_send_photos(self, value: bool) -> ChatMemberRestricted
Sets a new value for a can_send_photos
flag.
§Arguments
value
- Indicates whether the user is allowed to send photos.
sourcepub fn with_can_send_polls(self, value: bool) -> ChatMemberRestricted
pub fn with_can_send_polls(self, value: bool) -> ChatMemberRestricted
Sets a new value for a can_send_polls
flag.
§Arguments
value
- Indicates whether the user is allowed to send polls.
sourcepub fn with_can_send_video_notes(self, value: bool) -> ChatMemberRestricted
pub fn with_can_send_video_notes(self, value: bool) -> ChatMemberRestricted
Sets a new value for a can_send_video_notes
flag.
§Arguments
value
- Indicates whether the user is allowed to send video notes.
sourcepub fn with_can_send_videos(self, value: bool) -> ChatMemberRestricted
pub fn with_can_send_videos(self, value: bool) -> ChatMemberRestricted
Sets a new value for a can_send_videos
flag.
§Arguments
value
- Indicates whether the user is allowed to send videos.
sourcepub fn with_can_send_voice_notes(self, value: bool) -> ChatMemberRestricted
pub fn with_can_send_voice_notes(self, value: bool) -> ChatMemberRestricted
Sets a new value for a can_send_voice_notes
flag.
§Arguments
value
- Indicates whether the user is allowed to send voice notes.
sourcepub fn with_is_member(self, value: bool) -> ChatMemberRestricted
pub fn with_is_member(self, value: bool) -> ChatMemberRestricted
Sets a new value for an is_member
flag.
§Arguments
value
- Indicates whether the user is a member of the chat at the moment of the request.
Trait Implementations§
source§impl Clone for ChatMemberRestricted
impl Clone for ChatMemberRestricted
source§fn clone(&self) -> ChatMemberRestricted
fn clone(&self) -> ChatMemberRestricted
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ChatMemberRestricted
impl Debug for ChatMemberRestricted
source§impl<'de> Deserialize<'de> for ChatMemberRestricted
impl<'de> Deserialize<'de> for ChatMemberRestricted
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<ChatMemberRestricted, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<ChatMemberRestricted, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for ChatMemberRestricted
impl PartialEq for ChatMemberRestricted
source§fn eq(&self, other: &ChatMemberRestricted) -> bool
fn eq(&self, other: &ChatMemberRestricted) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ChatMemberRestricted
impl PartialOrd for ChatMemberRestricted
source§fn partial_cmp(&self, other: &ChatMemberRestricted) -> Option<Ordering>
fn partial_cmp(&self, other: &ChatMemberRestricted) -> 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 ChatMemberRestricted
impl Serialize for ChatMemberRestricted
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for ChatMemberRestricted
Auto Trait Implementations§
impl Freeze for ChatMemberRestricted
impl RefUnwindSafe for ChatMemberRestricted
impl Send for ChatMemberRestricted
impl Sync for ChatMemberRestricted
impl Unpin for ChatMemberRestricted
impl UnwindSafe for ChatMemberRestricted
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more