errbot.backends.xmpp module

class errbot.backends.xmpp.XMPPBackend(config)[source]

Bases: errbot.core.ErrBot

__init__(config)[source]
build_identifier[source]
build_reply(msg, text=None, private=False, threaded=False)[source]
change_presence(status: str = 'online', message: str = '') → None[source]
chat_topic(event)[source]
connected(data)[source]

Callback for connection events

contact_offline(event)[source]
contact_online(event)[source]
create_connection()[source]
disconnected(data)[source]

Callback for disconnection events

incoming_message(xmppmsg)[source]

Callback for message events

mode
prefix_groupchat_reply(message, identifier)[source]
query_room(room)[source]

Query a room for information.

Parameters:room -- The JID/identifier of the room to query for.
Returns:An instance of XMPPMUCRoom.
room_factory

alias of XMPPRoom

roomoccupant_factory

alias of XMPPRoomOccupant

rooms()[source]

Return a list of rooms the bot is currently in.

Returns:A list of XMPPMUCRoom instances.
send_message(msg)[source]
serve_forever()[source]
user_changed_status(event)[source]
user_joined_chat(event)[source]
user_left_chat(event)[source]
class errbot.backends.xmpp.XMPPConnection(jid, password, feature=None, keepalive=None, ca_cert=None, server=None, use_ipv6=None, bot=None)[source]

Bases: object

__init__(jid, password, feature=None, keepalive=None, ca_cert=None, server=None, use_ipv6=None, bot=None)[source]
add_event_handler(name, cb)[source]
connect()[source]
del_event_handler(name, cb)[source]
disconnect()[source]
serve_forever()[source]
session_start(_)[source]
class errbot.backends.xmpp.XMPPIdentifier(node, domain, resource)[source]

Bases: errbot.backends.base.Identifier

This class is the parent and the basic contract of all the ways the backends are identifying a person on their system.

__init__(node, domain, resource)[source]
client
domain
fullname
nick
node
person
resource
class errbot.backends.xmpp.XMPPPerson(node, domain, resource)[source]

Bases: errbot.backends.xmpp.XMPPIdentifier, errbot.backends.base.Person

aclattr
class errbot.backends.xmpp.XMPPRoom(room_jid, bot)[source]

Bases: errbot.backends.xmpp.XMPPIdentifier, errbot.backends.base.Room

__init__(room_jid, bot)[source]
configure()[source]

Configure the room.

Currently this simply sets the default room configuration as received by the server. May be extended in the future to set a custom room configuration instead.

create()[source]

Not supported on this back-end (SleekXMPP doesn't support it). Will join the room to ensure it exists, instead.

destroy()[source]

Destroy the room.

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

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.

*argsargs:One or more JID's to invite into the room.
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.

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
occupants

The room's occupants.

Getter:Returns a list of MUCOccupant instances.
Raises:MUCNotJoinedError if the room has not yet been joined.
topic

The room topic.

Getter:Returns the topic (a string) if one is set, None if no topic has been set at all.
Raises:RoomNotJoinedError if the room has not yet been joined.
class errbot.backends.xmpp.XMPPRoomOccupant(node, domain, resource, room)[source]

Bases: errbot.backends.xmpp.XMPPPerson, errbot.backends.base.RoomOccupant

__init__(node, domain, resource, room)[source]
nick
person
room
errbot.backends.xmpp.split_identifier(txtrep)[source]