improved mpy compat
This commit is contained in:
+3
-2
@@ -40,8 +40,9 @@ class DeckChat:
|
||||
"""
|
||||
res = ('default', msg)
|
||||
if msg.startswith(self.command_prefix):
|
||||
parts = msg.split(maxsplit=1)
|
||||
cmd, arg = parts[0].lower().strip()[1:], parts[1].strip() if len(parts) > 1 else None
|
||||
parts = msg.split(' ')
|
||||
cmd = parts[0].lower().strip()[1:]
|
||||
arg = ' '.join(parts[1:]).strip() if len(parts) > 1 else None
|
||||
if cmd in self.command_handlers:
|
||||
res = (cmd, arg)
|
||||
return res
|
||||
|
||||
+2
-2
@@ -87,6 +87,6 @@ chat.command('model', set_model)
|
||||
chat.command('modellist', list_models)
|
||||
chat.command('provlist', list_providers)
|
||||
chat.command('help', display_help)
|
||||
chat.command('exit', lambda m,s: ('Exiting', None))
|
||||
chat.command('quit', lambda m,s: ('Exiting', None))
|
||||
chat.command('exit', lambda m,s: ('Exiting...', None))
|
||||
chat.command('quit', lambda m,s: ('Exiting...', None))
|
||||
chat.start()
|
||||
|
||||
Reference in New Issue
Block a user