* Check if a queued command is a slash command (value starts with '/').
(cmd: QueuedCommand)
| 18 | * Check if a queued command is a slash command (value starts with '/'). |
| 19 | */ |
| 20 | function isSlashCommand(cmd: QueuedCommand): boolean { |
| 21 | if (typeof cmd.value === 'string') { |
| 22 | return cmd.value.trim().startsWith('/') |
| 23 | } |
| 24 | // For ContentBlockParam[], check the first text block |
| 25 | for (const block of cmd.value) { |
| 26 | if (block.type === 'text') { |
| 27 | return block.text.trim().startsWith('/') |
| 28 | } |
| 29 | } |
| 30 | return false |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * Processes commands from the queue. |
no outgoing calls
no test coverage detected