Add lita-hipchat to your Lita instance's Gemfile:
Values for all of the following attributes can be found on the "XMPP/Jabber info" page of the account settings on the HipChat website. A JID (Jabber ID) looks like "email@example.com".
jid(String) - The JID of your robot's HipChat account. Default:
password(String) - The password for your robot's HipChat account. Default:
server(String) - The HipChat Server address. Override this with the full domain of your server if using a private HipChat Server installation. Default:
debug(Boolean) - If
true, turns on the underlying Jabber library's (xmpp4r) logger, which is fairly verbose. Default:
- DEPRECATED -
rooms(Symbol, Array) - An array of room JIDs that Lita should join upon connection. Can also be the symbol
:all, which will cause Lita to discover and join all rooms. Default:
muc_domain(String) - The XMPP Multi-User Chat domain to use. Default:
ignore_unknown_users(Boolean) - Messages generated through HipChat's API which don't come from a real user account will be ignored by the robot. With the default setting of false, Lita will emit a warning but the message will be dispatched to any registered handlers as usual. Default:
Note: You must set the robot's name to the value shown as "Room nickname" on the XMPP settings page.
There's no need to set
config.robot.mention_name manually. The adapter will load the proper mention name from the XMPP roster upon connection.
Lita.configure do |config| config.robot.name = "Lita Bot" config.robot.adapter = :hipchat config.adapters.hipchat.jid = "firstname.lastname@example.org" config.adapters.hipchat.password = "secret" config.adapters.hipchat.debug = true config.adapters.hipchat.rooms = :all end
:connected- When the robot has connected to HipChat. No payload.
:disconnected- When the robot has disconnected from HipChat. No payload.
:joined- When the robot joins a room. Payload:
:room: The String room ID that was joined.
:parted- When the robot parts from a room. Payload:
:room: The String room ID that was parted from.
To make Lita join or part from rooms, use the built-in
part commands. For backwards compatibility, the
rooms configuration attribute will be supported until lita-hipchat 4.0, but you should remove it and begin using the new command instead. If the configuration attribute is set, lita-hipchat will honor its value and join those rooms instead of the ones persisted to Redis from using the new commands.
NOTE: You must be a member of the
config.robot.admins to use the build in