Struct grammers_client::types::chats::BannedRightsBuilder
source · pub struct BannedRightsBuilder<F: Future<Output = Result<(), InvocationError>>> { /* private fields */ }
Expand description
Builder for editing the rights of a non-admin user in a specific chat.
Certain groups (small group chats) only allow banning (disallow view_messages
). Trying to
disallow other permissions in these groups will fail.
Use Client::set_banned_rights
to retrieve an instance of this type.
Implementations§
source§impl<F: Future<Output = Result<(), InvocationError>>> BannedRightsBuilder<F>
impl<F: Future<Output = Result<(), InvocationError>>> BannedRightsBuilder<F>
sourcepub async fn load_current(self) -> Result<Self, InvocationError>
pub async fn load_current(self) -> Result<Self, InvocationError>
Load the current rights of the user. This lets you trivially grant or take away specific permissions without changing any of the previous ones.
sourcepub fn view_messages(self, val: bool) -> Self
pub fn view_messages(self, val: bool) -> Self
Whether the user is able to view messages or not. Forbidding someone from viewing messages effectively bans (kicks) them.
sourcepub fn send_messages(self, val: bool) -> Self
pub fn send_messages(self, val: bool) -> Self
Whether the user is able to send messages or not. The user will remain in the chat, and can still read the conversation.
sourcepub fn send_media(self, val: bool) -> Self
pub fn send_media(self, val: bool) -> Self
Whether the user is able to send any form of media or not, such as photos or voice notes.
sourcepub fn send_stickers(self, val: bool) -> Self
pub fn send_stickers(self, val: bool) -> Self
Whether the user is able to send stickers or not.
sourcepub fn send_gifs(self, val: bool) -> Self
pub fn send_gifs(self, val: bool) -> Self
Whether the user is able to send animated gifs or not.
sourcepub fn send_games(self, val: bool) -> Self
pub fn send_games(self, val: bool) -> Self
Whether the user is able to send games or not.
sourcepub fn send_inline(self, val: bool) -> Self
pub fn send_inline(self, val: bool) -> Self
Whether the user is able to use inline bots or not.
sourcepub fn embed_link_previews(self, val: bool) -> Self
pub fn embed_link_previews(self, val: bool) -> Self
Whether the user is able to enable the link preview in the messages they send.
Note that the user will still be able to send messages with links if this permission is taken away from the user, but these links won’t display a link preview.
sourcepub fn send_polls(self, val: bool) -> Self
pub fn send_polls(self, val: bool) -> Self
Whether the user is able to send polls or not.
sourcepub fn change_info(self, val: bool) -> Self
pub fn change_info(self, val: bool) -> Self
Whether the user is able to change information about the chat such as group description or not.
sourcepub fn invite_users(self, val: bool) -> Self
pub fn invite_users(self, val: bool) -> Self
Whether the user is able to invite other users or not.
sourcepub fn pin_messages(self, val: bool) -> Self
pub fn pin_messages(self, val: bool) -> Self
Whether the user is able to pin messages or not.
Trait Implementations§
source§impl<F: Future<Output = Result<(), InvocationError>>> Future for BannedRightsBuilder<F>
impl<F: Future<Output = Result<(), InvocationError>>> Future for BannedRightsBuilder<F>
§type Output = Result<(), InvocationError>
type Output = Result<(), InvocationError>
impl<'__pin, F: Future<Output = Result<(), InvocationError>>> Unpin for BannedRightsBuilder<F>where
__Origin<'__pin, F>: Unpin,
Auto Trait Implementations§
impl<F> Freeze for BannedRightsBuilder<F>where
F: Freeze,
impl<F> !RefUnwindSafe for BannedRightsBuilder<F>
impl<F> Send for BannedRightsBuilder<F>where
F: Send,
impl<F> Sync for BannedRightsBuilder<F>where
F: Sync,
impl<F> !UnwindSafe for BannedRightsBuilder<F>
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> FutureExt for T
impl<T> FutureExt for T
source§fn map<U, F>(self, f: F) -> Map<Self, F>
fn map<U, F>(self, f: F) -> Map<Self, F>
source§fn map_into<U>(self) -> MapInto<Self, U>
fn map_into<U>(self) -> MapInto<Self, U>
source§fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
f
. Read moresource§fn left_future<B>(self) -> Either<Self, B>
fn left_future<B>(self) -> Either<Self, B>
source§fn right_future<A>(self) -> Either<A, Self>
fn right_future<A>(self) -> Either<A, Self>
source§fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
source§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
source§fn flatten_stream(self) -> FlattenStream<Self>
fn flatten_stream(self) -> FlattenStream<Self>
source§fn fuse(self) -> Fuse<Self>where
Self: Sized,
fn fuse(self) -> Fuse<Self>where
Self: Sized,
poll
will never again be called once it has
completed. This method can be used to turn any Future
into a
FusedFuture
. Read moresource§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
source§fn boxed<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'a>>
fn boxed<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'a>>
source§fn boxed_local<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a>>where
Self: Sized + 'a,
fn boxed_local<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a>>where
Self: Sized + 'a,
source§fn unit_error(self) -> UnitError<Self>where
Self: Sized,
fn unit_error(self) -> UnitError<Self>where
Self: Sized,
Future<Output = T>
into a
TryFuture<Ok = T, Error = ()
>.source§fn never_error(self) -> NeverError<Self>where
Self: Sized,
fn never_error(self) -> NeverError<Self>where
Self: Sized,
Future<Output = T>
into a
TryFuture<Ok = T, Error = Never
>.