From c28606b80884a1ea218cb71dca3dfb2574835cf1 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 30 Apr 2026 18:58:23 +0000 Subject: [PATCH] fix(telegram): bind supported_commands() to local var to avoid duplicate call https://claude.ai/code/session_01A3PgAuXiQFNJBZ4ZJyMbme --- src/platform/telegram.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/platform/telegram.rs b/src/platform/telegram.rs index 23fe48f..2026c63 100644 --- a/src/platform/telegram.rs +++ b/src/platform/telegram.rs @@ -72,11 +72,10 @@ pub async fn run( // Publish the slash-command menu to Telegram so clients show suggestions. // Best-effort: a network failure here must not block the bot from running. - match bot.set_my_commands(supported_commands()).await { - Ok(_) => info!( - "Registered {} Telegram commands", - supported_commands().len() - ), + let commands = supported_commands(); + let count = commands.len(); + match bot.set_my_commands(commands).await { + Ok(_) => info!("Registered {} Telegram commands", count), Err(e) => warn!(error = %e, "Failed to register Telegram commands"), }