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="example@jabber.org" HUBOT_XMPP_PASSWORD="HUBOT_XMPP_PASSWORD" HUBOT_XMPP_ROOMS="room@conf.jabber.org"

Chatroom with password

Please use jid:passwd syntax.

HUBOT_XMPP_ROOMS="room@conf.jabber.org:p4sw0rd" # example

Multiple chatrooms

Please use jid1,jid2 syntax.

HUBOT_XMPP_ROOMS="room1@conf.jabber.org,room2@conf.jabber.org" # example

Miltiple chatrooms with password

HUBOT_XMPP_ROOMS="room1@conf.jabber.org:p4sw0rd,room2@conf.jabber.org: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="example@jabber.org"
export HUBOT_XMPP_PASSWORD="account password"
export HUBOT_XMPP_ROOMS="room@conf.jabber.org"

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.