improved mpy compat

This commit is contained in:
Luxferre
2025-12-20 22:50:08 +02:00
parent 1972ebb27f
commit 3e50e07b1d
2 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -40,8 +40,9 @@ class DeckChat:
""" """
res = ('default', msg) res = ('default', msg)
if msg.startswith(self.command_prefix): if msg.startswith(self.command_prefix):
parts = msg.split(maxsplit=1) parts = msg.split(' ')
cmd, arg = parts[0].lower().strip()[1:], parts[1].strip() if len(parts) > 1 else None cmd = parts[0].lower().strip()[1:]
arg = ' '.join(parts[1:]).strip() if len(parts) > 1 else None
if cmd in self.command_handlers: if cmd in self.command_handlers:
res = (cmd, arg) res = (cmd, arg)
return res return res
+2 -2
View File
@@ -87,6 +87,6 @@ chat.command('model', set_model)
chat.command('modellist', list_models) chat.command('modellist', list_models)
chat.command('provlist', list_providers) chat.command('provlist', list_providers)
chat.command('help', display_help) chat.command('help', display_help)
chat.command('exit', lambda m,s: ('Exiting', None)) chat.command('exit', lambda m,s: ('Exiting...', None))
chat.command('quit', lambda m,s: ('Exiting', None)) chat.command('quit', lambda m,s: ('Exiting...', None))
chat.start() chat.start()