Struct tgbot::types::ChatAdministratorRights
source · pub struct ChatAdministratorRights {Show 15 fields
pub can_change_info: bool,
pub can_delete_messages: bool,
pub can_delete_stories: Option<bool>,
pub can_edit_messages: Option<bool>,
pub can_edit_stories: Option<bool>,
pub can_invite_users: bool,
pub can_manage_chat: bool,
pub can_manage_topics: Option<bool>,
pub can_manage_video_chats: bool,
pub can_pin_messages: Option<bool>,
pub can_post_messages: Option<bool>,
pub can_post_stories: Option<bool>,
pub can_promote_members: bool,
pub can_restrict_members: bool,
pub is_anonymous: bool,
}
Expand description
Represents the rights of an administrator in a chat.
Fields§
§can_change_info: bool
Indicates whether the user is allowed to change the chat title, photo and other settings.
can_delete_messages: bool
Indicates whether the administrator can delete messages of other users.
can_delete_stories: Option<bool>
Indicates whether the administrator can delete stories posted by other users.
can_edit_messages: Option<bool>
Indicates whether the administrator can edit messages of other users and can pin messages; channels only.
can_edit_stories: Option<bool>
Indicates whether the administrator can edit stories posted by other users.
can_invite_users: bool
Indicates whether the user is allowed to invite new users to the chat.
can_manage_chat: bool
Indicates whether the administrator can access the chat event log, boost list in channels, see channel members, report spam messages, see anonymous administrators in supergroups and ignore slow mode.
Implied by any other administrator privilege.
can_manage_topics: Option<bool>
Indicates whether the user is allowed to create, rename, close, and reopen forum topics; supergroups only.
can_manage_video_chats: bool
Indicates whether the administrator can manage video chats.
can_pin_messages: Option<bool>
Indicates whether the user is allowed to pin messages; groups and supergroups only.
can_post_messages: Option<bool>
Indicates whether the administrator can post messages in the channel, or access channel statistics; channels only.
can_post_stories: Option<bool>
Indicates whether the administrator can post stories in the chat.
can_promote_members: bool
Indicates whether the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user).
can_restrict_members: bool
Indicates whether the administrator can restrict, ban or unban chat members, or access supergroup statistics.
is_anonymous: bool
Indicates whether the user’s presence in the chat is hidden.
Implementations§
source§impl ChatAdministratorRights
impl ChatAdministratorRights
sourcepub fn all() -> Self
pub fn all() -> Self
Creates a new ChatAdministratorRights
with all flags set to true
.
To create an object with all flags set to false
use Self::default
method.
sourcepub fn with_can_change_info(self, value: bool) -> Self
pub fn with_can_change_info(self, value: bool) -> Self
Sets a new value for a can_change_info
flag.
§Arguments
value
- Indicates whether the user is allowed to change the chat title, photo and other settings.
sourcepub fn with_can_delete_messages(self, value: bool) -> Self
pub fn with_can_delete_messages(self, value: bool) -> Self
Sets a new value for a can_delete_messages
flag.
§Arguments
value
- Indicates whether the administrator can delete messages of other users.
sourcepub fn with_can_delete_stories(self, value: bool) -> Self
pub fn with_can_delete_stories(self, value: bool) -> Self
Sets a new value for a can_delete_stories
flag.
§Arguments
value
- Indicates whether the administrator can delete stories posted by other users; channels only.
sourcepub fn with_can_edit_messages(self, value: bool) -> Self
pub fn with_can_edit_messages(self, value: bool) -> Self
Sets a new value for a can_edit_messages
flag.
§Arguments
value
- Indicates whether the administrator can edit messages of other users and can pin messages; channels only.
sourcepub fn with_can_edit_stories(self, value: bool) -> Self
pub fn with_can_edit_stories(self, value: bool) -> Self
Sets a new value for a can_edit_stories
flag.
§Arguments
value
- Indicates whether the administrator can edit stories posted by other users; channels only.
sourcepub fn with_can_invite_users(self, value: bool) -> Self
pub fn with_can_invite_users(self, value: bool) -> Self
Sets a new value for a can_invite_users
flag.
§Arguments
value
- Indicates whether the user is allowed to invite new users to the chat.
sourcepub fn with_can_manage_chat(self, value: bool) -> Self
pub fn with_can_manage_chat(self, value: bool) -> Self
Sets a new value for a can_manage_chat
flag.
§Arguments
value
- Indicates whether the administrator can access the chat event log, boost list in channels, see channel members, report spam messages, see anonymous administrators in supergroups and ignore slow mode.
sourcepub fn with_can_manage_topics(self, value: bool) -> Self
pub fn with_can_manage_topics(self, value: bool) -> Self
Sets a new value for a can_manage_topics
flag.
§Arguments
value
- Indicates whether the user is allowed to create, rename, close, and reopen forum topics; supergroups only.
sourcepub fn with_can_manage_video_chats(self, value: bool) -> Self
pub fn with_can_manage_video_chats(self, value: bool) -> Self
Sets a new value for a can_manage_video_chats
flag.
§Arguments
value
- Indicates whether the administrator can manage video chats.
sourcepub fn with_can_pin_messages(self, value: bool) -> Self
pub fn with_can_pin_messages(self, value: bool) -> Self
Sets a new value for a can_pin_messages
flag.
§Arguments
value
- Indicates whether the user is allowed to pin messages; groups and supergroups only.
sourcepub fn with_can_post_messages(self, value: bool) -> Self
pub fn with_can_post_messages(self, value: bool) -> Self
Sets a new value for a can_post_messages
flag.
§Arguments
value
- Indicates whether the administrator can post messages in the channel, or access channel statistics; channels only.
sourcepub fn with_can_post_stories(self, value: bool) -> Self
pub fn with_can_post_stories(self, value: bool) -> Self
Sets a new value for a can_post_stories
flag.
§Arguments
value
- Indicates whether the administrator can post stories in the channel; channels only.
sourcepub fn with_can_promote_members(self, value: bool) -> Self
pub fn with_can_promote_members(self, value: bool) -> Self
Sets a new value for a can_promote_members
flag.
§Arguments
value
- Indicates whether the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user).
sourcepub fn with_can_restrict_members(self, value: bool) -> Self
pub fn with_can_restrict_members(self, value: bool) -> Self
Sets a new value for a can_restrict_members
flag.
§Arguments
value
- Indicates whether the administrator can restrict, ban or unban chat members, or access supergroup statistics.
sourcepub fn with_is_anonymous(self, value: bool) -> Self
pub fn with_is_anonymous(self, value: bool) -> Self
Sets a new value for a is_anonymous
flag.
§Arguments
value
- Indicates whether the user’s presence in the chat is hidden.
Trait Implementations§
source§impl Clone for ChatAdministratorRights
impl Clone for ChatAdministratorRights
source§fn clone(&self) -> ChatAdministratorRights
fn clone(&self) -> ChatAdministratorRights
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ChatAdministratorRights
impl Debug for ChatAdministratorRights
source§impl Default for ChatAdministratorRights
impl Default for ChatAdministratorRights
source§fn default() -> ChatAdministratorRights
fn default() -> ChatAdministratorRights
source§impl<'de> Deserialize<'de> for ChatAdministratorRights
impl<'de> Deserialize<'de> for ChatAdministratorRights
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 PartialEq for ChatAdministratorRights
impl PartialEq for ChatAdministratorRights
source§fn eq(&self, other: &ChatAdministratorRights) -> bool
fn eq(&self, other: &ChatAdministratorRights) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ChatAdministratorRights
impl PartialOrd for ChatAdministratorRights
source§fn partial_cmp(&self, other: &ChatAdministratorRights) -> Option<Ordering>
fn partial_cmp(&self, other: &ChatAdministratorRights) -> 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 more