Skip to content

Commit

Permalink
Fixed invalid command causing crash
Browse files Browse the repository at this point in the history
- Invalid commands bounce even if invalid_command_respond=False
  • Loading branch information
thelabcat committed May 26, 2024
1 parent d5ecafe commit 803611a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rumchat_actor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,9 @@ def __run_if_command(self, message):
name = message.text.split()[0].removeprefix(COMMAND_PREFIX)

#Is not a valid command
if name not in self.chat_commands and self.invalid_command_respond:
self.send_message(f"@{message.user.username} That is not a registered command.")
if name not in self.chat_commands:
if self.invalid_command_respond:
self.send_message(f"@{message.user.username} That is not a registered command.")
return

self.chat_commands[name].call(message)
Expand Down

0 comments on commit 803611a

Please sign in to comment.