blab_chatbot_bot_client.data_structures
#
Contains definitions of useful data structures and enums.
Module Contents#
Classes#
Represents a message type. |
|
Represents a message with data received from BLAB Controller. |
|
Represents a message that the bot will send to BLAB Controller. |
- class MessageType(*args, **kwds)#
Bases:
enum.Enum
Represents a message type.
- SYSTEM = 'S'#
System message
- TEXT = 'T'#
Text message
- VOICE = 'V'#
Voice message (recorded ad hoc)
- AUDIO = 'a'#
Message with audio file
- VIDEO = 'v'#
Message with video file
- IMAGE = 'i'#
Message with video file
- ATTACHMENT = 'A'#
Message with arbitrary attachment
- class Message#
Represents a message with data received from BLAB Controller.
- id: str#
Id of the message
- time: datetime.datetime#
When the message was sent
- type: MessageType#
Type of the message
- sent_by_human: bool#
Whether the message was sent by a human user
- options: list[str] | None#
List of options from which the user can choose, if any
- local_id: str | None#
Local id of the message (generated by the sender)
- text: str | None#
Text of the message, if any
- sender_id: str | None#
Id of the message sender, if any
- additional_metadata: dict[str, Any] | None#
Additional metadata (used in system messages)
- event: str | None#
Event type (used in system messages instead of text)
- quoted_message_id: str | None#
Id of the quoted message, if any
- __post_init__()#
- Return type:
None
- class OutgoingMessage#
Represents a message that the bot will send to BLAB Controller.
- local_id: str#
Local id of the message (generated by the sender)
- type: MessageType#
Type of the message
- text: str | None#
Text of the message, if any
- quoted_message_id: str | None#
Id of the quoted message, if any
- command: str | None#
Command embedded in the message (only for manager bots)
- options: list[str]#
List of options from which the user can choose, if any
- external_file_url: str | None#
URL of the external file attached to the message
- to_dict()#
Generate a dict with the data in this message.
- Returns
a dict with the values in this instance
- Return type:
dict[str, Any]