mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-09-23 23:32:05 +00:00
feat: register bot commands with Telegram
Call setMyCommands at startup so clients show the command list in the / menu. handlers::register_commands wraps Command::bot_commands() (teloxide derives it from the #[command(description)] attributes); a registration failure only warns and does not stop the bot.
This commit is contained in:
@@ -44,6 +44,11 @@ async fn main() {
|
||||
|
||||
let bot = Bot::from_env();
|
||||
|
||||
// Register the command list with Telegram (client `/` menu).
|
||||
if let Err(e) = handlers::register_commands(&bot).await {
|
||||
log::warn!("failed to register commands: {e}");
|
||||
}
|
||||
|
||||
log::info!(
|
||||
"config: {} admin(s), edit-message TTL {}s",
|
||||
CONFIG.admin_ids.len(),
|
||||
|
||||
Reference in New Issue
Block a user