on_message_in Event

This event is fired upon receipt of a message.

Syntax

class XMPPMessageInEventParams(object):
  @property
  def message_id() -> str: ...
  @property
  def from_() -> str: ...
  @property
  def domain() -> str: ...
  @property
  def resource() -> str: ...
  @property
  def message_type() -> int: ...
  @property
  def subject() -> str: ...
  @property
  def message_thread() -> str: ...
  @property
  def message_text() -> str: ...
  @property
  def message_html() -> str: ...
  @property
  def other() -> str: ...

# In class XMPP:
@property
def on_message_in() -> Callable[[XMPPMessageInEventParams], None]: ...
@on_message_in.setter
def on_message_in(event_hook: Callable[[XMPPMessageInEventParams], None]) -> None: ...

Remarks

When a message is received, the XMPP class will parse the sender's Jabber ID into the From, Domain, and Resource fields. These parameters can be used to track the exact instance of a user's account that originated the message.

MessageId can be used with Jabber extension protocols. The MessageText parameter is the plaintext portion of the message body. MessageHTML will contain any HTML from the message.

Type the type of message received. See message_type for a list of possible values. For message of type "headline", Subject will reflect the subject of the message. For messages of type "chat", Thread will report the conversation thread for which the current message is a follow-up.

Other will contains any extra data associated with the message but not defined by the XMPP-IM protocol.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks 2020 Python Edition - Version 20.0 [Build 8307]