Added a method to check if input is a command.

This commit is contained in:
Paul Gauthier 2023-05-18 09:54:54 -07:00
parent 891d5b2263
commit 4cbdb9b9ad
2 changed files with 5 additions and 1 deletions

View file

@ -228,7 +228,7 @@ class Coder:
if not inp:
return
if inp.startswith("/"):
if self.commands.is_command(inp):
return self.commands.run(inp)
return self.send_new_user_message(inp)

View file

@ -10,6 +10,10 @@ class Commands:
self.io = io
self.coder = coder
def is_command(self, inp):
if inp[0] == '/':
return True
def help(self):
"Show help about all commands"
commands = self.get_commands()