Skip to content
This repository has been archived by the owner on Sep 29, 2021. It is now read-only.

How can I write a webhook listener

Jon Freedman edited this page Sep 29, 2017 · 1 revision

Hubot natively supports listening to webhooks and extending this to work with hubot-symphony is trivial. The simplest way to do this is to get the room id from the desktop client as described here.

You can then use the following code:

robot.messageRoom 'lX1hwfmQ-AK_k_a_BB0y2n___q2-0KfbdA', {
    format: 'MESSAGEML'
    text: "<messageML><b>ALERT</b> - called from a webhook!</messageML>"
}

There are other useful methods which can be accessed via robot.adapter e.g.

  • robot.adapter.sendDirectMessageToEmail(email, message)
  • robot.adapter.sendDirectMessageToUsername(email, message)
Clone this wiki locally