Struct tgbot::types::PromoteChatMember
source · pub struct PromoteChatMember { /* private fields */ }
Expand description
Promotes or demotes a user in a chat.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Implementations§
source§impl PromoteChatMember
impl PromoteChatMember
sourcepub fn new<T>(chat_id: T, user_id: Integer) -> Self
pub fn new<T>(chat_id: T, user_id: Integer) -> Self
Creates a new PromoteChatMember
§Arguments
chat_id
- Unique identifier of the target chat.user_id
- Unique identifier of the target user.
sourcepub fn promote_all(self) -> Self
pub fn promote_all(self) -> Self
Promotes all privileges.
sourcepub fn demote_all(self) -> Self
pub fn demote_all(self) -> Self
Demotes all privileges.
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 administrator can change 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 administrator can 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, 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) -> Self
pub fn with_can_manage_topics(self, value: bool) -> Self
Sets a new value for a can_manage_topics
flag.
§Arguments
- value - 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; supergroups only.
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 administrator can pin messages; 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 create channel posts; 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 his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him).
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.
sourcepub fn with_is_anonymous(self, value: bool) -> Self
pub fn with_is_anonymous(self, value: bool) -> Self
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 PromoteChatMember
impl Clone for PromoteChatMember
source§fn clone(&self) -> PromoteChatMember
fn clone(&self) -> PromoteChatMember
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PromoteChatMember
impl Debug for PromoteChatMember
source§impl Method for PromoteChatMember
impl Method for PromoteChatMember
Auto Trait Implementations§
impl Freeze for PromoteChatMember
impl RefUnwindSafe for PromoteChatMember
impl Send for PromoteChatMember
impl Sync for PromoteChatMember
impl Unpin for PromoteChatMember
impl UnwindSafe for PromoteChatMember
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