Spaces:
Running
Running
File size: 312 Bytes
b037b02 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# ./core/command_parser.py
def parse_command(message: str):
if not message.startswith("/"):
return None, message
parts = message.strip().split()
command = parts[0][1:] # remove "/"
args = parts[1:]
return {
"command": command,
"args": args
}, " ".join(args)
|