hubot-rocketchat-ignore-direct

0.0.3 • Public • Published

hubot-rocketchat-ignore-direct

NPM version

Middleware to respond to DM's with canned text, preventing further listeners from responding to direct messages (for bots that should only respond in channels).

This is different to the default option of setting RESPOND_TO_DM=false because it allows the bot to respond, improving the experience by not stone-walling users.

e.g. Allow specific groups of users access to a bot's commands, add it to a channel only they can access. It will ignore everyone else but can still message them one-way and provide static information on how to interact in channels.

See src/rocketchat-ignore-direct.coffee for full documentation.

Installation

In hubot project repo, run:

npm install hubot-rocketchat-ignore-direct --save

Then add hubot-rocketchat-ignore-direct to your external-scripts.json:

["hubot-rocketchat-ignore-direct"]

Sample Interaction

This is just middleware, it intercepts listeners but doesn't have any interaction other than an (optional) reply that it's ignoring direct messages.

In direct message

user1>> hubot do something, anything!?
hubot>> Sorry, I'm not listening.

In group channel

user1>> hubot do something, anything!?
hubot>> <whatever normal response>

Package Sidebar

Install

npm i hubot-rocketchat-ignore-direct

Weekly Downloads

1

Version

0.0.3

License

MIT

Last publish

Collaborators

  • timkinnane