errbot.backends.hipchat module

class errbot.backends.hipchat.HipChatRoom(name, bot)[source]

Bases: errbot.backends.base.Room

This class represents a Multi-User Chatroom.

__init__(name, bot)[source]
Parameters:name – The name of the room
create(privacy='public', guest_access=False)[source]

Create the room.

Calling this on an already existing room is a no-op.

  • privacy (str) – Whether the room is available for access by other users or not. Valid values are “public” and “private”.
  • guest_access (bool) – Whether or not to enable guest access for this room.

Destroy the room.

Calling this on a non-existing room is a no-op.


Boolean indicating whether this room already exists or not.

Getter:Returns True if the room exists, False otherwise.

Invite one or more people into the room.

Parameters:args – One or more people to invite into the room. May be the mention name (beginning with an @) or “FirstName LastName” of the user you wish to invite.
join(username=None, password=None)[source]

Join the room.

If the room does not exist yet, this will automatically call create() on it first.


Boolean indicating whether this room has already been joined or not.

Getter:Returns True if the room has been joined, False otherwise.

Leave the room.

Parameters:reason – An optional string explaining the reason for leaving the room

The name of this room

notify(message, color=None, notify=False, message_format=None)[source]

Send a notification to a room.

See the HipChat API documentation for more info.


The room’s occupants.

Getter:Returns a list of HipChatMUCOccupant instances.

Return room information from the HipChat API

set_message_size_limit(limit=10000, hard_limit=10000)[source]

HipChat message size limit


The room topic.

Getter:Returns the topic (a string) if one is set, None if no topic has been set at all.
class errbot.backends.hipchat.HipChatRoomOccupant(node=None, domain=None, resource=None, room=None, hipchat_user=None, aclattr=None)[source]

Bases: errbot.backends.xmpp.XMPPRoomOccupant

An occupant of a Multi-User Chatroom.

This class has all the attributes that are returned by a call to with the link to self expanded.

__init__(node=None, domain=None, resource=None, room=None, hipchat_user=None, aclattr=None)[source]
Parameters:hipchat_user – A user object as returned by with the link to self expanded.
Returns:returns the unique identifier that will be used for ACL matches.
class errbot.backends.hipchat.HipchatBackend(config)[source]

Bases: errbot.backends.xmpp.XMPPBackend


Those arguments will be directly those put in BOT_IDENTITY

build_reply(msg, text=None, private=False, threaded=False)[source]

Should be implemented by the backend


Processes for commands and dispatches the message to all the plugins.

prefix_groupchat_reply(message, identifier)[source]

Patches message with the conventional prefix to ping the specific contact For example: @gbin, you forgot the milk !


Query a room for information.

Parameters:room – The name (preferred) or XMPP JID of the room to query for.
Returns:An instance of HipChatRoom.

alias of HipChatRoom


alias of HipChatRoomOccupant


Return a list of rooms the bot is currently in.

Returns:A list of HipChatRoom instances.

Sends a card, this can be overriden by the backends without a super() call.

Parameters:card – the card to send.
send_stream_request(identifier, fsource, name='file.txt', size=None, stream_type=None)[source]

Starts a file transfer. note, fsource used to make the stream needs to be in open/rb state

class errbot.backends.hipchat.HipchatClient(*args, **kwargs)[source]

Bases: errbot.backends.xmpp.XMPPConnection

__init__(*args, **kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.


A list of all the users.

See also:

class errbot.backends.hipchat.HipchatExtension(**kwargs)[source]

Bases: markdown.extensions.Extension

Removes the unsupported html tags from hipchat


Add the various proccesors and patterns to the Markdown Instance.

This method must be overriden by every extension.

Keyword arguments:

  • md: The Markdown instance.
  • md_globals: Global variables in the markdown module namespace.
class errbot.backends.hipchat.HipchatTreeprocessor(md=None)[source]

Bases: markdown.treeprocessors.Treeprocessor


Subclasses of Treeprocessor should implement a run method, which takes a root ElementTree. This method can return another ElementTree object, and the existing root ElementTree will be replaced, or it can modify the current tree and return None.