Struct teloxide::payloads::RestrictChatMember
source · [−]pub struct RestrictChatMember {
pub chat_id: Recipient,
pub user_id: UserId,
pub permissions: ChatPermissions,
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
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
sourceimpl RestrictChatMember
impl RestrictChatMember
pub fn new(
chat_id: impl Into<Recipient>,
user_id: UserId,
permissions: ChatPermissions
) -> RestrictChatMemberⓘNotable traits for RestrictChatMemberimpl Payload for RestrictChatMember type Output = True;
Trait Implementations
sourceimpl Clone for RestrictChatMember
impl Clone for RestrictChatMember
sourcefn clone(&self) -> RestrictChatMemberⓘNotable traits for RestrictChatMemberimpl Payload for RestrictChatMember type Output = True;
fn clone(&self) -> RestrictChatMemberⓘNotable traits for RestrictChatMemberimpl Payload for RestrictChatMember type Output = True;
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for RestrictChatMember
impl Debug for RestrictChatMember
sourceimpl Hash for RestrictChatMember
impl Hash for RestrictChatMember
sourceimpl PartialEq<RestrictChatMember> for RestrictChatMember
impl PartialEq<RestrictChatMember> for RestrictChatMember
sourcefn eq(&self, other: &RestrictChatMember) -> bool
fn eq(&self, other: &RestrictChatMember) -> bool
sourceimpl Payload for RestrictChatMember
impl Payload for RestrictChatMember
sourcefn timeout_hint(&self) -> Option<Duration>
fn timeout_hint(&self) -> Option<Duration>
If this payload may take long time to execute (e.g.
GetUpdates with
big timeout), the minimum timeout that should be used. Read moresourceimpl Serialize for RestrictChatMember
impl Serialize for RestrictChatMember
sourcefn 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,
Serialize this value into the given Serde serializer. Read more
impl Eq for RestrictChatMember
impl StructuralEq for RestrictChatMember
impl StructuralPartialEq for RestrictChatMember
Auto Trait Implementations
impl RefUnwindSafe for RestrictChatMember
impl Send for RestrictChatMember
impl Sync for RestrictChatMember
impl Unpin for RestrictChatMember
impl UnwindSafe for RestrictChatMember
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> Erasable for T
impl<T> Erasable for T
sourceimpl<P> HasPayload for Pwhere
P: Payload,
impl<P> HasPayload for Pwhere
P: Payload,
type Payload = P
type Payload = P
The type of the payload contained.
sourcefn payload_mut(&mut self) -> &mut <P as HasPayload>::Payload
fn payload_mut(&mut self) -> &mut <P as HasPayload>::Payload
Gain mutable access to the underlying payload.
sourcefn payload_ref(&self) -> &<P as HasPayload>::Payload
fn payload_ref(&self) -> &<P as HasPayload>::Payload
Gain immutable access to the underlying payload.
sourcefn with_payload_mut<F>(self, f: F) -> Selfwhere
F: FnOnce(&mut Self::Payload),
fn with_payload_mut<F>(self, f: F) -> Selfwhere
F: FnOnce(&mut Self::Payload),
Update payload with a function
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<P> RestrictChatMemberSetters for Pwhere
P: HasPayload<Payload = RestrictChatMember>,
impl<P> RestrictChatMemberSetters for Pwhere
P: HasPayload<Payload = RestrictChatMember>,
sourcefn permissions(self, value: ChatPermissions) -> Self
fn permissions(self, value: ChatPermissions) -> Self
Setter for
permissions field.sourcefn until_date<T>(self, value: T) -> Selfwhere
T: Into<DateTime<Utc>>,
fn until_date<T>(self, value: T) -> Selfwhere
T: Into<DateTime<Utc>>,
Setter for
until_date field.