improved mpy compat
This commit is contained in:
+3
-2
@@ -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
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user