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
- 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"]
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
rolland 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
addquotetakes 2 arguments, then!addquote somedude My password is hunter2would be parsed as