XEP-0045: Multi-User Chat#

class slixmpp.plugins.xep_0045.XEP_0045(xmpp, config=None)[source]#

XEP-0045 Multi-User Chat

async join_muc_wait(room, nick, *, password=None, maxchars=None, maxstanzas=None, seconds=None, since=None, presence_options=None, timeout=None)[source]#

Try to join a MUC and block until we are joined or get an error.

Only one of {maxchars, maxstanzas, seconds, since} will be used, in that order.

New in version 1.8.0.

Parameters
  • password (Optional[str]) – The optional room password.

  • maxchars (Optional[int]) – Max number of characters to return from history.

  • maxstanzas (Optional[int]) – Max number of stanzas to return from history.

  • seconds (Optional[int]) – Fetch history until that many seconds in the past.

  • since (Optional[datetime]) – Fetch history since that timestamp.

  • timeout (Optional[int]) – Timeout after which a TimeoutError is raised. None means no timeout.

Raises

A slixmpp.exceptions.PresenceError if the MUC returns a presence error.

Raises

An asyncio.TimeoutError if there is neither success nor presence error when the timeout is reached.

Return type

Tuple[Presence, Message, List[Presence], List[Message]]

Returns

A tuple containing our own presence, the subject, a list of occupants and a list of history messages.

join_muc(room, nick, maxhistory='0', password='', pstatus='', pshow='', pfrom='')[source]#

Join the specified room, requesting ‘maxhistory’ lines of history.

Deprecated since version 1.8.0: join_muc_wait() will replace this old API starting from version 1.9.0.

Return type

Future

leave_muc(room, nick, msg='', pfrom=None)[source]#

Leave the specified room.

Parameters
  • room (JID) – Room to leave.

  • nick (str) – Your nickname.

  • msg (str) – Presence status to use.

set_subject(room, subject, *, mfrom=None)[source]#

Set a room’s subject.

Parameters
  • room (JID) – JID of the room.

  • subject (str) – Room subject to set.

async get_room_config(room, ifrom=None, **iqkwargs)[source]#

Get the room config form in 0004 plugin format.

Parameters

room (JID) – Room to get the config form from.

Raises

ValueError – When the form is not found.

Return type

Form

Returns

A form object.

async set_room_config(room, config, *, ifrom=None, **iqkwargs)[source]#

Send a room config form.

Parameters
  • room (JID) – Room to send the form to.

  • config (Form) – A filled room form.

async cancel_config(room, *, ifrom=None, **iqkwargs)[source]#

Cancel a requested config form.

Parameters

room (JID) – Room to cancel the form for.

async destroy(room, reason='', altroom=None, *, ifrom=None, **iqkwargs)[source]#

Destroy a room.

Parameters
  • room (JID) – Room JID to destroy.

  • reason (str) – Reason for destroying the room.

  • altroom (Optional[JID]) – An alternate room that users should join.

async set_affiliation(room, affiliation, *, jid=None, nick=None, reason='', ifrom=None, **iqkwargs)[source]#

Change room affiliation for a JID or nickname.

Parameters
  • room (JID) – Room to modify.

  • affiliation (Literal[‘outcast’, ‘member’, ‘admin’, ‘owner’, ‘none’]) – Affiliation to set.

  • jid (Optional[JID]) – User JID to use in the set operation.

  • reason (str) – Reason for the affiliation change.

async get_affiliation_list(room, affiliation, *, ifrom=None, **iqkwargs)[source]#

Get a list of JIDs with the specified affiliation

Parameters
  • room (JID) – Room to get affiliations from.

  • affiliation (Literal[‘outcast’, ‘member’, ‘admin’, ‘owner’, ‘none’]) – The affiliation to list.

Return type

List[JID]

async send_affiliation_list(room, affiliations, *, ifrom=None, **iqkwargs)[source]#

Send an affiliation delta list.

Parameters
  • room (JID) – Room to send the affiliations to.

  • affiliations (List[Tuple[JID, Literal[‘outcast’, ‘member’, ‘admin’, ‘owner’, ‘none’]]]) – List of couples (jid, affiliation) to set.

async set_role(room, nick, role, *, reason='', ifrom=None, **iqkwargs)[source]#
Change role property of a nick in a room.

Typically, roles are temporary (they last only as long as you are in the room), whereas affiliations are permanent (they last across groupchat sessions).

Parameters
  • room (JID) – Room to modify.

  • nick (str) – User nickname to use in the set operation.

  • role (Literal[‘moderator’, ‘participant’, ‘visitor’, ‘none’]) – Role to set.

  • reason (str) – Reason for the role change.

async get_roles_list(room, role, *, ifrom=None, **iqkwargs)[source]#

“Get a list of JIDs with the specified role

Parameters
  • room (JID) – Room to get roles from.

  • role (Literal[‘moderator’, ‘participant’, ‘visitor’, ‘none’]) – The role to list.

Return type

List[str]

async send_role_list(room, roles, *, ifrom=None, **iqkwargs)[source]#

Send a role delta list.

Parameters
  • room (JID) – Room to send the roles to.

  • roles (List[Tuple[str, Literal[‘moderator’, ‘participant’, ‘visitor’, ‘none’]]]) – List of couples (nick, role) to set.

invite(room, jid, reason='', *, mfrom=None)[source]#

Invite a jid to a room (mediated invitation).

Parameters
  • room (JID) – Room to invite the user in.

  • jid (JID) – JID of the user to invite.

  • reason (str) – Reason for inviting the user.

invite_server(room, jid, invite_from, reason='')[source]#

Send a mediated invite to a user, as a MUC service.

New in version 1.8.0.

Parameters
  • room (JID) – Room to invite the user in.

  • jid (JID) – JID of the user to invite.

  • invite_from (JID) – JID of the user to send the invitation from.

  • reason (str) – Reason for inviting the user.

decline(room, jid, reason='', *, mfrom=None)[source]#

Decline a mediated invitation.

Parameters
  • room (JID) – Room the invitation came from.

  • jid (JID) – JID of the user who sent the invitation.

  • reason (str) – Reason for declining.

request_voice(room, role, *, mfrom=None)[source]#

Request voice in a moderated room.

Parameters

room (JID) – Room to request voice from.

jid_in_room(room, jid)[source]#

Check if a JID is present in a room.

Parameters
  • room (JID) – Room to check.

  • jid (JID) – JID to check.

Return type

bool

get_nick(room, jid)[source]#

Get the nickname of a specific JID in a room.

Parameters
  • room (JID) – Room to inspect.

  • jid (JID) – JID whose nick to return.

Return type

Optional[str]

get_joined_rooms()[source]#

Get the list of rooms we sent a join presence to and did not explicitly leave.

Return type

List[JID]

get_our_jid_in_room(room_jid)[source]#

Return the jid we’re using in a room.

Return type

str

get_jid_property(room, nick, jid_property)[source]#
Get the property of a nick in a room, such as its ‘jid’ or ‘affiliation’

If not found, return None.

Parameters
  • room (JID) – Get the property for this room.

  • nick (str) – Which nickname information to get.

  • jid_property (Literal[‘jid’, ‘role’, ‘affiliation’, ‘show’, ‘status’, ‘alt_nick’]) – Property to fetch.

Return type

Any

get_roster(room)[source]#

Get the list of nicks in a room.

Parameters

room (JID) – Room to list nicks from.

Return type

List[str]

Stanza elements#

class slixmpp.plugins.xep_0045.stanza.MUCActor(xml=None, parent=None)[source]#
get_jid()[source]#
Return type

Optional[JID]

interfaces: ClassVar[Set[str]] = {'jid', 'nick'}#

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

iterables: List[ElementBase]#

A list of child stanzas whose class is included in plugin_iterables.

loaded_plugins: Set[str]#
name: ClassVar[str] = 'actor'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'http://jabber.org/protocol/muc#user'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

parent: Optional[ReferenceType[ElementBase]]#

A weakref.weakref to the parent stanza, if there is one. If not, then parent is None.

plugin_attrib: ClassVar[str] = 'actor'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
plugins: Dict[Tuple[str, Optional[str]], ElementBase]#

An ordered dictionary of plugin stanzas, mapped by their plugin_attrib value.

tag: str#

The name of the tag for the stanza’s root element. It is the same as calling tag_name() and is formatted as '{namespace}elementname'.

xml: ET.Element#

The underlying XML object for the stanza. It is a standard xml.etree.ElementTree object.

class slixmpp.plugins.xep_0045.stanza.MUCAdminItem(xml=None, parent=None)[source]#
interfaces: ClassVar[Set[str]] = {'affiliation', 'jid', 'nick', 'reason', 'role'}#

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

iterables: List[ElementBase]#

A list of child stanzas whose class is included in plugin_iterables.

loaded_plugins: Set[str]#
name: ClassVar[str] = 'item'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'http://jabber.org/protocol/muc#admin'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

parent: Optional[ReferenceType[ElementBase]]#

A weakref.weakref to the parent stanza, if there is one. If not, then parent is None.

plugin_attrib: ClassVar[str] = 'item'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
plugins: Dict[Tuple[str, Optional[str]], ElementBase]#

An ordered dictionary of plugin stanzas, mapped by their plugin_attrib value.

sub_interfaces: ClassVar[Set[str]] = {'reason'}#

A subset of interfaces which maps interfaces to direct subelements of the underlying XML object. Using this set, the text of these subelements may be set, retrieved, or removed without needing to define custom methods.

tag: str#

The name of the tag for the stanza’s root element. It is the same as calling tag_name() and is formatted as '{namespace}elementname'.

xml: ET.Element#

The underlying XML object for the stanza. It is a standard xml.etree.ElementTree object.

class slixmpp.plugins.xep_0045.stanza.MUCAdminQuery(xml=None, parent=None)[source]#
iterables: List[ElementBase]#

A list of child stanzas whose class is included in plugin_iterables.

loaded_plugins: Set[str]#
name: ClassVar[str] = 'query'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'http://jabber.org/protocol/muc#admin'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

parent: Optional[ReferenceType[ElementBase]]#

A weakref.weakref to the parent stanza, if there is one. If not, then parent is None.

plugin_attrib: ClassVar[str] = 'mucadmin_query'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
plugins: Dict[Tuple[str, Optional[str]], ElementBase]#

An ordered dictionary of plugin stanzas, mapped by their plugin_attrib value.

tag: str#

The name of the tag for the stanza’s root element. It is the same as calling tag_name() and is formatted as '{namespace}elementname'.

xml: ET.Element#

The underlying XML object for the stanza. It is a standard xml.etree.ElementTree object.

class slixmpp.plugins.xep_0045.stanza.MUCBase(xml=None, parent=None)[source]#
del_affiliation()[source]#
del_item_attr(attr)[source]#
del_jid()[source]#
del_nick()[source]#
del_role()[source]#
del_room()[source]#
del_status_codes()[source]#
get_affiliation()[source]#
get_item_attr(attr, default)[source]#
get_jid()[source]#
Return type

JID

get_nick()[source]#
Return type

str

get_role()[source]#
Return type

str

get_room()[source]#
Return type

str

get_status_codes()[source]#
Return type

Set[str]

interfaces: ClassVar[Set[str]] = {'affiliation', 'jid', 'nick', 'role', 'room', 'status_codes'}#

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

iterables: List[ElementBase]#

A list of child stanzas whose class is included in plugin_iterables.

loaded_plugins: Set[str]#
name: ClassVar[str] = 'x'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'http://jabber.org/protocol/muc#user'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

parent: Optional[ReferenceType[ElementBase]]#

A weakref.weakref to the parent stanza, if there is one. If not, then parent is None.

plugin_attrib: ClassVar[str] = 'muc'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
plugins: Dict[Tuple[str, Optional[str]], ElementBase]#

An ordered dictionary of plugin stanzas, mapped by their plugin_attrib value.

set_affiliation(value)[source]#
set_item_attr(attr, value)[source]#
set_jid(value)[source]#
set_nick(value)[source]#
set_role(value)[source]#
set_room(value)[source]#
set_status_codes(codes)[source]#
tag: str#

The name of the tag for the stanza’s root element. It is the same as calling tag_name() and is formatted as '{namespace}elementname'.

xml: ET.Element#

The underlying XML object for the stanza. It is a standard xml.etree.ElementTree object.

class slixmpp.plugins.xep_0045.stanza.MUCDecline(xml=None, parent=None)[source]#
get_from()[source]#
Return type

JID

get_to()[source]#
Return type

JID

interfaces: ClassVar[Set[str]] = {'from', 'reason', 'to'}#

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

iterables: List[ElementBase]#

A list of child stanzas whose class is included in plugin_iterables.

loaded_plugins: Set[str]#
name: ClassVar[str] = 'decline'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'http://jabber.org/protocol/muc#user'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

parent: Optional[ReferenceType[ElementBase]]#

A weakref.weakref to the parent stanza, if there is one. If not, then parent is None.

plugin_attrib: ClassVar[str] = 'decline'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
plugins: Dict[Tuple[str, Optional[str]], ElementBase]#

An ordered dictionary of plugin stanzas, mapped by their plugin_attrib value.

set_from(value)[source]#
set_to(value)[source]#
sub_interfaces: ClassVar[Set[str]] = {'reason'}#

A subset of interfaces which maps interfaces to direct subelements of the underlying XML object. Using this set, the text of these subelements may be set, retrieved, or removed without needing to define custom methods.

tag: str#

The name of the tag for the stanza’s root element. It is the same as calling tag_name() and is formatted as '{namespace}elementname'.

xml: ET.Element#

The underlying XML object for the stanza. It is a standard xml.etree.ElementTree object.

class slixmpp.plugins.xep_0045.stanza.MUCDestroy(xml=None, parent=None)[source]#
interfaces: ClassVar[Set[str]] = {'jid', 'reason'}#

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

iterables: List[ElementBase]#

A list of child stanzas whose class is included in plugin_iterables.

loaded_plugins: Set[str]#
name: ClassVar[str] = 'destroy'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'http://jabber.org/protocol/muc#user'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

parent: Optional[ReferenceType[ElementBase]]#

A weakref.weakref to the parent stanza, if there is one. If not, then parent is None.

plugin_attrib: ClassVar[str] = 'destroy'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
plugins: Dict[Tuple[str, Optional[str]], ElementBase]#

An ordered dictionary of plugin stanzas, mapped by their plugin_attrib value.

sub_interfaces: ClassVar[Set[str]] = {'reason'}#

A subset of interfaces which maps interfaces to direct subelements of the underlying XML object. Using this set, the text of these subelements may be set, retrieved, or removed without needing to define custom methods.

tag: str#

The name of the tag for the stanza’s root element. It is the same as calling tag_name() and is formatted as '{namespace}elementname'.

xml: ET.Element#

The underlying XML object for the stanza. It is a standard xml.etree.ElementTree object.

class slixmpp.plugins.xep_0045.stanza.MUCHistory(xml=None, parent=None)[source]#
interfaces: ClassVar[Set[str]] = {'maxchars', 'maxstanzas', 'seconds', 'since'}#

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

iterables: List[ElementBase]#

A list of child stanzas whose class is included in plugin_iterables.

loaded_plugins: Set[str]#
name: ClassVar[str] = 'history'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'http://jabber.org/protocol/muc'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

parent: Optional[ReferenceType[ElementBase]]#

A weakref.weakref to the parent stanza, if there is one. If not, then parent is None.

plugin_attrib: ClassVar[str] = 'history'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
plugins: Dict[Tuple[str, Optional[str]], ElementBase]#

An ordered dictionary of plugin stanzas, mapped by their plugin_attrib value.

tag: str#

The name of the tag for the stanza’s root element. It is the same as calling tag_name() and is formatted as '{namespace}elementname'.

xml: ET.Element#

The underlying XML object for the stanza. It is a standard xml.etree.ElementTree object.

class slixmpp.plugins.xep_0045.stanza.MUCInvite(xml=None, parent=None)[source]#
get_from()[source]#
Return type

JID

get_to()[source]#
Return type

JID

interfaces: ClassVar[Set[str]] = {'from', 'reason', 'to'}#

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

iterables: List[ElementBase]#

A list of child stanzas whose class is included in plugin_iterables.

loaded_plugins: Set[str]#
name: ClassVar[str] = 'invite'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'http://jabber.org/protocol/muc#user'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

parent: Optional[ReferenceType[ElementBase]]#

A weakref.weakref to the parent stanza, if there is one. If not, then parent is None.

plugin_attrib: ClassVar[str] = 'invite'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
plugins: Dict[Tuple[str, Optional[str]], ElementBase]#

An ordered dictionary of plugin stanzas, mapped by their plugin_attrib value.

set_from(value)[source]#
set_to(value)[source]#
sub_interfaces: ClassVar[Set[str]] = {'reason'}#

A subset of interfaces which maps interfaces to direct subelements of the underlying XML object. Using this set, the text of these subelements may be set, retrieved, or removed without needing to define custom methods.

tag: str#

The name of the tag for the stanza’s root element. It is the same as calling tag_name() and is formatted as '{namespace}elementname'.

xml: ET.Element#

The underlying XML object for the stanza. It is a standard xml.etree.ElementTree object.

class slixmpp.plugins.xep_0045.stanza.MUCJoin(xml=None, parent=None)[source]#
interfaces: ClassVar[Set[str]] = {'password'}#

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

iterables: List[ElementBase]#

A list of child stanzas whose class is included in plugin_iterables.

loaded_plugins: Set[str]#
name: ClassVar[str] = 'x'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'http://jabber.org/protocol/muc'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

parent: Optional[ReferenceType[ElementBase]]#

A weakref.weakref to the parent stanza, if there is one. If not, then parent is None.

plugin_attrib: ClassVar[str] = 'muc_join'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
plugins: Dict[Tuple[str, Optional[str]], ElementBase]#

An ordered dictionary of plugin stanzas, mapped by their plugin_attrib value.

sub_interfaces: ClassVar[Set[str]] = {'password'}#

A subset of interfaces which maps interfaces to direct subelements of the underlying XML object. Using this set, the text of these subelements may be set, retrieved, or removed without needing to define custom methods.

tag: str#

The name of the tag for the stanza’s root element. It is the same as calling tag_name() and is formatted as '{namespace}elementname'.

xml: ET.Element#

The underlying XML object for the stanza. It is a standard xml.etree.ElementTree object.

class slixmpp.plugins.xep_0045.stanza.MUCMessage(xml=None, parent=None)[source]#

A MUC Message

<message from='foo@muc/user1' type='groupchat' id='someid'>
    <body>Foo</body>
    <x xmlns='http://jabber.org/protocol/muc#user'>
        <item affiliation='none'
              role='none'
              nick='newnick2'
              jid='some@jid'/>
    </x>
</message>
iterables: List[ElementBase]#

A list of child stanzas whose class is included in plugin_iterables.

loaded_plugins: Set[str]#
parent: Optional[ReferenceType[ElementBase]]#

A weakref.weakref to the parent stanza, if there is one. If not, then parent is None.

plugins: Dict[Tuple[str, Optional[str]], ElementBase]#

An ordered dictionary of plugin stanzas, mapped by their plugin_attrib value.

tag: str#

The name of the tag for the stanza’s root element. It is the same as calling tag_name() and is formatted as '{namespace}elementname'.

xml: ET.Element#

The underlying XML object for the stanza. It is a standard xml.etree.ElementTree object.

class slixmpp.plugins.xep_0045.stanza.MUCOwnerDestroy(xml=None, parent=None)[source]#
interfaces: ClassVar[Set[str]] = {'jid', 'reason'}#

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

iterables: List[ElementBase]#

A list of child stanzas whose class is included in plugin_iterables.

loaded_plugins: Set[str]#
name: ClassVar[str] = 'destroy'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'http://jabber.org/protocol/muc#owner'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

parent: Optional[ReferenceType[ElementBase]]#

A weakref.weakref to the parent stanza, if there is one. If not, then parent is None.

plugin_attrib: ClassVar[str] = 'destroy'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
plugins: Dict[Tuple[str, Optional[str]], ElementBase]#

An ordered dictionary of plugin stanzas, mapped by their plugin_attrib value.

sub_interfaces: ClassVar[Set[str]] = {'reason'}#

A subset of interfaces which maps interfaces to direct subelements of the underlying XML object. Using this set, the text of these subelements may be set, retrieved, or removed without needing to define custom methods.

tag: str#

The name of the tag for the stanza’s root element. It is the same as calling tag_name() and is formatted as '{namespace}elementname'.

xml: ET.Element#

The underlying XML object for the stanza. It is a standard xml.etree.ElementTree object.

class slixmpp.plugins.xep_0045.stanza.MUCOwnerQuery(xml=None, parent=None)[source]#
iterables: List[ElementBase]#

A list of child stanzas whose class is included in plugin_iterables.

loaded_plugins: Set[str]#
name: ClassVar[str] = 'query'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'http://jabber.org/protocol/muc#owner'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

parent: Optional[ReferenceType[ElementBase]]#

A weakref.weakref to the parent stanza, if there is one. If not, then parent is None.

plugin_attrib: ClassVar[str] = 'mucowner_query'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
plugins: Dict[Tuple[str, Optional[str]], ElementBase]#

An ordered dictionary of plugin stanzas, mapped by their plugin_attrib value.

tag: str#

The name of the tag for the stanza’s root element. It is the same as calling tag_name() and is formatted as '{namespace}elementname'.

xml: ET.Element#

The underlying XML object for the stanza. It is a standard xml.etree.ElementTree object.

class slixmpp.plugins.xep_0045.stanza.MUCPresence(xml=None, parent=None)[source]#

A MUC Presence

<presence from='foo@muc/user1' type='unavailable'>
    <x xmlns='http://jabber.org/protocol/muc#user'>
        <item affiliation='none'
              role='none'
              nick='newnick2'
              jid='some@jid'/>
        <status code='303'/>
    </x>
</presence>
iterables: List[ElementBase]#

A list of child stanzas whose class is included in plugin_iterables.

loaded_plugins: Set[str]#
parent: Optional[ReferenceType[ElementBase]]#

A weakref.weakref to the parent stanza, if there is one. If not, then parent is None.

plugins: Dict[Tuple[str, Optional[str]], ElementBase]#

An ordered dictionary of plugin stanzas, mapped by their plugin_attrib value.

tag: str#

The name of the tag for the stanza’s root element. It is the same as calling tag_name() and is formatted as '{namespace}elementname'.

xml: ET.Element#

The underlying XML object for the stanza. It is a standard xml.etree.ElementTree object.

class slixmpp.plugins.xep_0045.stanza.MUCStatus(xml=None, parent=None)[source]#
interfaces: ClassVar[Set[str]] = {'code'}#

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

iterables: List[ElementBase]#

A list of child stanzas whose class is included in plugin_iterables.

loaded_plugins: Set[str]#
name: ClassVar[str] = 'status'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'http://jabber.org/protocol/muc#user'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

parent: Optional[ReferenceType[ElementBase]]#

A weakref.weakref to the parent stanza, if there is one. If not, then parent is None.

plugin_attrib: ClassVar[str] = 'status'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
plugins: Dict[Tuple[str, Optional[str]], ElementBase]#

An ordered dictionary of plugin stanzas, mapped by their plugin_attrib value.

set_code(code)[source]#
tag: str#

The name of the tag for the stanza’s root element. It is the same as calling tag_name() and is formatted as '{namespace}elementname'.

xml: ET.Element#

The underlying XML object for the stanza. It is a standard xml.etree.ElementTree object.

class slixmpp.plugins.xep_0045.stanza.MUCUserItem(xml=None, parent=None)[source]#
get_jid()[source]#
Return type

Optional[JID]

interfaces: ClassVar[Set[str]] = {'affiliation', 'jid', 'nick', 'reason', 'role'}#

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

iterables: List[ElementBase]#

A list of child stanzas whose class is included in plugin_iterables.

loaded_plugins: Set[str]#
name: ClassVar[str] = 'item'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'http://jabber.org/protocol/muc#user'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

parent: Optional[ReferenceType[ElementBase]]#

A weakref.weakref to the parent stanza, if there is one. If not, then parent is None.

plugin_attrib: ClassVar[str] = 'item'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
plugins: Dict[Tuple[str, Optional[str]], ElementBase]#

An ordered dictionary of plugin stanzas, mapped by their plugin_attrib value.

sub_interfaces: ClassVar[Set[str]] = {'reason'}#

A subset of interfaces which maps interfaces to direct subelements of the underlying XML object. Using this set, the text of these subelements may be set, retrieved, or removed without needing to define custom methods.

tag: str#

The name of the tag for the stanza’s root element. It is the same as calling tag_name() and is formatted as '{namespace}elementname'.

xml: ET.Element#

The underlying XML object for the stanza. It is a standard xml.etree.ElementTree object.