Add BotCommand::bot_commands

This commit is contained in:
Hirrolot 2022-02-05 02:18:47 +06:00
parent bde566825f
commit 07b844db99
3 changed files with 6 additions and 1 deletions

View file

@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## unreleased ## unreleased
### Added
- `BotCommand::bot_commands` to obtain Telegram API commands ([issue 262](https://github.com/teloxide/teloxide/issues/262)).
### Changed ### Changed
- Require that `AsUpdateStream::Stream` is `Send` - Require that `AsUpdateStream::Stream` is `Send`

View file

@ -58,7 +58,7 @@ full = [
[dependencies] [dependencies]
teloxide-core = { version = "0.4", default-features = false } teloxide-core = { version = "0.4", default-features = false }
teloxide-macros = { git = "https://github.com/teloxide/teloxide-macros.git", rev = "57d3e266fa25a6ee2ccbfe140016cdb5d3223147", optional = true } teloxide-macros = { git = "https://github.com/teloxide/teloxide-macros.git", optional = true }
serde_json = "1.0" serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }

View file

@ -212,6 +212,7 @@ pub trait BotCommand: Sized {
fn ty() -> PhantomData<Self> { fn ty() -> PhantomData<Self> {
PhantomData PhantomData
} }
fn bot_commands() -> Vec<crate::types::BotCommand>;
} }
pub type PrefixedBotCommand = String; pub type PrefixedBotCommand = String;