Types API¶
JID
¶
MessageSource
¶
Describes where a message came from and who it targets.
MessageInfo
¶
Normalized metadata for a received or sent message.
Attributes¶
source
property
¶
source: MessageSource
Return the message source (sender, chat, is_from_me).
| RETURNS | DESCRIPTION |
|---|---|
MessageSource
|
MessageSource with sender and chat JIDs. |
multicast
property
¶
multicast: bool
Return True if the message was sent to multiple recipients.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
Boolean flag. |
server_id
property
¶
server_id: int
Return the server-assigned message ID.
| RETURNS | DESCRIPTION |
|---|---|
int
|
Server ID integer. |
timestamp
property
¶
timestamp: datetime
Return the message timestamp.
| RETURNS | DESCRIPTION |
|---|---|
datetime
|
datetime of the message. |
media_type
property
¶
media_type: str
Return the media type string (e.g. 'image', 'video').
| RETURNS | DESCRIPTION |
|---|---|
str
|
Media type string. |
edit
property
¶
edit: str
Return the edit status string, or None.
| RETURNS | DESCRIPTION |
|---|---|
str
|
Edit string or |
bot_info
property
¶
bot_info: MsgBotInfo | None
Return bot edit metadata, or None.
| RETURNS | DESCRIPTION |
|---|---|
MsgBotInfo | None
|
MsgBotInfo or |
meta_info
property
¶
meta_info: MsgMetaInfo
Return additional message metadata.
| RETURNS | DESCRIPTION |
|---|---|
MsgMetaInfo
|
MsgMetaInfo with target_id, content_type, etc. |
verified_name
property
¶
Return the verified name certificate, or None.
| RETURNS | DESCRIPTION |
|---|---|
VerifiedNameCertificate | None
|
VerifiedNameCertificate or |
device_sent_meta
property
¶
device_sent_meta: DeviceSentMeta | None
Return device-sent metadata, or None.
| RETURNS | DESCRIPTION |
|---|---|
DeviceSentMeta | None
|
DeviceSentMeta or |
category
property
¶
category: str
Return the message category string.
| RETURNS | DESCRIPTION |
|---|---|
str
|
Category string (e.g. |
ephemeral_expiration
property
¶
ephemeral_expiration: int | None
Return the ephemeral expiration timer in seconds, or None.
| RETURNS | DESCRIPTION |
|---|---|
int | None
|
Expiration seconds or |
is_offline
property
¶
is_offline: bool
Return True if the message was sent while offline.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
Boolean flag. |
unavailable_request_id
property
¶
unavailable_request_id: str | None
Return the unavailable request ID, or None.
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
Request ID string or |
server_timestamp_us
property
¶
server_timestamp_us: int | None
Return the server timestamp in microseconds, or None.
| RETURNS | DESCRIPTION |
|---|---|
int | None
|
Microsecond timestamp or |
verified_level
property
¶
verified_level: str | None
Return the verified level string, or None.
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
Level string or |
verified_name_serial
property
¶
verified_name_serial: int | None
Return the verified name serial number, or None.
| RETURNS | DESCRIPTION |
|---|---|
int | None
|
Serial integer or |
SendResult
¶
UploadResponse
¶
Result of a media upload call.
Attributes¶
direct_path
property
¶
direct_path: str
Return the direct download path.
| RETURNS | DESCRIPTION |
|---|---|
str
|
Direct path string. |
media_key
property
¶
media_key: bytes
Return the media encryption key.
| RETURNS | DESCRIPTION |
|---|---|
bytes
|
Media key bytes. |
file_enc_sha256
property
¶
file_enc_sha256: bytes
Return the encrypted file SHA-256 hash.
| RETURNS | DESCRIPTION |
|---|---|
bytes
|
SHA-256 hash bytes. |
file_sha256
property
¶
file_sha256: bytes
Return the plaintext file SHA-256 hash.
| RETURNS | DESCRIPTION |
|---|---|
bytes
|
SHA-256 hash bytes. |
file_length
property
¶
file_length: int
Return the file size in bytes.
| RETURNS | DESCRIPTION |
|---|---|
int
|
File length integer. |
MediaReuploadResult
¶
Result of media reupload request.
ProfilePicture
¶
Metadata about a user's profile picture.
MsgBotInfo
¶
Bot edit metadata attached to a message.
Attributes¶
edit_type
property
¶
edit_type: Literal['First', 'Inner', 'Last'] | None
Return the edit type ('First', 'Inner', 'Last'), or None.
| RETURNS | DESCRIPTION |
|---|---|
Literal['First', 'Inner', 'Last'] | None
|
Edit type string or |
MsgMetaInfo
¶
Additional metadata attached to a message payload.
Attributes¶
target_id
property
¶
target_id: str | None
Return the target message ID, or None.
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
Target message ID string or |
target_sender
property
¶
target_sender: JID | None
Return the target sender JID, or None.
| RETURNS | DESCRIPTION |
|---|---|
JID | None
|
Target sender JID or |
target_chat
property
¶
target_chat: JID | None
Return the target chat JID, or None.
| RETURNS | DESCRIPTION |
|---|---|
JID | None
|
Target chat JID or |
deprecated_lid_session
property
¶
deprecated_lid_session: bool | None
Return deprecated LID session flag, or None.
| RETURNS | DESCRIPTION |
|---|---|
bool | None
|
Boolean or |
thread_message_id
property
¶
thread_message_id: str | None
Return the thread message ID, or None.
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
Thread message ID string or |
thread_message_sender_jid
property
¶
thread_message_sender_jid: JID | None
Return the thread message sender JID, or None.
| RETURNS | DESCRIPTION |
|---|---|
JID | None
|
Sender JID or |
content_type
property
¶
content_type: str | None
Return the content type string, or None.
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
Content type string or |
appdata
property
¶
appdata: str | None
Return the app data string, or None.
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
App data string or |
reporting_tag
property
¶
reporting_tag: bytes | None
Return the reporting tag bytes, or None.
| RETURNS | DESCRIPTION |
|---|---|
bytes | None
|
Raw bytes or |
DeviceSentMeta
¶
Core value objects in tryx.types define identity, message metadata, and result contracts used across client namespaces.
Identity and Source Types¶
JID¶
Canonical WhatsApp identifier:
user: account or group numeric/opaque idserver: domain segment (s.whatsapp.net,g.us, etc.)
MessageSource¶
Routing context for a message:
- sender identity
- target chat identity
- from-me and group flags
- alternate identity hints for multi-device routing
MessageInfo¶
Message metadata envelope:
idtypetimestampsource- edit and verification metadata
Send and Media Result Types¶
| Type | Produced by |
|---|---|
UploadResponse |
upload, upload_file |
SendResult |
send_* methods |
MediaReuploadResult |
request_media_reupload |
ProfilePicture |
client.contact.get_profile_picture |
Advanced Metadata Types¶
MsgBotInfoMsgMetaInfoDeviceSentMeta
These are useful when building sync-aware systems and diagnostics.
Practical Typed Patterns¶
Privacy Type Bridge¶
Privacy and status workflows (documented in Privacy Namespace and Status Namespace) rely on typed enums from the client surface, including:
PrivacyCategoryPrivacyValueDisallowedListActionStatusPrivacySetting
Type-first architecture
Keep handler boundaries typed. Convert external payloads into typed objects early, and keep business logic free of ad-hoc dict parsing.