hubot-regex-response
Respond messages by RegExp configs.
Installation
npm install hubot-regex-response --save
Then add hubot-regex-response to your external-scripts.json
:
Sample Interaction
User> hey hey moqada is okada
Hubot> moqada is okama
User> i love potato
Hubot> User: potato
This interactions configured following configs.
to Environment variables.
export HUBOT_REGEX_RESPONSE_CONFIGS='[{"from":"(moqada is )okada","to":"<%= m[1] %> okama"},{"from":"(potato)","to":"<%= m[1] %>","method":"reply"}]'
Commands
<config_from_text> - Reply or Send config_to_text
Configurations
HUBOT_REGEX_RESPONSE_CONFIGS - Set JSON string for config response
This JSON string is Array of following Object.
from
: Target messages (using RegExp string)to
: Template of Responding message (using lodash.template)method
:send
orreply
(optional, default:send
)
See Sample configs at section of Sample Interaction