
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
hubot-response
Advanced tools
Makes writing hubot scripts as easy as
{
"match": "Hello",
"description": "hello - finish hello world!",
"listener": "hear",
"response": [
"World!"
]
}
Install
npm install --save hubot-response
Register
In external-scripts.json
add
"hubot-response"
Make your own responses
Create a responses
directory. Create mysweetresponse.json
and add
{
"match": "Hello",
"description": "hello - finish hello world!",
"listener": "hear",
"response": [
"World!"
]
}
Now when hubot hears Hello
in the room, it replies back with World!
. Run npm start
to try it out!
Checkout more examples.
HUBOT_RESPONSE_GLOB
- Glob
of where to look for responses. Defaults to responses/*.*
Hubot Response can read anything that can be reqire
-ed as an object. So json
, js
, coffee
files all work.
The file should export either an object for one response, or an array for multiple responses.
Each response object should consist of:
match
- Either a string that is turned into a regex, or an actual instance of RegExp
that the robot is listening for.description
- Entry for hubot commands. Use this to display with hubot-help
. See Commands for formatting.listener
- Either hear
or respond
.response
- Can be a String
, Function
that is called, or an Array
where an index is randomly selected.Clone this locally and run
npm install
npm start
This will run a local hubot-shell. You can interact with the examples.
Protip: Run hubot help
for a list of available commands.
Yes, and the hubot-scripts org is awesome! But for simple hear and respond modules (animated gifs mostly) customization sucks...
Say you want to use this awesome business-cat script, but really want to add an image.
You have 3 options:
None of these are really clean.
Since response files are just an object, we can extend however we want. You can see an example of this in the extension example.
FAQs
Makes creating hubot responses easy.
The npm package hubot-response receives a total of 1 weekly downloads. As such, hubot-response popularity was classified as not popular.
We found that hubot-response demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.