errbot.backends.hipchat module¶
-
class
errbot.backends.hipchat.
HipChatRoom
(name, bot)[source]¶ Bases:
errbot.backends.base.Room
This class represents a Multi-User Chatroom.
-
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.
- privacy (
-
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
¶ Returns: returns the unique identifier that will be used for ACL matches.
-
-
class
errbot.backends.hipchat.
HipchatBackend
(config)[source]¶ Bases:
errbot.backends.xmpp.XMPPBackend
-
build_reply
(msg, text=None, private=False, threaded=False)[source]¶ Should be implemented by the backend
-
callback_message
(msg)[source]¶ Processes for commands and dispatches the message to all the plugins.
-
mode
¶
-
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_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.
-
-
class
errbot.backends.hipchat.
HipchatClient
(*args, **kwargs)[source]¶ Bases:
errbot.backends.xmpp.XMPPConnection
-
users
¶ A list of all the users.
See also: https://www.hipchat.com/docs/apiv2/method/get_all_users
-
-
class
errbot.backends.hipchat.
HipchatExtension
(**kwargs)[source]¶ Bases:
markdown.extensions.Extension
Removes the unsupported html tags from hipchat