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.

Parameters:
  • 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()[source]

Destroy the room.

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

domain
exists

Boolean indicating whether this room already exists or not.

Getter:Returns True if the room exists, False otherwise.
invite(*args)[source]

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.
jid
join(username=None, password=None)[source]

Join the room.

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

joined

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

Getter:Returns True if the room has been joined, False otherwise.
leave(reason=None)[source]

Leave the room.

Parameters:reason -- An optional string explaining the reason for leaving the room
name

The name of this room

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

Send a notification to a room.

See the HipChat API documentation for more info.

occupants

The room's occupants.

Getter:Returns a list of HipChatMUCOccupant instances.
resource
room

Return room information from the HipChat API

topic

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 https://www.hipchat.com/docs/apiv2/method/get_all_participants 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 https://www.hipchat.com/docs/apiv2/method/get_all_participants with the link to self expanded.
aclattr
class errbot.backends.hipchat.HipchatBackend(config)[source]

Bases: errbot.backends.xmpp.XMPPBackend

__init__(config)[source]
build_reply(msg, text=None, private=False, threaded=False)[source]
callback_message(msg)[source]
create_connection()[source]
mode
prefix_groupchat_reply(message, identifier)[source]
query_room[source]

Query a room for information.

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

alias of HipChatRoom

roomoccupant_factory

alias of HipChatRoomOccupant

rooms()[source]

Return a list of rooms the bot is currently in.

Returns:A list of HipChatRoom instances.
send_card(card)[source]
class errbot.backends.hipchat.HipchatClient(*args, **kwargs)[source]

Bases: errbot.backends.xmpp.XMPPConnection

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

A list of all the users.

See also: https://www.hipchat.com/docs/apiv2/method/get_all_users

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

Bases: markdown.extensions.Extension

Removes the unsupported html tags from hipchat

extendMarkdown(md, md_globals)[source]
class errbot.backends.hipchat.HipchatTreeprocessor(markdown_instance=None)[source]

Bases: markdown.treeprocessors.Treeprocessor

run(root)[source]
errbot.backends.hipchat.hipchat_html()[source]