You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Who: Bot users. When: A command is posted in chat. What: Parses the command and finds a suitable handler for it. Why: So that the bot can accept commands from users. Points: 5
Acceptance Criteria
Detects all messages starting with the trigger.
That trigger is configured under the "trigger" key of the config file.
Allows modules to register commands with names and hanglers.
Looks for and calls that handler when the command is posted in chat.
Example
Config file contains: trigger: "!".
A user posts !roll d6.
The bot should find a command handler for roll and call it with argument d6.
Technical discussion
A command record should contain:
The command name
The number of arguments
A pointer to the handler to call.
When parsing the command, arguments would be split on whitespace until the argument count is reached. If more whitespace is found, it becomes part of the last argument. For example, if command addquote takes 2 arguments, then !addquote somedude My password is hunter2 would be parsed as
command: "addquote"arguments: ["somedude", "My password is hunter2"]
The text was updated successfully, but these errors were encountered:
Who: Bot users.
When: A command is posted in chat.
What: Parses the command and finds a suitable handler for it.
Why: So that the bot can accept commands from users.
Points: 5
Acceptance Criteria
Example
trigger: "!"
.!roll d6
.The bot should find a command handler for
roll
and call it with argumentd6
.Technical discussion
A command record should contain:
When parsing the command, arguments would be split on whitespace until the argument count is reached. If more whitespace is found, it becomes part of the last argument. For example, if command
addquote
takes 2 arguments, then!addquote somedude My password is hunter2
would be parsed asThe text was updated successfully, but these errors were encountered: