Struct carapax::types::RestrictChatMember
source · pub struct RestrictChatMember { /* private fields */ }
Expand description
Restricts a user in a supergroup.
The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights.
Implementations§
source§impl RestrictChatMember
impl RestrictChatMember
sourcepub fn new<T>(chat_id: T, user_id: i64) -> RestrictChatMember
pub fn new<T>(chat_id: T, user_id: i64) -> RestrictChatMember
Creates a new RestrictChatMember
.
§Arguments
chat_id
- Unique identifier for the target chat.user_id
- Unique identifier of the target user.
sourcepub fn allow_all(self) -> RestrictChatMember
pub fn allow_all(self) -> RestrictChatMember
Allows everything.
sourcepub fn restrict_all(self) -> RestrictChatMember
pub fn restrict_all(self) -> RestrictChatMember
Restricts everything.
sourcepub fn with_permissions(self, value: ChatPermissions) -> RestrictChatMember
pub fn with_permissions(self, value: ChatPermissions) -> RestrictChatMember
sourcepub fn with_until_date(self, value: i64) -> RestrictChatMember
pub fn with_until_date(self, value: i64) -> RestrictChatMember
Sets a new until date.
§Arguments
- value - The date when restrictions will be lifted for the user, unix time.
If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever.
sourcepub fn with_use_independent_chat_permissions(
self,
value: bool
) -> RestrictChatMember
pub fn with_use_independent_chat_permissions( self, value: bool ) -> RestrictChatMember
Sets a new value for a use_independent_chat_permissions
flag.
§Arguments
value
- Indicates whether the chat permissions are set independently.
If false
, the can_send_other_messages
and can_add_web_page_previews
permissions
will imply the can_send_messages
, can_send_audios
, can_send_documents
,
can_send_photos
, can_send_videos
, can_send_video_notes
,
and can_send_voice_notes
permissions; the can_send_polls
permission
will imply the can_send_messages
permission.
Trait Implementations§
source§impl Clone for RestrictChatMember
impl Clone for RestrictChatMember
source§fn clone(&self) -> RestrictChatMember
fn clone(&self) -> RestrictChatMember
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for RestrictChatMember
impl Debug for RestrictChatMember
source§impl Method for RestrictChatMember
impl Method for RestrictChatMember
source§impl Serialize for RestrictChatMember
impl Serialize for RestrictChatMember
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,
Auto Trait Implementations§
impl Freeze for RestrictChatMember
impl RefUnwindSafe for RestrictChatMember
impl Send for RestrictChatMember
impl Sync for RestrictChatMember
impl Unpin for RestrictChatMember
impl UnwindSafe for RestrictChatMember
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