Struct carapax::types::ChatPermissions
source · pub struct ChatPermissions {Show 14 fields
pub can_add_web_page_previews: Option<bool>,
pub can_change_info: Option<bool>,
pub can_invite_users: Option<bool>,
pub can_manage_topics: Option<bool>,
pub can_pin_messages: Option<bool>,
pub can_send_audios: Option<bool>,
pub can_send_documents: Option<bool>,
pub can_send_messages: Option<bool>,
pub can_send_other_messages: Option<bool>,
pub can_send_photos: Option<bool>,
pub can_send_polls: Option<bool>,
pub can_send_video_notes: Option<bool>,
pub can_send_videos: Option<bool>,
pub can_send_voice_notes: Option<bool>,
}
Expand description
Represents actions that a non-administrator user is allowed to take in a chat.
Fields§
§can_add_web_page_previews: Option<bool>
Indicates whether the user is allowed to add web page previews to their messages.
can_change_info: Option<bool>
Indicates whether the user is allowed to change the chat title, photo and other settings.
Ignored in public supergroups.
can_invite_users: Option<bool>
Indicates whether the user is allowed to invite new users to the chat.
can_manage_topics: Option<bool>
Indicates whether the user is allowed to create forum topics.
If omitted defaults to the value of can_pin_messages
.
can_pin_messages: Option<bool>
Indicates whether the user is allowed to pin messages.
Ignored in public supergroups.
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: Option<bool>
Indicates whether the user is allowed to send text messages, contacts, locations and venues.
can_send_other_messages: Option<bool>
Indicates whether the user is allowed to 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: Option<bool>
Indicates whether the user is allowed to send polls, implies can_send_messages
.
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.
Implementations§
source§impl ChatPermissions
impl ChatPermissions
sourcepub fn restricted() -> ChatPermissions
pub fn restricted() -> ChatPermissions
Restrict everything.
sourcepub fn allowed() -> ChatPermissions
pub fn allowed() -> ChatPermissions
Allow everything.
sourcepub fn with_can_add_web_page_previews(self, flag: bool) -> ChatPermissions
pub fn with_can_add_web_page_previews(self, flag: bool) -> ChatPermissions
Sets a new value for a can_add_web_page_previews
flag.
§Arguments
value
- Permission add web page previews to messages.
sourcepub fn with_can_change_info(self, flag: bool) -> ChatPermissions
pub fn with_can_change_info(self, flag: bool) -> ChatPermissions
Sets a new value for a can_change_info
flag.
§Arguments
value
- Permission to change the chat title, photo and other settings.
sourcepub fn with_can_invite_users(self, flag: bool) -> ChatPermissions
pub fn with_can_invite_users(self, flag: bool) -> ChatPermissions
Sets a new value for a can_invite_users
flag.
§Arguments
value
- Permission to invite new users to the chat.
sourcepub fn with_can_manage_topics(self, flag: bool) -> ChatPermissions
pub fn with_can_manage_topics(self, flag: bool) -> ChatPermissions
sourcepub fn with_can_pin_messages(self, flag: bool) -> ChatPermissions
pub fn with_can_pin_messages(self, flag: bool) -> ChatPermissions
sourcepub fn with_can_send_audios(self, flag: bool) -> ChatPermissions
pub fn with_can_send_audios(self, flag: bool) -> ChatPermissions
sourcepub fn with_can_send_documents(self, flag: bool) -> ChatPermissions
pub fn with_can_send_documents(self, flag: bool) -> ChatPermissions
sourcepub fn with_can_send_messages(self, flag: bool) -> ChatPermissions
pub fn with_can_send_messages(self, flag: bool) -> ChatPermissions
Sets a new value for a can_send_messages
flag.
§Arguments
value
- Permission to send text messages, contacts, locations and venues.
sourcepub fn with_can_send_other_messages(self, flag: bool) -> ChatPermissions
pub fn with_can_send_other_messages(self, flag: bool) -> ChatPermissions
Sets a new value for a can_send_other_messages
flag.
§Arguments
value
- Permission to send animations, games, stickers and use inline bots.
sourcepub fn with_can_send_photos(self, flag: bool) -> ChatPermissions
pub fn with_can_send_photos(self, flag: bool) -> ChatPermissions
sourcepub fn with_can_send_polls(self, flag: bool) -> ChatPermissions
pub fn with_can_send_polls(self, flag: bool) -> ChatPermissions
sourcepub fn with_can_send_video_notes(self, flag: bool) -> ChatPermissions
pub fn with_can_send_video_notes(self, flag: bool) -> ChatPermissions
Sets a new value for a can_send_video_notes
flag.
§Arguments
value
- Permission to send video notes.
sourcepub fn with_can_send_videos(self, flag: bool) -> ChatPermissions
pub fn with_can_send_videos(self, flag: bool) -> ChatPermissions
sourcepub fn with_can_send_voice_notes(self, flag: bool) -> ChatPermissions
pub fn with_can_send_voice_notes(self, flag: bool) -> ChatPermissions
Sets a new value for a can_send_voice_notes
flag.
§Arguments
value
- Permission to send voice notes.
Trait Implementations§
source§impl Clone for ChatPermissions
impl Clone for ChatPermissions
source§fn clone(&self) -> ChatPermissions
fn clone(&self) -> ChatPermissions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ChatPermissions
impl Debug for ChatPermissions
source§impl Default for ChatPermissions
impl Default for ChatPermissions
source§fn default() -> ChatPermissions
fn default() -> ChatPermissions
source§impl<'de> Deserialize<'de> for ChatPermissions
impl<'de> Deserialize<'de> for ChatPermissions
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<ChatPermissions, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<ChatPermissions, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for ChatPermissions
impl PartialEq for ChatPermissions
source§fn eq(&self, other: &ChatPermissions) -> bool
fn eq(&self, other: &ChatPermissions) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ChatPermissions
impl PartialOrd for ChatPermissions
source§fn partial_cmp(&self, other: &ChatPermissions) -> Option<Ordering>
fn partial_cmp(&self, other: &ChatPermissions) -> 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 ChatPermissions
impl Serialize for ChatPermissions
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 Copy for ChatPermissions
impl StructuralPartialEq for ChatPermissions
Auto Trait Implementations§
impl Freeze for ChatPermissions
impl RefUnwindSafe for ChatPermissions
impl Send for ChatPermissions
impl Sync for ChatPermissions
impl Unpin for ChatPermissions
impl UnwindSafe for ChatPermissions
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