pub struct RestrictChatMember {
pub chat_id: Recipient,
pub user_id: UserId,
pub permissions: ChatPermissions,
pub use_independent_chat_permissions: Option<bool>,
pub until_date: Option<DateTime<Utc>>,
}Expand description
Use this method to restrict 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. Pass True for all permissions to lift restrictions from a user. Returns True on success.
Fields§
§chat_id: RecipientUnique identifier for the target chat or username of the target channel (in the format @channelusername)
user_id: UserIdUnique identifier of the target user
permissions: ChatPermissionsA JSON-serialized object for new user permissions
use_independent_chat_permissions: Option<bool>Pass True if chat permissions are set independently. Otherwise, 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.
until_date: Option<DateTime<Utc>>Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever
Implementations§
Source§impl RestrictChatMember
impl RestrictChatMember
pub fn new( chat_id: impl Into<Recipient>, user_id: UserId, permissions: ChatPermissions, ) -> RestrictChatMember ⓘ
Trait Implementations§
Source§impl Clone for RestrictChatMember
impl Clone for 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 Hash for RestrictChatMember
impl Hash for RestrictChatMember
Source§impl PartialEq for RestrictChatMember
impl PartialEq for RestrictChatMember
Source§impl Payload for RestrictChatMember
impl Payload for RestrictChatMember
Source§fn timeout_hint(&self) -> Option<Duration>
fn timeout_hint(&self) -> Option<Duration>
GetUpdates with
big timeout), the minimum timeout that should be used.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,
impl Eq for RestrictChatMember
impl StructuralPartialEq for RestrictChatMember
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Erasable for T
impl<T> Erasable for T
Source§impl<P> HasPayload for Pwhere
P: Payload,
impl<P> HasPayload for Pwhere
P: Payload,
Source§fn payload_mut(&mut self) -> &mut <P as HasPayload>::Payload
fn payload_mut(&mut self) -> &mut <P as HasPayload>::Payload
Source§fn payload_ref(&self) -> &<P as HasPayload>::Payload
fn payload_ref(&self) -> &<P as HasPayload>::Payload
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<P> RestrictChatMemberSetters for Pwhere
P: HasPayload<Payload = RestrictChatMember>,
impl<P> RestrictChatMemberSetters for Pwhere
P: HasPayload<Payload = RestrictChatMember>,
Source§fn permissions(self, value: ChatPermissions) -> Self
fn permissions(self, value: ChatPermissions) -> Self
permissions field.Source§fn use_independent_chat_permissions(self, value: bool) -> Self
fn use_independent_chat_permissions(self, value: bool) -> Self
use_independent_chat_permissions field.Source§fn until_date<T>(self, value: T) -> Self
fn until_date<T>(self, value: T) -> Self
until_date field.