this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(bot): register commands with Telegram on startup

Sets the command menu programmatically via setMyCommands, keeping
BotFather in sync with actual handlers. Removes unused /dump, /focus,
/wins commands until those features are implemented.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

alice 55c9a9ad 5d91e937

+30 -1
+22
src/bot.ts
··· 411 411 } 412 412 413 413 /** 414 + * Register bot commands with Telegram 415 + * 416 + * Sets the command menu that appears in the Telegram UI. 417 + * Called on startup to keep BotFather commands in sync with code. 418 + * 419 + * TODO: Add command handlers for /dump, /focus, /wins when those features are ready: 420 + * - /dump - Brain dump mode (capture unstructured thoughts) 421 + * - /focus - Set current focus task 422 + * - /wins - Show recent tiny wins 423 + */ 424 + export async function registerCommands(): Promise<void> { 425 + const commands = [ 426 + { command: 'start', description: 'Start the bot' }, 427 + { command: 'help', description: 'Show help' }, 428 + { command: 'reset', description: 'Reset conversation (delete agent memory)' }, 429 + ]; 430 + 431 + await bot.telegram.setMyCommands(commands); 432 + console.log(`Registered ${String(commands.length)} bot commands with Telegram`); 433 + } 434 + 435 + /** 414 436 * Register webhook with Telegram 415 437 * 416 438 * Called on startup when webhook mode is enabled.
+8 -1
src/index.ts
··· 12 12 import { config, isWebhookMode } from './config'; 13 13 import { healthCheck, simpleHealthCheck } from './health'; 14 14 import { initializeLetta } from './letta'; 15 - import { handleUpdate, startPolling, registerWebhook } from './bot'; 15 + import { handleUpdate, startPolling, registerWebhook, registerCommands } from './bot'; 16 16 import { dispatchTool } from './tools'; 17 17 import type { Update } from 'telegraf/types'; 18 18 ··· 28 28 } catch (error) { 29 29 console.error('Failed to initialize Letta:', error); 30 30 console.error('Server will start, but bot functionality may be limited.'); 31 + } 32 + 33 + // Register bot commands with Telegram (sets the command menu) 34 + try { 35 + await registerCommands(); 36 + } catch (error) { 37 + console.error('Failed to register commands:', error); 31 38 } 32 39 33 40 // Start the HTTP server