(name: string)
| 76 | |
| 77 | /** Normalize a command name for matching: drop a leading slash, lower-case, trim. */ |
| 78 | export function normalizeCommandName(name: string): string { |
| 79 | // Collapse "-"→"_" so a command routes the same whether invoked as |
| 80 | // /file-issue (Slack/Discord allow hyphens) or /file_issue (Telegram forbids |
| 81 | // them; its adapter converts on registration). This is the ROUTING key only — |
| 82 | // per-adapter display names are decided in each adapter / `toCommandSpec`. |
| 83 | return name.trim().replace(/^\//, "").toLowerCase().replace(/-/g, "_"); |
| 84 | } |
| 85 | |
| 86 | export function toCommandSpec(command: BotCommand): CommandSpec { |
| 87 | return { |
no outgoing calls
no test coverage detected
searching dependent graphs…