Parse a slash command and return its handler plus raw args.
(self, raw_input: str)
| 142 | self._commands[alias] = command |
| 143 | |
| 144 | def lookup(self, raw_input: str) -> tuple[SlashCommand, str] | None: |
| 145 | """Parse a slash command and return its handler plus raw args.""" |
| 146 | if not raw_input.startswith("/"): |
| 147 | return None |
| 148 | name, _, args = raw_input[1:].partition(" ") |
| 149 | command = self._commands.get(name) |
| 150 | if command is None: |
| 151 | return None |
| 152 | return command, args.strip() |
| 153 | |
| 154 | def help_text(self) -> str: |
| 155 | """Return a formatted summary of all registered commands.""" |