pub enum BotCommandScope {
Default,
AllPrivateChats,
AllGroupChats,
AllChatAdministrators,
Chat {
chat_id: Recipient,
},
ChatAdministrators {
chat_id: Recipient,
},
ChatMember {
chat_id: Recipient,
user_id: UserId,
},
}
Expand description
This object represents the scope to which bot commands are applied.
§Determining list of commands
The following algorithm is used to determine the list of commands for a particular user viewing the bot menu. The first list of commands which is set is returned:
§Commands in the chat with the bot
Chat
+language_code
Chat
AllPrivateChats
+language_code
AllPrivateChats
Default
+language_code
Default
§Commands in group and supergroup chats
ChatMember
+language_code
ChatMember
ChatAdministrators
+language_code
(admins only)ChatAdministrators
(admins only)Chat
+language_code
Chat
AllChatAdministrators
+language_code
(admins only)AllChatAdministrators
(admins only)AllGroupChats
+language_code
AllGroupChats
Default
+language_code
Default
Variants§
Trait Implementations§
Source§impl Clone for BotCommandScope
impl Clone for BotCommandScope
Source§fn clone(&self) -> BotCommandScope
fn clone(&self) -> BotCommandScope
Returns a duplicate 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<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 Hash for BotCommandScope
impl Hash for BotCommandScope
Source§impl PartialEq for BotCommandScope
impl PartialEq for BotCommandScope
Source§impl Serialize for BotCommandScope
impl Serialize for BotCommandScope
impl Eq for BotCommandScope
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Erasable for T
impl<T> Erasable for T
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