Merge pull request #95 from teloxide/get_set_my_commands_ret_fixt

Fix rt-tys of `{get,set}_my_commands` methods
This commit is contained in:
Waffle Lapkin 2021-06-24 20:56:40 +03:00 committed by GitHub
commit ec2dc01993
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -8,12 +8,14 @@
// [`schema`]: https://github.com/WaffleLapkin/tg-methods-schema
use serde::Serialize;
use crate::types::BotCommand;
impl_payload! {
/// Use this method to get the current list of the bot's commands. Requires no parameters. Returns Array of [`BotCommand`] on success.
///
/// [`BotCommand`]: crate::types::BotCommand
#[derive(Debug, PartialEq, Eq, Hash, Default, Clone, Serialize)]
pub GetMyCommands (GetMyCommandsSetters) => u32 {
pub GetMyCommands (GetMyCommandsSetters) => Vec<BotCommand> {
}
}

View file

@ -8,12 +8,12 @@
// [`schema`]: https://github.com/WaffleLapkin/tg-methods-schema
use serde::Serialize;
use crate::types::BotCommand;
use crate::types::{BotCommand, True};
impl_payload! {
/// Use this method to change the list of the bot's commands. Returns _True_ on success.
#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
pub SetMyCommands (SetMyCommandsSetters) => u32 {
pub SetMyCommands (SetMyCommandsSetters) => True {
required {
/// 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.
pub commands: Vec<BotCommand> [collect],