All Projects → bearyinnovative → hubot-bearychat

bearyinnovative / hubot-bearychat

Licence: MIT license
BearyChat Adapter for Hubot

Programming Languages

coffeescript
4710 projects
javascript
184084 projects - #8 most used programming language
Batchfile
5799 projects
shell
77523 projects
Makefile
30231 projects

Projects that are alternatives of or similar to hubot-bearychat

generator-kodi-addon
Yeoman generator for the most common Kodi addon types.
Stars: ✭ 69 (-30.3%)
Mutual labels:  yeoman
hubot-analytics
📈 A hubot script to get google analytics reports
Stars: ✭ 16 (-83.84%)
Mutual labels:  hubot
generator-deepexi-spring-cloud
deepexi java scaffold(spring cloud) generator
Stars: ✭ 30 (-69.7%)
Mutual labels:  yeoman
generator-django
A Yeoman generator for Django.
Stars: ✭ 78 (-21.21%)
Mutual labels:  yeoman
shared-react-components-example
An example of a mono-repository of shared React components libraries!
Stars: ✭ 85 (-14.14%)
Mutual labels:  yeoman
generator-latex
Yeoman Generator for LaTeX up-to-date documents
Stars: ✭ 29 (-70.71%)
Mutual labels:  yeoman
ansible-hubot
💬 Ansible role for Hubot
Stars: ✭ 63 (-36.36%)
Mutual labels:  hubot
Huggies
Huggies is a plug and play automation tool for AWS Elastic Beanstalk
Stars: ✭ 13 (-86.87%)
Mutual labels:  hubot
generator-vue-plugin
Yeoman generator generating vue plugin 🚀
Stars: ✭ 29 (-70.71%)
Mutual labels:  yeoman
gubot
A hubot like bot written in golang which is langage agnostic and cloud agnostic
Stars: ✭ 29 (-70.71%)
Mutual labels:  hubot
hubot-github-repo-event-notifier
Notifies about any GitHub repo event available via webhook.
Stars: ✭ 58 (-41.41%)
Mutual labels:  hubot
generator-go
A Yeoman generator to scaffold a simple golang application
Stars: ✭ 46 (-53.54%)
Mutual labels:  yeoman
matcha-bot
MatchaBot is a code generator. You can use matchabot to create an entire project, or to generate code inside an existing project consistently.
Stars: ✭ 14 (-85.86%)
Mutual labels:  yeoman
generator-fountain-react
Yeoman 'fountain' generator to start a webapp with React
Stars: ✭ 36 (-63.64%)
Mutual labels:  yeoman
evolution
proposals for changes and user-visible enhancements to Hubot
Stars: ✭ 42 (-57.58%)
Mutual labels:  hubot
generator-create-docusaurus
A generator for new docusaurus projects.
Stars: ✭ 13 (-86.87%)
Mutual labels:  yeoman
hubot-schedule
A hubot script to schedule a message in both cron-style and datetime-based format pattern
Stars: ✭ 46 (-53.54%)
Mutual labels:  hubot
generator-express-ts
create an app using express and typescript
Stars: ✭ 27 (-72.73%)
Mutual labels:  yeoman
hubot-seen
A hubot script that tracks when/where users were last seen.
Stars: ✭ 25 (-74.75%)
Mutual labels:  hubot
generator-liferay-fragments
Yeoman generator for creating and maintaining Liferay Fragment projects
Stars: ✭ 31 (-68.69%)
Mutual labels:  yeoman

hubot-bearychat

This is a Hubot adapter to use with BearyChat.

@BearyChat Build Status npm version

中文文档

5 Minutes Setup

Step 1. get ya a "hubot token"

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:

art/create_hubot.png

Step 2. bootstrap your secret hubot project with yeoman

  • 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.

Step 3. copy your hubot token and start it

$ export HUBOT_BEARYCHAT_TOKENS=token-token-token-here
$ export HUBOT_BEARYCHAT_MODE=rtm
$ ./bin/hubot -a bearychat

Step 4. start chatting with your bot!

art/bot_chat.png

You can also refer example/ for sample setup.

Mode

RTM mode

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

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.

Configuration

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 Interactions

Send

Hubot can response a message with res.send:

robot.hear /hello/, (res) ->
  res.send 'hello, world!'

art/res_send.png

Reply

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!'

art/res_reply.png

Send message to other room

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'},
        ]
      }
    ]

art/res_reply.png

LICENSE

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].