(command: BotCommand)
| 84 | } |
| 85 | |
| 86 | export function toCommandSpec(command: BotCommand): CommandSpec { |
| 87 | return { |
| 88 | // Preserve hyphens here (display/registration name): Discord and Slack |
| 89 | // accept them, so `/file-issue` stays `/file-issue` there. Telegram's |
| 90 | // adapter converts hyphens to underscores itself; routing still matches |
| 91 | // because `normalizeCommandName` collapses both forms. |
| 92 | name: command.name.trim().replace(/^\//, "").toLowerCase(), |
| 93 | description: command.description ?? "", |
| 94 | options: command.options ? toJsonSchema(command.options) : undefined, |
| 95 | }; |
| 96 | } |
no test coverage detected
searching dependent graphs…