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)
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