Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hubot-esa

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hubot-esa

A Hubot script handling webhooks and retrieving info from esa: https://esa.io

  • 0.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

hubot-esa

npm CircleCI

A Hubot script handling webhooks and retrieving info from esa: https://esa.io

Features

Retrieve info when someone talking about URL of esa

Post

image

Comment

image

Retrieve stats of your team

  • Command: hubot esa stats

image

Handle webhooks

image

Installation

$ npm install hubot-esa --save

And then add hubot-esa to your external-scripts.json.

Also you need some variables to environment your Hubot runs.

Add to your Hubot project

Base Settings

export HUBOT_ESA_ACCESS_TOKEN='access_token'    # Required, your personal access token
export HUBOT_ESA_TEAM_NAME='gingypurrs'         # Required, your team name
export HUBOT_ESA_WEBHOOK_DEFAULT_ROOM='random'  # Required, room name you get notification by webhook
export HUBOT_ESA_WEBHOOK_ENDPOINT='/ginger/esa' # Optional, Default: "/hubot/esa"
export HUBOT_ESA_WEBHOOK_SECRET_TOKEN='true'    # Optional
  • HUBOT_ESA_ACCESS_TOKEN Required

    • Generate and set your "Personal access token" from https://[your-team].esa.io/user/applications.
  • HUBOT_ESA_TEAM_NAME Required

    • Set your team name
  • HUBOT_ESA_WEBHOOK_DEFAULT_ROOM Required

    • Set channel/room.for webhook notification from esa as default e.g. general
  • HUBOT_ESA_WEBHOOK_ENDPOINT Optional (Default: /hubot/esa)

    • Set the path for endopoint receives webhook from esa.
    • Configure your completed uri at https://[your-team].esa.io/team/webhooks for Generic webhook
  • HUBOT_ESA_WEBHOOK_SECRET_TOKEN Optional

    • If some text is set, hubot-esa verifies signature of HTTPS request by esa.io
    • Same to secret you configured in https://[your-team].esa.io/team/webhooks for Generic webhook
  • HUBOT_ESA_JUST_EMIT Optional (Default: false)

    • If true is set, disables messaging
    • hubot-esa always triggers below custom events. so you can make customized behavior when receive webhooks
  • HUBOT_ESA_SLACK_DECORATOR Optional (Default: false)

    • If true is set, decorates message for Slack

Use Built-in Slack Decorator

If you're using Hubot for Slack with hubot-slack, you can use built-in Slack decorator implemented for slack.attachment event.

Set env values like below.

export HUBOT_ESA_WEBHOOK_JUST_EMIT='true'       # Optional, Default: "false"
export HUBOT_ESA_SLACK_DECORATOR='true'         # Optional, Default: "false"

Handle event listener manually

You can implement your script handles above events. For example your can build original message on your own :)

By below setting, disable posting by hubot-esa. Then you can get just emitted event.

export HUBOT_ESA_WEBHOOK_JUST_EMIT='true'       # Optional, Default: "false"

esa.hear.stats

robot.on 'esa.hear.stats', (res, stats) ->
  console.log(stats)

esa.hear.post

robot.on 'esa.hear.post', (res, post) ->
  console.log(post)

esa.hear.comment

robot.on 'esa.hear.comment', (res, comment, post) ->
  console.log(comment)
  console.log(post)

esa.webhook

robot.on 'esa.webhook', (kind, data) ->
  console.log(comment)
data:
  team: 'team name'
  user: 'user object by webhook'
  post: 'post object by webhook'
  comment: 'comment object by webhook'

Author

  • @hmsk who is esa lover (\( ⁰⊖⁰)/)

License

Keywords

FAQs

Package last updated on 03 Jul 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc