Back to Zulip

Zulip Hubot Integration

templates/zerver/integrations/hubot.md

12.02.0 KB
Original Source

Zulip Hubot Integration

Use Hubot to execute scripts and commands within Zulip!

{start_tabs}

  1. Follow the Getting Started with Hubot guide to create your Hubot. You'll have a new directory from which bin/hubot starts a vanilla Hubot instance with the shell backend.

  2. In your Hubot's directory, install the Zulip adapter by running:

    npm install --save hubot-zulip

  3. {!create-a-generic-bot.md!}

  4. Hubot uses the following environment variables, set them using the information of the bot you created, by running:

    export HUBOT_ZULIP_SITE="{{ zulip_url }}"
    export HUBOT_ZULIP_BOT="hubot-bot@{{ zulip_url }}"
    export HUBOT_ZULIP_API_KEY="0123456789abcdef0123456789abcdef"
    
  5. Run Hubot:

    bin/hubot --adapter zulip --name "<bot username>"

!!! tip ""

Hubot automatically listens for commands on all public channels. Private
channels require an invitation. Hubot's access can be
[configured](#configuration-options).

{end_tabs}

To test your Hubot installation, send it an @-notification with a basic command, e.g., @Hubot pug me, which should produce a result like this:

Configuration options

  • To make Hubot listen only on the channels that it is subscribed to, run:

    export HUBOT_ZULIP_ONLY_SUBSCRIBED_STREAMS