hubot-regex-response
v1.0.0
Published
Respond messages by RegExp configs
Downloads
4
Maintainers
Readme
hubot-regex-response
Respond messages by RegExp configs.
Installation
npm install hubot-regex-response --saveThen add hubot-regex-response to your external-scripts.json:
["hubot-regex-response"]Sample Interaction
User> hey hey moqada is okada
Hubot> moqada is okama
User> i love potato
Hubot> User: potatoThis interactions configured following configs.
[
{
"from": "(moqada is )okada",
"to": "<%= m[1] %> okama",
},
{
"from": "(potato)",
"to": "<%= m[1] %>",
"method": "reply"
}
]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_textConfigurations
HUBOT_REGEX_RESPONSE_CONFIGS - Set JSON string for config responseThis JSON string is Array of following Object.
from: Target messages (using RegExp string)to: Template of Responding message (using lodash.template)method:sendorreply(optional, default:send)
See Sample configs at section of Sample Interaction
