-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Labels
InternalChanges not directly visible to the user: speed improvements, unit testsChanges not directly visible to the user: speed improvements, unit tests
Description
Currently, each command gets the complete user text as message:
def perform_bot_cmd(msg, private=True):
"""Parses message and perform valid bot commands"""
# ...
text = msg.get("text")
# ...
kwargs = {"user_id": user_id, "channel": channel_id, "text": text}
return command(**kwargs)But msg.get("text") contains the complete user input, which is for karmabot always @karmabot command <argument>. This leads to unnecessary parsing of this text in each command function that needs the optional argument. So each command has to split the text and determine if there is a third optional argument part. I suggest simplifying the API and pass as text only the third part, that is, the command argument. This is None if None was given and a text otherwise.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
InternalChanges not directly visible to the user: speed improvements, unit testsChanges not directly visible to the user: speed improvements, unit tests