hubot-layer

0.1.15 • Public • Published

hubot-layer

This is Hubot adapter to use with Layer

Getting Started

Creating a new bot

  • npm install -g hubot coffee-script yo generator-hubot
  • mkdir -p /path/to/myhubot
  • cd /path/to/myhubot
  • yo hubot
  • npm install hubot-layer --save
  • Initialize git and make your initial commit.
  • Check out the hubot docs for further guidance on how to build your bot.

Testing your bot locally

  • LAYER_TOKEN=<STAGING_LAYER_TOKEN> LAYER_APP_ID=<STAGING_LAYER_APP_ID> BOT_OPERATOR=bot.operator ./bin/hubot -a layer

Deploying to Heroku

This is a modified set of instructions based on the instructions on the Hubot wiki.

  • Follow the instructions above to create a hubot locally

  • Install heroku toolbelt if you haven't already.

  • heroku create my-company-layerbot

  • heroku addons:create rediscloud:30

  • Add the config variables. For example:

      % heroku config:add LAYER_TOKEN=<PRODUCTION_LAYER_TOKEN>
      % heroku config:add LAYER_APP_ID=<PRODUCTION_LAYER_APP_ID>
      % heroku config:add BOT_OPERATOR=<NAME_BOT_OPERATOR>
    
  • Deploy the bot:

      % git push heroku master
    
  • 😎

Note:

Free dynos on Heroku will sleep after 30 minutes of inactivity. That means your hubot would leave the chat room and only rejoin when it does get traffic. This is extremely inconvenient since most interaction is done through chat, and hubot has to be online and in the room to respond to messages. To get around this, you can use the hubot-heroku-keepalive script, which will keep your free dyno alive for up to 18 hours/day. If you never want Hubot to sleep, you will need to upgrade to Heroku's hobby plan

Configuration

This adapter uses the following environment variables:

  • LAYER_TOKEN - this is the Token given by Layer that allows use Platform API.
  • LAYER_APP_ID - this is the App ID given by Layer.
  • BOT_OPERATOR - this is the name of operator that will send messages to users.

Copyright

Copyright © Yalo MIT License; see LICENSE for further details.


Created with ❤️ by Yalo

Readme

Keywords

Package Sidebar

Install

npm i hubot-layer

Weekly Downloads

1

Version

0.1.15

License

MIT

Last publish

Collaborators

  • fredjourney
  • yoelfme