Skip to content
markstory edited this page Nov 29, 2011 · 4 revisions

Hubot-xmpp provides an adapter allowing Hubot to connect to XMPP MUC chatroom. There is a bit of configuration you can use to make hubot do your bidding.

Setting Up Environment Variables

The XMPP adapter requires only 3 (5 if you need specify server and port) environment variables to be set to able to use it.

  • HUBOT_XMPP_USERNAME
  • HUBOT_XMPP_PASSWORD
  • HUBOT_XMPP_ROOMS

Optional:

  • HUBOT_XMPP_HOST
  • HUBOT_XMPP_PORT

Setting Config Variables on Heroku

To set these variables on a Hubot deployed to Heroku you can use the following command from the directory of your deployed Hubot.

heroku config:add HUBOT_XMPP_USERNAME="[email protected]" HUBOT_XMPP_PASSWORD="HUBOT_XMPP_PASSWORD" HUBOT_XMPP_ROOMS="[email protected]"

Chatroom with password

Please use jid:passwd syntax.

HUBOT_XMPP_ROOMS="[email protected]:p4sw0rd" # example

Multiple chatrooms

Please use jid1,jid2 syntax.

HUBOT_XMPP_ROOMS="[email protected],[email protected]" # example

Miltiple chatrooms with password

HUBOT_XMPP_ROOMS="[email protected]:p4sw0rd,[email protected]:r4nd0m" # example

Warning: password can not contain comma.

Setting Config Variables Elsewhere

To set these variables on a Hubot deployed to a UNIX(-like) operating system you can use the following commands.

export HUBOT_XMPP_USERNAME="[email protected]"
export HUBOT_XMPP_PASSWORD="account password"
export HUBOT_XMPP_ROOMS="[email protected]"

Using hubot-xmpp with the bot builder

Using the hubot command line tool, you can create a standalone bot:

./bin/hubot -c ../my-bot

After creating your standalone bot, you can add hubot-xmpp by adding it to the dependencies in your bot's package.json.