Struct telexide::api::types::RestrictChatMember
source · pub struct RestrictChatMember {
pub chat_id: IntegerOrString,
pub user_id: i64,
pub permissions: ChatPermissions,
pub use_independent_chat_permissions: Option<bool>,
pub until_date: Option<DateTime<Utc>>,
}
Expand description
struct for holding data needed to call
restrict_chat_member
Fields§
§chat_id: IntegerOrString
Unique identifier for the target chat
user_id: i64
Unique identifier of the target user
permissions: ChatPermissions
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: IntegerOrString, user_id: i64, permissions: ChatPermissions ) -> Self
pub fn set_use_independent_chat_permissions( &mut self, use_independent_chat_permissions: bool ) -> &mut Self
pub fn set_until_date(&mut self, until_date: DateTime<Utc>) -> &mut Self
Trait Implementations§
source§impl Clone for RestrictChatMember
impl Clone for RestrictChatMember
source§fn clone(&self) -> RestrictChatMember
fn clone(&self) -> RestrictChatMember
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for RestrictChatMember
impl Debug for RestrictChatMember
source§impl<'de> Deserialize<'de> for RestrictChatMember
impl<'de> Deserialize<'de> for RestrictChatMember
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for RestrictChatMember
impl PartialEq for RestrictChatMember
source§fn eq(&self, other: &RestrictChatMember) -> bool
fn eq(&self, other: &RestrictChatMember) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for RestrictChatMember
impl Serialize for RestrictChatMember
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§
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
impl<T> CloneDebuggableStorage for Twhere T: DebuggableStorage + Clone,
fn clone_storage(&self) -> Box<dyn CloneDebuggableStorage>
source§impl<T> CloneableStorage for Twhere
T: Any + Send + Sync + Clone,
impl<T> CloneableStorage for Twhere T: Any + Send + Sync + Clone,
fn clone_storage(&self) -> Box<dyn CloneableStorage>
§impl<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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.