pub struct SetMyCommands {
pub commands: Vec<BotCommand>,
pub scope: Option<BotCommandScope>,
pub language_code: Option<String>,
}Expand description
Use this method to change the list of the bot’s commands. See https://core.telegram.org/bots#commands for more details about bot commands. Returns True on success.
Fields§
§commands: Vec<BotCommand>A JSON-serialized list of bot commands to be set as the list of the bot’s commands. At most 100 commands can be specified.
scope: Option<BotCommandScope>A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault.
language_code: Option<String>A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands
Implementations§
Source§impl SetMyCommands
impl SetMyCommands
Sourcepub fn new(commands: impl Into<Vec<BotCommand>>) -> Self
pub fn new(commands: impl Into<Vec<BotCommand>>) -> Self
Create a new setMyCommands request
Sourcepub fn with_scope(self, scope: BotCommandScope) -> Self
pub fn with_scope(self, scope: BotCommandScope) -> Self
Set command scope
Sourcepub fn with_language_code(self, language_code: impl Into<String>) -> Self
pub fn with_language_code(self, language_code: impl Into<String>) -> Self
Set language code
Trait Implementations§
Source§impl Clone for SetMyCommands
impl Clone for SetMyCommands
Source§fn clone(&self) -> SetMyCommands
fn clone(&self) -> SetMyCommands
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 Serialize for SetMyCommands
impl Serialize for SetMyCommands
Source§impl TelegramMethod for SetMyCommands
impl TelegramMethod for SetMyCommands
impl JsonMethod for SetMyCommands
Auto Trait Implementations§
impl Freeze for SetMyCommands
impl RefUnwindSafe for SetMyCommands
impl Send for SetMyCommands
impl Sync for SetMyCommands
impl Unpin for SetMyCommands
impl UnwindSafe for SetMyCommands
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