Struct carapax::types::ChatMemberAdministrator
source · pub struct ChatMemberAdministrator {Show 18 fields
pub user: User,
pub can_be_edited: bool,
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 custom_title: Option<String>,
pub is_anonymous: bool,
}
Expand description
Represents a chat administrator.
Fields§
§user: User
Information about the user.
can_be_edited: bool
Indicates whether a bot is allowed to edit administrator privileges of that user.
can_change_info: bool
Indicates whether the administrator can 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; channels only.
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; channels only.
can_invite_users: bool
Indicates whether the administrator can invite new users to the chat.
can_manage_chat: bool
Indicates whether the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode; implied by any other administrator privilege.
can_manage_topics: Option<bool>
Indicates whether the administrator 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 administrator can pin messages; groups and supergroups only.
can_post_messages: Option<bool>
Indicates whether the administrator can post in the channel; channels only.
can_post_stories: Option<bool>
Indicates whether the administrator can post stories in the channel; channels only.
can_promote_members: bool
Indicates whether the administrator can add new administrators with a subset of his own privileges or demote administrators that he has 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.
custom_title: Option<String>
Custom title for the administrator.
is_anonymous: bool
Indicates whether the administrator’s presence in the chat is hidden.
Implementations§
source§impl ChatMemberAdministrator
impl ChatMemberAdministrator
sourcepub fn new(user: User) -> ChatMemberAdministrator
pub fn new(user: User) -> ChatMemberAdministrator
sourcepub fn with_can_be_edited(self, value: bool) -> ChatMemberAdministrator
pub fn with_can_be_edited(self, value: bool) -> ChatMemberAdministrator
Sets a new value for a can_be_edited
flag.
§Arguments
value
- Indicates whether a bot is allowed to edit privileges of that administrator.
sourcepub fn with_can_change_info(self, value: bool) -> ChatMemberAdministrator
pub fn with_can_change_info(self, value: bool) -> ChatMemberAdministrator
Sets a new value for a can_change_info
flag.
§Arguments
value
- Indicates whether the administrator can change the chat title, photo and other settings.
sourcepub fn with_can_delete_messages(self, value: bool) -> ChatMemberAdministrator
pub fn with_can_delete_messages(self, value: bool) -> ChatMemberAdministrator
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) -> ChatMemberAdministrator
pub fn with_can_delete_stories(self, value: bool) -> ChatMemberAdministrator
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) -> ChatMemberAdministrator
pub fn with_can_edit_messages(self, value: bool) -> ChatMemberAdministrator
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) -> ChatMemberAdministrator
pub fn with_can_edit_stories(self, value: bool) -> ChatMemberAdministrator
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) -> ChatMemberAdministrator
pub fn with_can_invite_users(self, value: bool) -> ChatMemberAdministrator
Sets a new value for a can_invite_users
flag.
§Arguments
value
- Indicates whether the administrator can invite new users to the chat.
sourcepub fn with_can_manage_chat(self, value: bool) -> ChatMemberAdministrator
pub fn with_can_manage_chat(self, value: bool) -> ChatMemberAdministrator
Sets a new value for a can_manage_chat
flag.
§Arguments
value
- Indicates whether the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode; implied by any other administrator privilege.
sourcepub fn with_can_manage_topics(self, value: bool) -> ChatMemberAdministrator
pub fn with_can_manage_topics(self, value: bool) -> ChatMemberAdministrator
Sets a new value for a can_manage_topics
flag.
§Arguments
- value - Indicates whether the administrator is allowed to create, rename, close, and reopen forum topics; supergroups only.
sourcepub fn with_can_manage_video_chats(self, value: bool) -> ChatMemberAdministrator
pub fn with_can_manage_video_chats(self, value: bool) -> ChatMemberAdministrator
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) -> ChatMemberAdministrator
pub fn with_can_pin_messages(self, value: bool) -> ChatMemberAdministrator
Sets a new value for a can_pin_messages
flag.
§Arguments
value
- Indicates whether the administrator can pin messages; groups and supergroups only.
sourcepub fn with_can_post_messages(self, value: bool) -> ChatMemberAdministrator
pub fn with_can_post_messages(self, value: bool) -> ChatMemberAdministrator
Sets a new value for a can_post_messages
flag.
§Arguments
value
- Indicates whether the administrator can post in the channel; channels only.
sourcepub fn with_can_post_stories(self, value: bool) -> ChatMemberAdministrator
pub fn with_can_post_stories(self, value: bool) -> ChatMemberAdministrator
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) -> ChatMemberAdministrator
pub fn with_can_promote_members(self, value: bool) -> ChatMemberAdministrator
Sets a new value for a can_promote_members
flag.
§Arguments
value
- Indicates whether the administrator can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user).
sourcepub fn with_can_restrict_members(self, value: bool) -> ChatMemberAdministrator
pub fn with_can_restrict_members(self, value: bool) -> ChatMemberAdministrator
Sets a new value for a can_restrict_members
flag.
§Arguments
value
- Indicates whether the administrator can restrict, ban or unban chat members.
sourcepub fn with_custom_title<T>(self, value: T) -> ChatMemberAdministrator
pub fn with_custom_title<T>(self, value: T) -> ChatMemberAdministrator
sourcepub fn with_is_anonymous(self, value: bool) -> ChatMemberAdministrator
pub fn with_is_anonymous(self, value: bool) -> ChatMemberAdministrator
Sets a new value for an is_anonymous
flag.
§Arguments
value
- Indicates whether the administrator’s presence in the chat is hidden.
Trait Implementations§
source§impl Clone for ChatMemberAdministrator
impl Clone for ChatMemberAdministrator
source§fn clone(&self) -> ChatMemberAdministrator
fn clone(&self) -> ChatMemberAdministrator
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ChatMemberAdministrator
impl Debug for ChatMemberAdministrator
source§impl<'de> Deserialize<'de> for ChatMemberAdministrator
impl<'de> Deserialize<'de> for ChatMemberAdministrator
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<ChatMemberAdministrator, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<ChatMemberAdministrator, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for ChatMemberAdministrator
impl PartialEq for ChatMemberAdministrator
source§fn eq(&self, other: &ChatMemberAdministrator) -> bool
fn eq(&self, other: &ChatMemberAdministrator) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ChatMemberAdministrator
impl PartialOrd for ChatMemberAdministrator
source§fn partial_cmp(&self, other: &ChatMemberAdministrator) -> Option<Ordering>
fn partial_cmp(&self, other: &ChatMemberAdministrator) -> 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 ChatMemberAdministrator
impl Serialize for ChatMemberAdministrator
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 ChatMemberAdministrator
Auto Trait Implementations§
impl Freeze for ChatMemberAdministrator
impl RefUnwindSafe for ChatMemberAdministrator
impl Send for ChatMemberAdministrator
impl Sync for ChatMemberAdministrator
impl Unpin for ChatMemberAdministrator
impl UnwindSafe for ChatMemberAdministrator
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