Struct tbot::types::chat::Permissions
source · #[non_exhaustive]pub struct Permissions {
pub can_send_messages: Option<bool>,
pub can_send_media_messages: Option<bool>,
pub can_send_polls: Option<bool>,
pub can_send_other_messages: Option<bool>,
pub can_add_web_page_previews: Option<bool>,
pub can_change_info: Option<bool>,
pub can_invite_users: Option<bool>,
pub can_pin_messages: Option<bool>,
}
Expand description
Describes actions that a non-administrator user is allowed to take in a chat.
This struct is a representation of ChatPermissions
.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.can_send_messages: Option<bool>
true
if the user can send text messages, contacts, locations and
venues.
can_send_media_messages: Option<bool>
true
if the user can send audios, documents, photos, videos, video
notes and voice notes. Implies can_send_messages
.
can_send_polls: Option<bool>
true
if the user can send polls. Implies can_send_messages
.
can_send_other_messages: Option<bool>
true
if the user can use inline bots and send animations, games and
stickers. Implies can_send_media_messages
.
can_add_web_page_previews: Option<bool>
true
if the user can add web page previews. Implies
can_send_media_messages
.
can_change_info: Option<bool>
true
if the user can change the chat information. Ignored in public
supergroups.
can_invite_users: Option<bool>
true
if the user can invite new users.
can_pin_messages: Option<bool>
true
is the user can pin messages. Ignored in public supegroups.
Implementations§
source§impl Permissions
impl Permissions
sourcepub const fn can_send_messages(self, can_send: bool) -> Self
pub const fn can_send_messages(self, can_send: bool) -> Self
Configures if the user can send messages.
sourcepub const fn can_send_media_messages(self, can_send: bool) -> Self
pub const fn can_send_media_messages(self, can_send: bool) -> Self
Configures if the user can send media messages.
sourcepub const fn can_send_polls(self, can_send: bool) -> Self
pub const fn can_send_polls(self, can_send: bool) -> Self
Configures if the user can send polls.
sourcepub const fn can_send_other_messages(self, can_send: bool) -> Self
pub const fn can_send_other_messages(self, can_send: bool) -> Self
Configures if the user can send other messages not covered by other permissions.
sourcepub const fn can_add_web_page_previews(self, can_add: bool) -> Self
pub const fn can_add_web_page_previews(self, can_add: bool) -> Self
Configures if the user can add webpage previews.
sourcepub const fn can_change_info(self, can_change: bool) -> Self
pub const fn can_change_info(self, can_change: bool) -> Self
Configures if the user can change chat information.
sourcepub const fn can_invite_users(self, can_invite: bool) -> Self
pub const fn can_invite_users(self, can_invite: bool) -> Self
Configures if the user can invite new users to the chat.
sourcepub const fn can_pin_messages(self, can_pin: bool) -> Self
pub const fn can_pin_messages(self, can_pin: bool) -> Self
Configures if the user can pin messages.
Trait Implementations§
source§impl Clone for Permissions
impl Clone for Permissions
source§fn clone(&self) -> Permissions
fn clone(&self) -> Permissions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Permissions
impl Debug for Permissions
source§impl Default for Permissions
impl Default for Permissions
source§fn default() -> Permissions
fn default() -> Permissions
source§impl<'de> Deserialize<'de> for Permissions
impl<'de> Deserialize<'de> for Permissions
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 Permissions
impl Hash for Permissions
source§impl PartialEq<Permissions> for Permissions
impl PartialEq<Permissions> for Permissions
source§fn eq(&self, other: &Permissions) -> bool
fn eq(&self, other: &Permissions) -> bool
self
and other
values to be equal, and is used
by ==
.