Enum carapax::types::BotCommandScope
source · pub enum BotCommandScope {
AllChatAdministrators,
AllGroupChats,
AllPrivateChats,
Chat {
chat_id: ChatId,
},
ChatAdministrators {
chat_id: ChatId,
},
ChatMember {
chat_id: ChatId,
user_id: i64,
},
Default,
}
Expand description
Represents a scope to which bot commands are applied.
Variants§
AllChatAdministrators
All group and supergroup chat administrators.
AllGroupChats
All group and supergroup chats.
AllPrivateChats
All private chats.
Chat
A specific chat.
ChatAdministrators
All administrators of a specific group or supergroup chat.
ChatMember
A specific member of a group or supergroup chat.
Fields
Default
Default scope.
Default commands are used if no commands with a narrower scope are specified for a user.
Implementations§
source§impl BotCommandScope
impl BotCommandScope
sourcepub fn chat<T>(value: T) -> BotCommandScope
pub fn chat<T>(value: T) -> BotCommandScope
sourcepub fn chat_administrators<T>(value: T) -> BotCommandScope
pub fn chat_administrators<T>(value: T) -> BotCommandScope
Creates a new BotCommandScope
covering all administrators
of a specific group or supergroup chat.
§Arguments
value
- Chat ID.
sourcepub fn chat_member<A>(chat_id: A, user_id: i64) -> BotCommandScope
pub fn chat_member<A>(chat_id: A, user_id: i64) -> BotCommandScope
Creates a new BotCommandScope
covering a specific member of a group or supergroup chat.
§Arguments
chat_id
- Chat ID.user_id
- User ID.
Trait Implementations§
source§impl Clone for BotCommandScope
impl Clone for BotCommandScope
source§fn clone(&self) -> BotCommandScope
fn clone(&self) -> BotCommandScope
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 BotCommandScope
impl Debug for BotCommandScope
source§impl<'de> Deserialize<'de> for BotCommandScope
impl<'de> Deserialize<'de> for BotCommandScope
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<BotCommandScope, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<BotCommandScope, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for BotCommandScope
impl PartialEq for BotCommandScope
source§fn eq(&self, other: &BotCommandScope) -> bool
fn eq(&self, other: &BotCommandScope) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for BotCommandScope
impl PartialOrd for BotCommandScope
source§fn partial_cmp(&self, other: &BotCommandScope) -> Option<Ordering>
fn partial_cmp(&self, other: &BotCommandScope) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for BotCommandScope
impl Serialize for BotCommandScope
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,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for BotCommandScope
Auto Trait Implementations§
impl Freeze for BotCommandScope
impl RefUnwindSafe for BotCommandScope
impl Send for BotCommandScope
impl Sync for BotCommandScope
impl Unpin for BotCommandScope
impl UnwindSafe for BotCommandScope
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> 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>
Converts
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>
Converts
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