![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
hubot-bearychat
Advanced tools
This is a Hubot adapter to use with BearyChat.
Go to your team robots page in bearychat.com (your-cool-team.bearychat.com/robots) and create a hubot. You will get your hubot token inside the bot settings form:
npm install -g hubot coffee-script yo generator-hubot
mkdir -p /path/to/hubot
cd /path/to/hubot
yo hubot
npm install hubot-bearychat --save
Also check out the hubot docs for further guidance on how to build your bot.
$ export HUBOT_BEARYCHAT_TOKENS=token-token-token-here
$ export HUBOT_BEARYCHAT_MODE=rtm
$ ./bin/hubot -a bearychat
You can also refer example/ for sample setup.
RTM mode uses BearyChat's RTM api and WebSocket as message transport protocol. In this mode, hubot can receive all messages in real time and hear any messages from channels it had joined.
To enable RTM mode, you should specify environment variable
HUBOT_BEARYCHAT_MODE=rtm
before running the hubot.
hubot-bearychat
uses rtm mode by default.
HTTP mode is the legacy message transport protocol. In this mode, hubot can
only receive messages that himself was mentioned (e.g. @hubot how do you do
),
and you need to set the hubot hosted http service url in the hubot settings form.
To enable HTTP mode, you should specify environment variable
HUBOT_BEARYCHAT_MODE=http
before running the hubot.
Available configurations are injected via environment variables:
envvar | description |
---|---|
HUBOT_BEARYCHAT_MODE | running mode for the hubot, by default is rtm |
HUBOT_BEARYCHAT_TOKENS | hubot token, required for running hubot |
Hubot can response a message with res.send
:
robot.hear /hello/, (res) ->
res.send 'hello, world!'
If hubot want to response a message and refer the callers message, use
res.reply`:
robot.hear /how old are you?/, (res) ->
res.reply 'I am Five!'
If you want to send a message to other channel use robot.messageRoom
with vchannel_id, and Channel Name support is coming soon:
robot.hear /voldemort/i, (res) ->
robot.messageRoom(vchannel_id, "Somebody is talking about you, Voldemort!")
bearychat.attachment
If hubot want to response more than text, emit bearychat.attachment
:
robot.respond /念两句诗/, (res) ->
robot.emit 'bearychat.attachment',
# required
message: res.message
# requried
text: '当时我就念了...'
attachments: [
{
color: '#cb3f20',
text: '苟利国家生死以',
},
{
text: '岂因祸福避趋之',
},
{
images: [
{url: 'http://example.com/excited.jpg'},
]
}
]
MIT
FAQs
BearyChat adapter for hubot
The npm package hubot-bearychat receives a total of 2 weekly downloads. As such, hubot-bearychat popularity was classified as not popular.
We found that hubot-bearychat demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.