Struct tbot::types::chat::Permissions[][src]

#[non_exhaustive]
#[must_use]
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>, }

Describes actions that a non-administrator user is allowed to take in a chat.

This struct is a representation of ChatPermissions.

Fields (Non-exhaustive)

Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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

impl Permissions[src]

pub fn new() -> Self[src]

Constructs Permissions with all fields set to None.

pub const fn can_send_messages(self, can_send: bool) -> Self[src]

Configures if the user can send messages.

pub const fn can_send_media_messages(self, can_send: bool) -> Self[src]

Configures if the user can send media messages.

pub const fn can_send_polls(self, can_send: bool) -> Self[src]

Configures if the user can send polls.

pub const fn can_send_other_messages(self, can_send: bool) -> Self[src]

Configures if the user can send other messages not covered by other permissions.

pub const fn can_add_web_page_previews(self, can_add: bool) -> Self[src]

Configures if the user can add webpage previews.

pub const fn can_change_info(self, can_change: bool) -> Self[src]

Configures if the user can change chat information.

pub const fn can_invite_users(self, can_invite: bool) -> Self[src]

Configures if the user can invite new users to the chat.

pub const fn can_pin_messages(self, can_pin: bool) -> Self[src]

Configures if the user can pin messages.

Trait Implementations

impl Clone for Permissions[src]

impl Debug for Permissions[src]

impl Default for Permissions[src]

impl<'de> Deserialize<'de> for Permissions[src]

impl Hash for Permissions[src]

impl PartialEq<Permissions> for Permissions[src]

impl Serialize for Permissions[src]

impl Copy for Permissions[src]

impl Eq for Permissions[src]

impl StructuralEq for Permissions[src]

impl StructuralPartialEq for Permissions[src]

Auto Trait Implementations

impl RefUnwindSafe for Permissions

impl Send for Permissions

impl Sync for Permissions

impl Unpin for Permissions

impl UnwindSafe for Permissions

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

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