diff --git a/uqcsbot/base.py b/uqcsbot/base.py index b721a6fa..8eeddefb 100644 --- a/uqcsbot/base.py +++ b/uqcsbot/base.py @@ -193,8 +193,12 @@ def _handle_command(self, message: dict) -> None: command = Command.from_message(message) if command is None: return - for handler in self._command_registry[command.name]: - self.executor.submit(self._execute_catching_error, handler, command) + handlers = self._command_registry[command.name] + if not handlers: + self.post_message(command.channel_id, "Unknown command. Use !help to retrieve a list of supported commands") + else: + for handler in self._command_registry[command.name]: + self.executor.submit(self._execute_catching_error, handler, command) def _run_handlers(self, event: dict): """