(command: SlackSlashCommand)
| 30 | * Parse the slash command and route to appropriate handler |
| 31 | */ |
| 32 | export async function handleSlashCommand(command: SlackSlashCommand): Promise<CommandResponse> { |
| 33 | const subcommand = command.text.trim().toLowerCase().split(/\s+/)[0] || 'help'; |
| 34 | |
| 35 | logger.info( |
| 36 | { command: command.command, subcommand, userId: command.user_id, userName: command.user_name }, |
| 37 | 'Processing Slack command' |
| 38 | ); |
| 39 | |
| 40 | switch (subcommand) { |
| 41 | case 'status': |
| 42 | return handleStatusCommand(command); |
| 43 | case 'whoami': |
| 44 | return handleWhoamiCommand(command); |
| 45 | case 'link': |
| 46 | return handleLinkCommand(command); |
| 47 | case 'help': |
| 48 | default: |
| 49 | return handleHelpCommand(command); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * /aao help - Show available commands |
no test coverage detected