Provide method to get Vec<types::BotCommand>
for set_my_commands()
#262
Labels
feature-accepted
Feature Request or Proposal was accepted by maintainers and will be implemented
K-enhancement
Kind: enchantment (new feature or request)
The Telegram API offers the set_my_commands method to set the current commands automatically instead of manually through the BotFather.
This API endpoint is already implemented in the crate (docs) but it accepts a
Vec<types::BotCommand>
. Currently a user of the library would need to construct these BotCommands themselves. I propose to add a method to the utils::command::BotCommand trait (maybecommands(&self) -> Vec<BotCommand>
) which returns a Vec of these BotCommands that can be sent to the API.This would allow a user of the library to have the BotCommand enum declaration as the single source of truth and automatically send the correct command information to the API via
set_my_command
.The text was updated successfully, but these errors were encountered: