API Reference¶
Complete API reference for Neonize.
Overview¶
This section provides comprehensive API documentation for all Neonize modules, classes, and functions.
Modules¶
Core Client¶
neonize.client.NewClient
¶
NewClient(name: str, jid: Optional[JID] = None, props: Optional[DeviceProps] = None, uuid: Optional[str] = None)
Initializes a new client instance.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The name or identifier for the new client.
TYPE:
|
jid
|
Optional. The JID (Jabber Identifier) for the client. If not provided, first client is used.
TYPE:
|
qrCallback
|
Optional. A callback function for handling QR code updates, defaults to None.
TYPE:
|
messageCallback
|
Optional. A callback function for handling incoming messages, defaults to None.
TYPE:
|
uuid
|
Optional. A unique identifier for the client, defaults to None.
TYPE:
|
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
Attributes¶
is_connected
property
¶
Check if the object is currently connected.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if the object is connected, False otherwise. |
is_logged_in
property
¶
Check if the user is currently logged in.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if the user is logged in, False otherwise. |
Functions¶
send_message
¶
send_message(to: JID, message: Union[Message, str], link_preview: bool = False, ghost_mentions: Optional[str] = None, mentions_are_lids: bool = False, add_msg_secret: bool = False) -> SendResponse
Send a message to the specified JID.
| PARAMETER | DESCRIPTION |
|---|---|
to
|
The JID to send the message to.
TYPE:
|
message
|
The message to send.
TYPE:
|
link_preview
|
Whether to send a link preview, defaults to False
TYPE:
|
ghost_mentions
|
List of users to tag silently (Takes precedence over auto detected mentions)
TYPE:
|
mentions_are_lids
|
whether mentions contained in message or ghost_mentions are lids, defaults to False.
TYPE:
|
add_msg_secret
|
Whether to generate 32 random bytes for messageSecret inside MessageContextInfo before sending, defaults to False
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SendResponse
|
The response from the server. |
| RAISES | DESCRIPTION |
|---|---|
SendMessageError
|
If there was an error sending the message. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
build_reply_message
¶
build_reply_message(message: Union[str, MessageWithContextInfo], quoted: Message, link_preview: bool = False, reply_privately: bool = False, ghost_mentions: Optional[str] = None, mentions_are_lids: bool = False) -> Message
Send a reply message to a specified JID.
| PARAMETER | DESCRIPTION |
|---|---|
message
|
The message to be sent. Can be a string or a MessageWithContextInfo object.
TYPE:
|
quoted
|
The message to be quoted in the message being sent.
TYPE:
|
link_preview
|
If set to True, enables link previews in the message being sent. Defaults to False.
TYPE:
|
reply_privately
|
If set to True, the message is sent as a private reply. Defaults to False.
TYPE:
|
ghost_mentions
|
List of users to tag silently (Takes precedence over auto detected mentions)
TYPE:
|
mentions_are_lids
|
whether mentions contained in message or ghost_mentions are lids, defaults to False.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SendResponse
|
Response of the send operation. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
reply_message
¶
reply_message(message: Union[str, MessageWithContextInfo], quoted: Message, to: Optional[JID] = None, link_preview: bool = False, reply_privately: bool = False, ghost_mentions: Optional[str] = None, mentions_are_lids: bool = False, add_msg_secret: bool = False) -> SendResponse
Send a reply message to a specified JID.
| PARAMETER | DESCRIPTION |
|---|---|
message
|
The message to be sent. Can be a string or a MessageWithContextInfo object.
TYPE:
|
quoted
|
The message to be quoted in the message being sent.
TYPE:
|
to
|
The recipient of the message. If not specified, the message is sent to the default recipient.
TYPE:
|
link_preview
|
If set to True, enables link previews in the message being sent. Defaults to False.
TYPE:
|
reply_privately
|
If set to True, the message is sent as a private reply. Defaults to False.
TYPE:
|
ghost_mentions
|
List of users to tag silently (Takes precedence over auto detected mentions)
TYPE:
|
mentions_are_lids
|
whether mentions contained in message or ghost_mentions are lids, defaults to False.
TYPE:
|
add_msg_secret
|
If set to True generate 32 random bytes for messageSecret inside MessageContextInfo before sending, defaults to False
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SendResponse
|
Response of the send operation. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
edit_message
¶
Edit a message.
| PARAMETER | DESCRIPTION |
|---|---|
chat
|
Chat ID
TYPE:
|
message_id
|
Message ID
TYPE:
|
new_message
|
New message
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SendResponse
|
Response from server |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
revoke_message
¶
Revoke a message.
| PARAMETER | DESCRIPTION |
|---|---|
chat
|
Chat ID
TYPE:
|
sender
|
Sender ID
TYPE:
|
message_id
|
Message ID
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SendResponse
|
Response from server |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
build_poll_vote_creation
¶
build_poll_vote_creation(name: str, options: List[str], selectable_count: VoteType, quoted: Optional[Message] = None) -> Message
Build a poll vote creation message.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The name of the poll.
TYPE:
|
options
|
The options for the poll.
TYPE:
|
selectable_count
|
The number of selectable options.
TYPE:
|
quoted
|
A message that the poll message is a reply to, defaults to None
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Message
|
The poll vote creation message. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
build_poll_vote
¶
Builds a poll vote.
| PARAMETER | DESCRIPTION |
|---|---|
poll_info
|
The information about the poll.
TYPE:
|
option_names
|
The names of the options to vote for.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Message
|
The poll vote message. |
| RAISES | DESCRIPTION |
|---|---|
BuildPollVoteError
|
If there is an error building the poll vote. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
build_reaction
¶
This function builds a reaction message in a chat. It takes the chat and sender IDs, the message ID to which the reaction is being made, and the reaction itself as input. It then serializes the chat and sender IDs to strings, and calls the BuildReaction function of the client with these serialized IDs, the message ID, and the reaction. It finally returns the reaction message.
| PARAMETER | DESCRIPTION |
|---|---|
chat
|
The ID of the chat in which the reaction is being made
TYPE:
|
sender
|
The ID of the sender making the reaction
TYPE:
|
message_id
|
The ID of the message to which the reaction is being made
TYPE:
|
reaction
|
The reaction being made
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Message
|
The reaction message |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
build_revoke
¶
Builds a message to revoke a previous message.
| PARAMETER | DESCRIPTION |
|---|---|
chat
|
The JID (Jabber Identifier) of the chat where the message should be revoked.
TYPE:
|
sender
|
The JID of the sender of the message to be revoked.
TYPE:
|
message_id
|
The unique identifier of the message to be revoked.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Message
|
The constructed Message object for revoking the specified message. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
build_sticker_message
¶
build_sticker_message(file: Union[str, bytes], quoted: Optional[Message] = None, name: str = '', packname: str = '', crop: bool = False, enforce_not_broken: bool = False, animated_gif: bool = False, passthrough: bool = False) -> Message
This function builds a sticker message from a given image or video file. The file is converted to a webp format and uploaded to a server. The resulting URL and other metadata are used to construct the sticker message.
| PARAMETER | DESCRIPTION |
|---|---|
file
|
The path to the image or video file or the file data in bytes
TYPE:
|
quoted
|
A message that the sticker message is a reply to, defaults to None
TYPE:
|
name
|
The name of the sticker, defaults to ""
TYPE:
|
packname
|
The name of the sticker pack, defaults to ""
TYPE:
|
crop
|
Crop-center the image, defaults to False
TYPE:
|
enforce_not_broken
|
Enforce non-broken stickers by constraining sticker size to WA limits, defaults to False
TYPE:
|
animated_gif
|
Ensure transparent media are properly processed, defaults to False
TYPE:
|
passthrough
|
Don't process sticker, send as is, defaults to False.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Message
|
The constructed sticker message |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
| Python | |
|---|---|
895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 | |
send_sticker
¶
send_sticker(to: JID, file: Union[str, bytes], quoted: Optional[Message] = None, name: str = '', packname: str = '', crop: bool = False, enforce_not_broken: bool = False, animated_gif: bool = False, passthrough: bool = False, add_msg_secret: bool = False) -> SendResponse
Send a sticker to a specific JID.
| PARAMETER | DESCRIPTION |
|---|---|
to
|
The JID to send the sticker to.
TYPE:
|
file
|
The file path of the sticker or the sticker data in bytes.
TYPE:
|
quoted
|
The quoted message, if any, defaults to None.
TYPE:
|
name
|
The name of the sticker, defaults to "".
TYPE:
|
packname
|
The name of the sticker pack, defaults to "".
TYPE:
|
crop
|
Whether to crop-center the image, defaults to False
TYPE:
|
enforce_not_broken
|
Whether to enforce non-broken stickers by constraining sticker size to WA limits, defaults to False
TYPE:
|
animated_gif
|
Ensure transparent media are properly processed, defaults to False
TYPE:
|
passthrough
|
Don't process sticker, send as is, defaults to False.
TYPE:
|
add_msg_secret
|
Whether to generate 32 random bytes for messageSecret inside MessageContextInfo before sending, defaults to False
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SendResponse
|
The response from the send message function. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
send_stickerpack
¶
send_stickerpack(to: JID, files: list, quoted: Optional[Message] = None, packname: str = 'Sticker pack', publisher: str = '', crop: bool = False, animated_gif: bool = False, passthrough: bool = False, add_msg_secret: bool = False) -> List[SendResponse]
Send a sticker pack to a specific JID.
| PARAMETER | DESCRIPTION |
|---|---|
to
|
The JID to send the sticker to.
TYPE:
|
files
|
A list of file paths of the stickers or a list of stickers data in bytes.
TYPE:
|
quoted
|
The quoted message, if any, defaults to None.
TYPE:
|
packname
|
The name of the sticker pack, defaults to "Sticker pack".
TYPE:
|
publisher
|
The name of the publisher, defaults to "".
TYPE:
|
crop
|
Whether to crop-center the image, defaults to False
TYPE:
|
add_msg_secret
|
Whether to generate 32 random bytes for messageSecret inside MessageContextInfo before sending, defaults to False
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
List[SendResponse]
|
A list of response(s) from the send message function. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
build_video_message
¶
build_video_message(file: str | bytes, caption: Optional[str] = None, quoted: Optional[Message] = None, viewonce: bool = False, gifplayback: bool = False, is_gif: bool = False, ghost_mentions: Optional[str] = None, mentions_are_lids: bool = False) -> Message
This function is used to build a video message. It uploads a video file, extracts necessary information, and constructs a message with the given parameters.
| PARAMETER | DESCRIPTION |
|---|---|
file
|
The file path or bytes of the video file to be uploaded.
TYPE:
|
caption
|
The caption to be added to the video message, defaults to None
TYPE:
|
quoted
|
A message that the video message is in response to, defaults to None
TYPE:
|
viewonce
|
A flag indicating if the video message can be viewed only once, defaults to False
TYPE:
|
gifplayback
|
Optional. Whether the video should be sent as gif. Defaults to False.
TYPE:
|
is_gif
|
Optional. Whether the video to be sent is a gif. Defaults to False.
TYPE:
|
ghost_mentions
|
List of users to tag silently (Takes precedence over auto detected mentions)
TYPE:
|
mentions_are_lids
|
whether mentions contained in message or ghost_mentions are lids, defaults to False.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Message
|
A video message with the given parameters. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
| Python | |
|---|---|
1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 | |
send_video
¶
send_video(to: JID, file: str | bytes, caption: Optional[str] = None, quoted: Optional[Message] = None, viewonce: bool = False, gifplayback: bool = False, is_gif: bool = False, ghost_mentions: Optional[str] = None, mentions_are_lids: bool = False, add_msg_secret: bool = False) -> SendResponse
Sends a video to the specified recipient.
| PARAMETER | DESCRIPTION |
|---|---|
to
|
The JID (Jabber Identifier) of the recipient.
TYPE:
|
file
|
Either a file path (str), url (str) or binary data (bytes) representing the video.
TYPE:
|
caption
|
Optional. The caption of the video. Defaults to None.
TYPE:
|
quoted
|
Optional. The message to which the video is a reply. Defaults to None.
TYPE:
|
viewonce
|
Optional. Whether the video should be viewonce. Defaults to False.
TYPE:
|
gifplayback
|
Optional. Whether the video should be sent as gif. Defaults to False.
TYPE:
|
is_gif
|
Optional. Whether the video to be sent is a gif. Defaults to False.
TYPE:
|
ghost_mentions
|
List of users to tag silently (Takes precedence over auto detected mentions)
TYPE:
|
mentions_are_lids
|
whether mentions contained in message or ghost_mentions are lids, defaults to False.
TYPE:
|
add_msg_secret
|
Optional. Whether to generate 32 random bytes for messageSecret inside MessageContextInfo before sending, defaults to False
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SendResponse
|
A function for handling the result of the video sending process. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
build_image_message
¶
build_image_message(file: str | bytes, caption: Optional[str] = None, quoted: Optional[Message] = None, viewonce: bool = False, ghost_mentions: Optional[str] = None, mentions_are_lids: bool = False) -> Message
This function builds an image message. It takes a file (either a string or bytes), an optional caption, an optional quoted message, and a boolean indicating whether the message should be viewed once. It then uploads the image, generates a thumbnail, and constructs the message with the given parameters and the information from the uploaded image.
| PARAMETER | DESCRIPTION |
|---|---|
file
|
The image file to be uploaded and sent, either as a string URL or bytes.
TYPE:
|
caption
|
The caption for the image message, defaults to None.
TYPE:
|
quoted
|
The message to be quoted in the image message, defaults to None.
TYPE:
|
viewonce
|
Whether the image message should be viewable only once, defaults to False.
TYPE:
|
ghost_mentions
|
List of users to tag silently (Takes precedence over auto detected mentions)
TYPE:
|
mentions_are_lids
|
whether mentions contained in message or ghost_mentions are lids, defaults to False.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Message
|
The constructed image message. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
| Python | |
|---|---|
1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 | |
send_image
¶
send_image(to: JID, file: str | bytes, caption: Optional[str] = None, quoted: Optional[Message] = None, viewonce: bool = False, ghost_mentions: Optional[str] = None, mentions_are_lids: bool = False, add_msg_secret: bool = False) -> SendResponse
Sends an image to the specified recipient.
| PARAMETER | DESCRIPTION |
|---|---|
to
|
The JID (Jabber Identifier) of the recipient.
TYPE:
|
file
|
Either a file path (str), url (str) or binary data (bytes) representing the image.
TYPE:
|
caption
|
Optional. The caption of the image. Defaults to None.
TYPE:
|
quoted
|
Optional. The message to which the image is a reply. Defaults to None.
TYPE:
|
viewonce
|
Optional. Whether the image should be viewonce. Defaults to False.
TYPE:
|
ghost_mentions
|
List of users to tag silently (Takes precedence over auto detected mentions)
TYPE:
|
mentions_are_lids
|
whether mentions contained in message or ghost_mentions are lids, defaults to False.
TYPE:
|
add_msg_secret
|
Optional. Whether to generate 32 random bytes for messageSecret inside MessageContextInfo before sending, defaults to False
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SendResponse
|
A function for handling the result of the image sending process. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
send_album
¶
send_album(to: JID, files: list, caption: Optional[str] = None, quoted: Optional[Message] = None, ghost_mentions: Optional[str] = None, mentions_are_lids: bool = False, add_msg_secret: bool = False) -> List[SendResponse, List[SendResponse]]
Sends an album containing images, videos or both to the specified recipient.
| PARAMETER | DESCRIPTION |
|---|---|
to
|
The JID (Jabber Identifier) of the recipient.
TYPE:
|
files
|
A list containing either a file path (str), url (str) or binary data (bytes) representing the image/video.
TYPE:
|
caption
|
Optional. The caption of the first media in the album. Defaults to None.
TYPE:
|
quoted
|
Optional. The message to which the album is a reply. Defaults to None.
TYPE:
|
ghost_mentions
|
List of users to tag silently (Takes precedence over auto detected mentions)
TYPE:
|
add_msg_secret
|
Optional. Whether to generate 32 random bytes for messageSecret inside MessageContextInfo before sending, defaults to False
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
List[SendResponse, List[SendResponse]]
|
A function for handling the result of the album sending process. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
| Python | |
|---|---|
1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 | |
build_audio_message
¶
build_audio_message(file: str | bytes, ptt: bool = False, quoted: Optional[Message] = None) -> Message
This method builds an audio message from a given file or bytes.
| PARAMETER | DESCRIPTION |
|---|---|
file
|
The audio file in string or bytes format to be converted into an audio message
TYPE:
|
ptt
|
A boolean indicating if the audio message is a 'push to talk' message, defaults to False
TYPE:
|
quoted
|
A message that the audio message may be replying to, defaults to None
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Message
|
The audio message built from the given parameters |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
send_audio
¶
send_audio(to: JID, file: str | bytes, ptt: bool = False, quoted: Optional[Message] = None, add_msg_secret: bool = False) -> SendResponse
Sends an audio to the specified recipient.
| PARAMETER | DESCRIPTION |
|---|---|
to
|
The JID (Jabber Identifier) of the recipient.
TYPE:
|
file
|
Either a file path (str), url (str) or binary data (bytes) representing the audio.
TYPE:
|
ptt
|
Optional. Whether the audio should be ptt. Defaults to False.
TYPE:
|
quoted
|
Optional. The message to which the audio is a reply. Defaults to None.
TYPE:
|
add_msg_secret
|
Optional. Whether to generate 32 random bytes for messageSecret inside MessageContextInfo before sending, defaults to False
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SendResponse
|
A function for handling the result of the audio sending process. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
send_document
¶
send_document(to: JID, file: str | bytes, caption: Optional[str] = None, title: Optional[str] = None, filename: Optional[str] = None, mimetype: Optional[str] = None, quoted: Optional[Message] = None, ghost_mentions: Optional[str] = None, mentions_are_lids: bool = False, add_msg_secret: bool = False) -> SendResponse
Sends a document to the specified recipient.
| PARAMETER | DESCRIPTION |
|---|---|
to
|
The JID (Jabber Identifier) of the recipient.
TYPE:
|
file
|
Either a file path (str), url (str) or binary data (bytes) representing the document.
TYPE:
|
caption
|
Optional. The caption of the document. Defaults to None.
TYPE:
|
title
|
Optional. The title of the document. Defaults to None.
TYPE:
|
filename
|
Optional. The filename of the document. Defaults to None.
TYPE:
|
quoted
|
Optional. The message to which the document is a reply. Defaults to None.
TYPE:
|
ghost_mentions
|
List of users to tag silently (Takes precedence over auto detected mentions)
TYPE:
|
mentions_are_lids
|
whether mentions contained in message or ghost_mentions are lids, defaults to False.
TYPE:
|
add_msg_secret
|
Optional. Whether to generate 32 random bytes for messageSecret inside MessageContextInfo before sending, defaults to False
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SendResponse
|
A function for handling the result of the document sending process. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
send_contact
¶
send_contact(to: JID, contact_name: str, contact_number: str, quoted: Optional[Message] = None) -> SendResponse
Sends a contact to the specified recipient.
| PARAMETER | DESCRIPTION |
|---|---|
to
|
The JID (Jabber Identifier) of the recipient.
TYPE:
|
contact_name
|
The name of the contact.
TYPE:
|
contact_number
|
The number of the contact.
TYPE:
|
quoted
|
Optional. The message to which the contact is a reply. Defaults to None.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SendResponse
|
A function for handling the result of the contact sending process. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
upload
¶
Uploads media content.
| PARAMETER | DESCRIPTION |
|---|---|
binary
|
The binary data to be uploaded.
TYPE:
|
media_type
|
Optional. The media type of the binary data, defaults to None.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
UploadResponse
|
An UploadResponse containing information about the upload. |
| RAISES | DESCRIPTION |
|---|---|
UploadError
|
Raised if there is an issue with the upload. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
download_any
¶
Downloads content from a message.
| PARAMETER | DESCRIPTION |
|---|---|
message
|
The message containing the content to download.
TYPE:
|
path
|
Optional. The local path to save the downloaded content, defaults to None.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Union[None, bytes]
|
The downloaded content as bytes, or None if the content is not available. |
| RAISES | DESCRIPTION |
|---|---|
DownloadException
|
Raised if there is an issue with the download. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
download_media_with_path
¶
download_media_with_path(direct_path: str, enc_file_hash: bytes, file_hash: bytes, media_key: bytes, file_length: int, media_type: MediaType, mms_type: MediaTypeToMMS) -> bytes
Downloads media with the given parameters and path. The media is downloaded from the path specified.
| PARAMETER | DESCRIPTION |
|---|---|
direct_path
|
The direct path to the media to be downloaded.
TYPE:
|
enc_file_hash
|
The encrypted hash of the file.
TYPE:
|
file_hash
|
The hash of the file.
TYPE:
|
media_key
|
The key of the media to be downloaded.
TYPE:
|
file_length
|
The length of the file to be downloaded.
TYPE:
|
media_type
|
The type of the media to be downloaded.
TYPE:
|
mms_type
|
The type of the MMS to be downloaded.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bytes
|
The downloaded media in bytes. |
| RAISES | DESCRIPTION |
|---|---|
DownloadError
|
If there is an error in the download process. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
generate_message_id
¶
Generates a unique identifier for a message.
| RETURNS | DESCRIPTION |
|---|---|
str
|
A string representing the unique identifier for the message. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
send_chat_presence
¶
Sends chat presence information.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber Identifier) of the chat.
TYPE:
|
state
|
The chat presence state.
TYPE:
|
media
|
The chat presence media information.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
A string indicating the result or status of the presence information sending. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
is_on_whatsapp
¶
This function checks if the provided phone numbers are registered with WhatsApp.
| PARAMETER | DESCRIPTION |
|---|---|
numbers
|
A series of phone numbers to be checked.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Sequence[IsOnWhatsAppResponse]
|
A list of responses, each indicating whether the corresponding number is registered with WhatsApp. |
| RAISES | DESCRIPTION |
|---|---|
IsOnWhatsAppError
|
If an error occurs while verifying the phone numbers. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
get_user_info
¶
This function retrieves user information given a set of JID. It serializes the JID into a string, gets the user information from the client, deserializes the returned information, checks for any errors, and finally returns the user information.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
JID of the users to retrieve information from
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
RepeatedCompositeFieldContainer[GetUserInfoSingleReturnFunction]
|
The user information for each JID |
| RAISES | DESCRIPTION |
|---|---|
GetUserInfoError
|
If there is an error in the model returned by the client |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
get_group_info
¶
Retrieves information about a group.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber Identifier) of the group.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
GroupInfo
|
Information about the specified group. |
| RAISES | DESCRIPTION |
|---|---|
GetGroupInfoError
|
Raised if there is an issue retrieving group information. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
get_group_info_from_link
¶
Retrieves group information from a given link.
| PARAMETER | DESCRIPTION |
|---|---|
code
|
The link code.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
GroupInfo
|
An object containing the group information. |
| RAISES | DESCRIPTION |
|---|---|
GetGroupInfoError
|
If there is an error retrieving the group information. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
get_group_info_from_invite
¶
Retrieves group information from an invite.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber ID) of the group.
TYPE:
|
inviter
|
The JID of the user who sent the invite.
TYPE:
|
code
|
The invite code.
TYPE:
|
expiration
|
The expiration time of the invite.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
GroupInfo
|
The group information. |
| RAISES | DESCRIPTION |
|---|---|
GetGroupInfoError
|
If there is an error retrieving the group information. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
set_group_name
¶
Sets the name of a group.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber Identifier) of the group.
TYPE:
|
name
|
The new name to be set for the group.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
A string indicating the result or an error status. Empty string if successful. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
set_group_photo
¶
Sets the photo of a group.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber Identifier) of the group.
TYPE:
|
file_or_bytes
|
Either a file path (str) or binary data (bytes) representing the group photo.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
A string indicating the result or an error status. |
| RAISES | DESCRIPTION |
|---|---|
SetGroupPhotoError
|
Raised if there is an issue setting the group photo. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
set_profile_photo
¶
Sets profile photo.
| PARAMETER | DESCRIPTION |
|---|---|
file_or_bytes
|
Either a file path (str) or binary data (bytes) representing the group photo.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
A string indicating the result or an error status. |
| RAISES | DESCRIPTION |
|---|---|
SetGroupPhotoError
|
Raised if there is an issue setting the profile photo. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
get_lid_from_pn
¶
Retrieves the matching lid from the supplied jid.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber Identifier) (pn) of the target user.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
JID
|
The lid (hidden user) matching the supplied jid. |
| RAISES | DESCRIPTION |
|---|---|
GetJIDFromStoreError
|
Raised if there is an issue getting the lid from the given jid. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
get_pn_from_lid
¶
Retrieves the matching jid from the supplied lid.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber Identifier) (lid) of the target user.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
JID
|
The jid (phone number) matching the supplied lid. |
| RAISES | DESCRIPTION |
|---|---|
GetJIDFromStoreError
|
Raised if there is an issue getting the jid from the given lid. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
pin_message
¶
Currently Non-functional
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
leave_group
¶
Leaves a group.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber Identifier) of the target group.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
A string indicating the result or an error status. Empty string if successful. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
get_group_invite_link
¶
Gets or revokes the invite link for a group.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber Identifier) of the group.
TYPE:
|
revoke
|
Optional. If True, revokes the existing invite link; if False, gets the invite link. Defaults to False.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The group invite link or an error status. |
| RAISES | DESCRIPTION |
|---|---|
GetGroupInviteLinkError
|
Raised if there is an issue getting or revoking the invite link. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
join_group_with_link
¶
Join a group using an invite link.
| PARAMETER | DESCRIPTION |
|---|---|
code
|
The invite code or link for joining the group.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
JID
|
The JID (Jabber Identifier) of the joined group. |
| RAISES | DESCRIPTION |
|---|---|
InviteLinkError
|
Raised if the group membership is pending approval or if the link is invalid. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
join_group_with_invite
¶
This function allows a user to join a group in a chat application using an invite. It uses the JID (Jabber ID) of the group, the JID of the inviter, an invitation code, and an expiration time for the code.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID of the group to join.
TYPE:
|
inviter
|
The JID of the person who sent the invite.
TYPE:
|
code
|
The invitation code.
TYPE:
|
expiration
|
The expiration time of the invitation code.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
JoinGroupWithInviteError
|
If there is an error in joining the group, such as an invalid code or expired invitation. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
link_group
¶
Links a child group to a parent group.
| PARAMETER | DESCRIPTION |
|---|---|
parent
|
The JID of the parent group
TYPE:
|
child
|
The JID of the child group
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
LinkGroupError
|
If there is an error while linking the groups |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
mark_read
¶
mark_read(*message_ids: str, chat: JID, sender: JID, receipt: ReceiptType, timestamp: Optional[int] = None)
Marks the specified messages as read.
| PARAMETER | DESCRIPTION |
|---|---|
message_ids
|
Identifiers of the messages to mark as read.
TYPE:
|
chat
|
The JID of the chat.
TYPE:
|
sender
|
The JID of the sender.
TYPE:
|
receipt
|
The type of receipt indicating the message status.
TYPE:
|
timestamp
|
The timestamp of the read action, defaults to None.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
MarkReadError
|
If there is an error marking messages as read. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
newsletter_mark_viewed
¶
Marks the specified newsletters as viewed by the user with the given JID.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber ID) of the user who has viewed the newsletters.
TYPE:
|
message_server_ids
|
List of server IDs of the newsletters that have been viewed.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
NewsletterMarkViewedError
|
If an error occurs while marking the newsletters as viewed. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
newsletter_send_reaction
¶
newsletter_send_reaction(jid: JID, message_server_id: MessageServerID, reaction: str, message_id: str)
Sends a reaction to a newsletter.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The unique identifier for the recipient of the newsletter.
TYPE:
|
message_server_id
|
The unique identifier for the server where the message is stored.
TYPE:
|
reaction
|
The reaction to be sent.
TYPE:
|
message_id
|
The unique identifier for the message to which the reaction is being sent.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
NewsletterSendReactionError
|
If an error occurs while sending the reaction. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
newsletter_subscribe_live_updates
¶
Subscribes a user to live updates of a newsletter.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The unique identifier of the user subscribing to the newsletter.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
The duration for which the subscription is valid. |
| RAISES | DESCRIPTION |
|---|---|
NewsletterSubscribeLiveUpdatesError
|
If there is an error during the subscription process. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
newsletter_toggle_mute
¶
Toggle the mute status of a given JID.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber Identifier) of the user.
TYPE:
|
mute
|
The desired mute status. If True, the user will be muted. If False, the user will be unmuted.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
NewsletterToggleMuteError
|
If there is an error while toggling the mute status. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
resolve_business_message_link
¶
Resolves the target of a business message link.
| PARAMETER | DESCRIPTION |
|---|---|
code
|
The code of the business message link to be resolved.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
neonize_proto.BusinessMessageLinkTarget
|
The target of the business message link. |
| RAISES | DESCRIPTION |
|---|---|
ResolveContactQRLinkError
|
If an error occurs while resolving the link. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
resolve_contact_qr_link
¶
Resolves a QR link for a specific contact.
| PARAMETER | DESCRIPTION |
|---|---|
code
|
The QR code to be resolved.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
neonize_proto.ContactQRLinkTarget
|
The target contact of the QR link. |
| RAISES | DESCRIPTION |
|---|---|
ResolveContactQRLinkError
|
If an error occurs while resolving the QR link. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
send_app_state
¶
This function serializes the application state and sends it to the client. If there's an error during this process, it raises a SendAppStateError exception.
| PARAMETER | DESCRIPTION |
|---|---|
patch_info
|
Contains the information about the application state that needs to be patched.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
SendAppStateError
|
If there's an error while sending the application state, this exception is raised. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
set_default_disappearing_timer
¶
Sets a default disappearing timer for messages. The timer can be specified as a timedelta or an integer. If a timedelta is provided, it is converted to nanoseconds. If an integer is provided, it is used directly as the timer.
| PARAMETER | DESCRIPTION |
|---|---|
timer
|
The duration for messages to exist before disappearing. Can be a timedelta or an integer.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
SetDefaultDisappearingTimerError
|
If an error occurs while setting the disappearing timer. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
set_disappearing_timer
¶
set_disappearing_timer(jid: JID, timer: Union[timedelta, int], setting_ts: Optional[timedelta] = None)
Set a disappearing timer for a specific JID. The timer can be set as either a timedelta object or an integer. If a timedelta object is provided, it's converted into nanoseconds. If an integer is provided, it's interpreted as nanoseconds.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID for which the disappearing timer is to be set
TYPE:
|
timer
|
The duration for the disappearing timer. Can be a timedelta object or an integer representing nanoseconds.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
SetDisappearingTimerError
|
If there is an error in setting the disappearing timer |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
set_force_activate_delivery_receipts
¶
This method is used to forcibly activate or deactivate the delivery receipts for a client.
| PARAMETER | DESCRIPTION |
|---|---|
active
|
This parameter determines whether the delivery receipts should be forcibly activated or deactivated. If it's True, the delivery receipts will be forcibly activated, otherwise, they will be deactivated.
TYPE:
|
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
set_group_announce
¶
Sets the announcement status of a group.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The unique identifier of the group
TYPE:
|
announce
|
The announcement status to be set. If True, announcements are enabled. If False, they are disabled.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
SetGroupAnnounceError
|
If there is an error while setting the announcement status |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
set_group_locked
¶
Sets the locked status of a group identified by the given JID.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber ID) of the group to be locked/unlocked.
TYPE:
|
locked
|
The new locked status of the group. True to lock the group, False to unlock.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
SetGroupLockedError
|
If the operation fails, an error with the reason for the failure is raised. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
set_group_topic
¶
Set the topic of a group in a chat application.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The unique identifier of the group
TYPE:
|
previous_id
|
The previous identifier of the topic
TYPE:
|
new_id
|
The new identifier for the topic
TYPE:
|
topic
|
The new topic to be set
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
SetGroupTopicError
|
If there is an error setting the group topic |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
set_privacy_setting
¶
This method is used to set the privacy settings of a user.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The name of the privacy setting to be changed.
TYPE:
|
value
|
The new value for the privacy setting.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
SetPrivacySettingError
|
If there is an error while setting the privacy setting. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
set_passive
¶
Sets the passive mode of the client.
| PARAMETER | DESCRIPTION |
|---|---|
passive
|
If True, sets the client to passive mode. If False, sets the client to active mode.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
SetPassiveError
|
If an error occurs while setting the client to passive mode. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
set_status_message
¶
Sets a status message for a client using the client's UUID.
| PARAMETER | DESCRIPTION |
|---|---|
msg
|
The status message to be set.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
SetStatusMessageError
|
If there is an error while setting the status message. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
subscribe_presence
¶
This method is used to subscribe to the presence of a certain JID (Jabber ID).
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The Jabber ID (JID) that we want to subscribe to.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
SubscribePresenceError
|
If there is an error while subscribing to the presence of the JID. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
unfollow_newsletter
¶
Unfollows a newsletter by providing the JID (Jabber ID) of the newsletter.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The Jabber ID of the newsletter to unfollow.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
UnfollowNewsletterError
|
If there is an error while attempting to unfollow the newsletter. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
unlink_group
¶
This method is used to unlink a child group from a parent group.
| PARAMETER | DESCRIPTION |
|---|---|
parent
|
The JID of the parent group from which the child group is to be unlinked.
TYPE:
|
child
|
The JID of the child group which is to be unlinked from the parent group.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
UnlinkGroupError
|
If there is an error while unlinking the child group from the parent group. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
update_blocklist
¶
Function to update the blocklist with a given action on a specific JID.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The Jabber ID (JID) of the user to be blocked or unblocked.
TYPE:
|
action
|
The action to be performed (block or unblock) on the JID.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Blocklist
|
The updated blocklist. |
| RAISES | DESCRIPTION |
|---|---|
UpdateBlocklistError
|
If there is an error while updating the blocklist. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
update_group_participants
¶
update_group_participants(jid: JID, participants_changes: List[JID], action: ParticipantChange) -> RepeatedCompositeFieldContainer[GroupParticipant]
This method is used to update the list of participants in a group. It takes in the group's JID, a list of participant changes, and an action to perform.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber ID) of the group to update.
TYPE:
|
participants_changes
|
A list of JIDs representing the participants to be added or removed.
TYPE:
|
action
|
The action to perform (add, remove, promote or demote participants).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
RepeatedCompositeFieldContainer[GroupParticipant]
|
A list of the updated group participants. |
| RAISES | DESCRIPTION |
|---|---|
UpdateGroupParticipantsError
|
This error is raised if there is a problem updating the group participants. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
upload_newsletter
¶
Uploads the newsletter to the server.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
The newsletter content in bytes.
TYPE:
|
media_type
|
The type of media being uploaded.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
UploadResponse
|
The response from the server after the upload. |
| RAISES | DESCRIPTION |
|---|---|
UploadError
|
If there is an error during the upload process. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
create_group
¶
create_group(name: str, participants: List[JID] = [], linked_parent: Optional[GroupLinkedParent] = None, group_parent: Optional[GroupParent] = None) -> GroupInfo
Create a new group.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The name of the new group.
TYPE:
|
participants
|
Optional. A list of participant JIDs (Jabber Identifiers) to be included in the group. Defaults to an empty list.
TYPE:
|
linked_parent
|
Optional. Information about a linked parent group, if applicable. Defaults to None.
TYPE:
|
group_parent
|
Optional. Information about a parent group, if applicable. Defaults to None.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
GroupInfo
|
Information about the newly created group. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
get_group_request_participants
¶
get_group_request_participants(jid: JID) -> RepeatedCompositeFieldContainer[GroupParticipantRequest]
Get the participants of a group request.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID of the group request.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
RepeatedCompositeFieldContainer[JID]
|
A list of JIDs representing the participants of the group request. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
get_joined_groups
¶
Get the joined groups for the current user.
| RETURNS | DESCRIPTION |
|---|---|
RepeatedCompositeFieldContainer[GroupInfo]
|
A list of :class: |
| RAISES | DESCRIPTION |
|---|---|
GetJoinedGroupsError
|
If there was an error retrieving the joined groups. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
create_newsletter
¶
create_newsletter(name: str, description: str, picture: Union[str, bytes]) -> NewsletterMetadata
Create a newsletter with the given name, description, and picture.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The name of the newsletter.
TYPE:
|
description
|
The description of the newsletter.
TYPE:
|
picture
|
The picture of the newsletter. It can be either a URL or bytes.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NewsletterMetadata
|
The metadata of the created newsletter. |
| RAISES | DESCRIPTION |
|---|---|
CreateNewsletterError
|
If there is an error creating the newsletter. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
follow_newsletter
¶
Follows a newsletter with the given JID.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID of the newsletter to follow.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
None
|
None |
| RAISES | DESCRIPTION |
|---|---|
FollowNewsletterError
|
If there is an error following the newsletter. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
get_newsletter_info_with_invite
¶
Retrieves the newsletter information with an invite using the provided key.
| PARAMETER | DESCRIPTION |
|---|---|
key
|
The key used to identify the newsletter.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NewsletterMetadata
|
The newsletter metadata. |
| RAISES | DESCRIPTION |
|---|---|
GetNewsletterInfoWithInviteError
|
If there is an error retrieving the newsletter information. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
get_newsletter_message_update
¶
get_newsletter_message_update(jid: JID, count: int, since: int, after: int) -> RepeatedCompositeFieldContainer[NewsletterMessage]
Retrieves a list of newsletter messages that have been updated since a given timestamp.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber ID) of the user.
TYPE:
|
count
|
The maximum number of messages to retrieve.
TYPE:
|
since
|
The timestamp (in milliseconds) to retrieve messages from.
TYPE:
|
after
|
The timestamp (in milliseconds) to retrieve messages after.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
RepeatedCompositeFieldContainer[NewsletterMessage]
|
A list of updated newsletter messages. |
| RAISES | DESCRIPTION |
|---|---|
GetNewsletterMessageUpdateError
|
If there was an error retrieving the newsletter messages. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
get_newsletter_messages
¶
get_newsletter_messages(jid: JID, count: int, before: MessageServerID) -> RepeatedCompositeFieldContainer[NewsletterMessage]
Retrieves a list of newsletter messages for a given JID.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber Identifier) of the user.
TYPE:
|
count
|
The maximum number of messages to retrieve.
TYPE:
|
before
|
The ID of the message before which to retrieve messages.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
RepeatedCompositeFieldContaine[NewsletterMessage]
|
A list of newsletter messages. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
get_privacy_settings
¶
This function retrieves the my privacy settings.
| RETURNS | DESCRIPTION |
|---|---|
PrivacySettings
|
privacy settings |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
get_profile_picture
¶
get_profile_picture(jid: JID, extra: GetProfilePictureParams = neonize_proto.GetProfilePictureParams()) -> ProfilePictureInfo
This function is used to get the profile picture of a user.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The unique identifier of the user whose profile picture we want to retrieve.
TYPE:
|
extra
|
Additional parameters, defaults to neonize_proto.GetProfilePictureParams()
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ProfilePictureInfo
|
The information about the profile picture. |
| RAISES | DESCRIPTION |
|---|---|
GetProfilePictureError
|
If there is an error while trying to get the profile picture. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
get_status_privacy
¶
Returns the status privacy settings of the user.
| RETURNS | DESCRIPTION |
|---|---|
RepeatedCompositeFieldContainer[StatusPrivacy]
|
The status privacy settings of the user. |
| RAISES | DESCRIPTION |
|---|---|
GetStatusPrivacyError
|
If there is an error in getting the status privacy. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
get_sub_groups
¶
Get the subgroups of a given community.
| PARAMETER | DESCRIPTION |
|---|---|
community
|
The community for which to get the subgroups.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
RepeatedCompositeFieldContainer[GroupLinkTarget]
|
The subgroups of the given community. |
| RAISES | DESCRIPTION |
|---|---|
GetSubGroupsError
|
If there is an error while getting the subgroups. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
get_subscribed_newletters
¶
This function retrieves the newsletters the user has subscribed to.
| RETURNS | DESCRIPTION |
|---|---|
RepeatedCompositeFieldContainer[NewsletterMetadata]
|
A container with the metadata of each subscribed newsletter |
| RAISES | DESCRIPTION |
|---|---|
GetSubscribedNewslettersError
|
If there is an error while fetching the subscribed newsletters |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
get_user_devices
¶
Retrieve devices associated with specified user JIDs.
| PARAMETER | DESCRIPTION |
|---|---|
jids
|
Variable number of JIDs (Jabber Identifiers) of users.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
RepeatedCompositeFieldContainer[JID]
|
Devices associated with the specified user JIDs. |
| RAISES | DESCRIPTION |
|---|---|
GetUserDevicesError
|
If there is an error retrieving user devices. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
get_blocklist
¶
Retrieves the blocklist from the client.
| RETURNS | DESCRIPTION |
|---|---|
Blocklist
|
Blocklist: The retrieved blocklist. |
| RAISES | DESCRIPTION |
|---|---|
GetBlocklistError
|
If there was an error retrieving the blocklist. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
get_me
¶
This method is used to get the device information associated with a given UUID.
| RETURNS | DESCRIPTION |
|---|---|
Device
|
It returns a Device object created from the byte string response from the client's GetMe method. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
get_contact_qr_link
¶
This function returns a QR link for a specific contact. If the 'revoke' parameter is set to True, it revokes the existing QR link and generates a new one.
| PARAMETER | DESCRIPTION |
|---|---|
revoke
|
If set to True, revokes the existing QR link and generates a new one. Defaults to False.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The QR link for the contact. |
| RAISES | DESCRIPTION |
|---|---|
GetContactQrLinkError
|
If there is an error in getting the QR link. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
get_linked_group_participants
¶
get_linked_group_participants(community: JID) -> RepeatedCompositeFieldContainer[GroupParticipantRequest]
Fetches the participants of a linked group in a community.
| PARAMETER | DESCRIPTION |
|---|---|
community
|
The community in which the linked group belongs.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
RepeatedCompositeFieldContainer[JID]
|
A list of participants in the linked group. |
| RAISES | DESCRIPTION |
|---|---|
GetLinkedGroupParticipantsError
|
If there is an error while fetching the participants. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
get_newsletter_info
¶
Fetches the metadata of a specific newsletter using its JID.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The unique identifier of the newsletter
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
neonize_proto.NewsletterMetadata
|
The metadata of the requested newsletter |
| RAISES | DESCRIPTION |
|---|---|
GetNewsletterInfoError
|
If there is an error while fetching the newsletter information |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
PairPhone
¶
PairPhone(phone: str, show_push_notification: bool, client_name: ClientName = ClientName.LINUX, client_type: Optional[ClientType] = None)
Pair a phone with the client. This function will try to connect to the WhatsApp servers and pair the phone. If successful, it will show a push notification on the paired phone.
| PARAMETER | DESCRIPTION |
|---|---|
phone
|
The phone number to be paired.
TYPE:
|
show_push_notification
|
If true, a push notification will be shown on the paired phone.
TYPE:
|
client_name
|
The name of the client, defaults to LINUX.
TYPE:
|
client_type
|
The type of the client, defaults to None. If None, it will be set to FIREFOX or determined by the device properties.
TYPE:
|
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
| Python | |
|---|---|
3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 | |
stop
¶
Stops the client by disconnecting it from the WhatsApp servers.
get_message_for_retry
¶
get_message_for_retry(requester: JID, to: JID, message_id: str) -> typing.Union[None, Message]
This function retrieves a specific message for retrying transmission. It communicates with a client to get the message using provided requester, recipient, and message ID.
| PARAMETER | DESCRIPTION |
|---|---|
requester
|
The JID of the entity requesting the message.
TYPE:
|
to
|
The JID of the intended recipient of the message.
TYPE:
|
message_id
|
The unique identifier of the message to be retrieved.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Union[None, Message]
|
The message to be retried if found, None otherwise. |
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
decrypt_poll_vote
¶
Decrypt PollMessage
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
connect
¶
Establishes a connection to the WhatsApp servers.
Source code in .venv/lib/python3.12/site-packages/neonize/client.py
Async Client¶
neonize.aioze.client.NewAClient
¶
NewAClient(name: str, jid: Optional[JID] = None, props: Optional[DeviceProps] = None, uuid: Optional[str] = None)
Initializes a new client instance.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The name or identifier for the new client.
TYPE:
|
jid
|
Optional. The JID (Jabber Identifier) for the client. If not provided, first client is used.
TYPE:
|
qrCallback
|
Optional. A callback function for handling QR code updates, defaults to None.
TYPE:
|
messageCallback
|
Optional. A callback function for handling incoming messages, defaults to None.
TYPE:
|
uuid
|
Optional. A unique identifier for the client, defaults to None.
TYPE:
|
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
Attributes¶
is_connected
property
¶
Check if the object is currently connected.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if the object is connected, False otherwise. |
is_logged_in
property
¶
Check if the user is currently logged in.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if the user is logged in, False otherwise. |
Functions¶
send_message
async
¶
send_message(to: JID, message: Union[Message, str], link_preview: bool = False, ghost_mentions: Optional[str] = None, mentions_are_lids: bool = False, add_msg_secret: bool = False) -> SendResponse
Send a message to the specified JID.
| PARAMETER | DESCRIPTION |
|---|---|
to
|
The JID to send the message to.
TYPE:
|
message
|
The message to send.
TYPE:
|
link_preview
|
Whether to send a link preview, defaults to False
TYPE:
|
ghost_mentions
|
List of users to tag silently (Takes precedence over auto detected mentions)
TYPE:
|
mentions_are_lids
|
whether mentions contained in message or ghost_mentions are lids, defaults to False.
TYPE:
|
add_msg_secret
|
Whether to generate 32 random bytes for messageSecret inside MessageContextInfo before sending, defaults to False
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SendResponse
|
The response from the server. |
| RAISES | DESCRIPTION |
|---|---|
SendMessageError
|
If there was an error sending the message. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
build_reply_message
async
¶
build_reply_message(message: Union[str, MessageWithContextInfo], quoted: Message, link_preview: bool = False, reply_privately: bool = False, ghost_mentions: Optional[str] = None, mentions_are_lids: bool = False) -> Message
Send a reply message to a specified JID.
| PARAMETER | DESCRIPTION |
|---|---|
message
|
The message to be sent. Can be a string or a MessageWithContextInfo object.
TYPE:
|
quoted
|
The message to be quoted in the message being sent.
TYPE:
|
link_preview
|
If set to True, enables link previews in the message being sent. Defaults to False.
TYPE:
|
reply_privately
|
If set to True, the message is sent as a private reply. Defaults to False.
TYPE:
|
ghost_mentions
|
List of users to tag silently (Takes precedence over auto detected mentions)
TYPE:
|
mentions_are_lids
|
whether mentions contained in message or ghost_mentions are lids, defaults to False.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SendResponse
|
Response of the send operation. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
reply_message
async
¶
reply_message(message: Union[str, MessageWithContextInfo], quoted: Message, to: Optional[JID] = None, link_preview: bool = False, reply_privately: bool = False, ghost_mentions: Optional[str] = None, mentions_are_lids: bool = False, add_msg_secret: bool = False) -> SendResponse
Send a reply message to a specified JID.
| PARAMETER | DESCRIPTION |
|---|---|
message
|
The message to be sent. Can be a string or a MessageWithContextInfo object.
TYPE:
|
quoted
|
The message to be quoted in the message being sent.
TYPE:
|
to
|
The recipient of the message. If not specified, the message is sent to the default recipient.
TYPE:
|
link_preview
|
If set to True, enables link previews in the message being sent. Defaults to False.
TYPE:
|
reply_privately
|
If set to True, the message is sent as a private reply. Defaults to False.
TYPE:
|
ghost_mentions
|
List of users to tag silently (Takes precedence over auto detected mentions)
TYPE:
|
mentions_are_lids
|
whether mentions contained in message or ghost_mentions are lids, defaults to False.
TYPE:
|
add_msg_secret
|
If set to True generate 32 random bytes for messageSecret inside MessageContextInfo before sending, defaults to False
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SendResponse
|
Response of the send operation. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
edit_message
async
¶
Edit a message.
| PARAMETER | DESCRIPTION |
|---|---|
chat
|
Chat ID
TYPE:
|
message_id
|
Message ID
TYPE:
|
new_message
|
New message
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SendResponse
|
Response from server |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
revoke_message
async
¶
Revoke a message.
| PARAMETER | DESCRIPTION |
|---|---|
chat
|
Chat ID
TYPE:
|
sender
|
Sender ID
TYPE:
|
message_id
|
Message ID
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SendResponse
|
Response from server |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
build_poll_vote_creation
async
¶
build_poll_vote_creation(name: str, options: List[str], selectable_count: VoteType, quoted: Optional[Message] = None) -> Message
Build a poll vote creation message.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The name of the poll.
TYPE:
|
options
|
The options for the poll.
TYPE:
|
selectable_count
|
The number of selectable options.
TYPE:
|
quoted
|
A message that the poll message is a reply to, defaults to None
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Message
|
The poll vote creation message. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
build_poll_vote
async
¶
Builds a poll vote.
| PARAMETER | DESCRIPTION |
|---|---|
poll_info
|
The information about the poll.
TYPE:
|
option_names
|
The names of the options to vote for.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Message
|
The poll vote message. |
| RAISES | DESCRIPTION |
|---|---|
BuildPollVoteError
|
If there is an error building the poll vote. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
build_reaction
async
¶
This function builds a reaction message in a chat. It takes the chat and sender IDs, the message ID to which the reaction is being made, and the reaction itself as input. It then serializes the chat and sender IDs to strings, and calls the BuildReaction function of the client with these serialized IDs, the message ID, and the reaction. It finally returns the reaction message.
| PARAMETER | DESCRIPTION |
|---|---|
chat
|
The ID of the chat in which the reaction is being made
TYPE:
|
sender
|
The ID of the sender making the reaction
TYPE:
|
message_id
|
The ID of the message to which the reaction is being made
TYPE:
|
reaction
|
The reaction being made
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Message
|
The reaction message |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
build_revoke
async
¶
Builds a message to revoke a previous message.
| PARAMETER | DESCRIPTION |
|---|---|
chat
|
The JID (Jabber Identifier) of the chat where the message should be revoked.
TYPE:
|
sender
|
The JID of the sender of the message to be revoked.
TYPE:
|
message_id
|
The unique identifier of the message to be revoked.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Message
|
The constructed Message object for revoking the specified message. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
build_sticker_message
async
¶
build_sticker_message(file: Union[str, bytes], quoted: Optional[Message] = None, name: str = '', packname: str = '', crop: bool = False, enforce_not_broken: bool = False, animated_gif: bool = False, passthrough: bool = False) -> Message
This function builds a sticker message from a given image or video file. The file is converted to a webp format and uploaded to a server. The resulting URL and other metadata are used to construct the sticker message.
| PARAMETER | DESCRIPTION |
|---|---|
file
|
The path to the image or video file or the file data in bytes
TYPE:
|
quoted
|
A message that the sticker message is a reply to, defaults to None
TYPE:
|
name
|
The name of the sticker, defaults to ""
TYPE:
|
packname
|
The name of the sticker pack, defaults to ""
TYPE:
|
crop
|
Crop-center the image, defaults to False
TYPE:
|
enforce_not_broken
|
Enforce non-broken stickers by constraining sticker size to WA limits, defaults to False
TYPE:
|
animated_gif
|
Ensure transparent media are properly processed, defaults to False
TYPE:
|
passthrough
|
Don't process sticker, send as is, defaults to False.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Message
|
The constructed sticker message |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
| Python | |
|---|---|
948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 | |
send_sticker
async
¶
send_sticker(to: JID, file: Union[str, bytes], quoted: Optional[Message] = None, name: str = '', packname: str = '', crop: bool = False, enforce_not_broken: bool = False, animated_gif: bool = False, passthrough: bool = False, add_msg_secret: bool = False) -> SendResponse
Send a sticker to a specific JID.
| PARAMETER | DESCRIPTION |
|---|---|
to
|
The JID to send the sticker to.
TYPE:
|
file
|
The file path of the sticker or the sticker data in bytes.
TYPE:
|
quoted
|
The quoted message, if any, defaults to None.
TYPE:
|
name
|
The name of the sticker, defaults to "".
TYPE:
|
packname
|
The name of the sticker pack, defaults to "".
TYPE:
|
crop
|
Whether to crop-center the image, defaults to False
TYPE:
|
enforce_not_broken
|
Whether to enforce non-broken stickers by constraining sticker size to WA limits, defaults to False
TYPE:
|
animated_gif
|
Ensure transparent media are properly processed, defaults to False
TYPE:
|
passthrough
|
Don't process sticker, send as is, defaults to False.
TYPE:
|
add_msg_secret
|
Whether to generate 32 random bytes for messageSecret inside MessageContextInfo before sending, defaults to False
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SendResponse
|
The response from the send message function. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
send_stickerpack
async
¶
send_stickerpack(to: JID, files: list, quoted: Optional[Message] = None, packname: str = 'Sticker pack', publisher: str = '', crop: bool = False, animated_gif: bool = False, passthrough: bool = False, add_msg_secret: bool = False) -> List[SendResponse]
Send a sticker pack to a specific JID.
| PARAMETER | DESCRIPTION |
|---|---|
to
|
The JID to send the sticker to.
TYPE:
|
files
|
A list of file paths of the stickers or a list of stickers data in bytes.
TYPE:
|
quoted
|
The quoted message, if any, defaults to None.
TYPE:
|
packname
|
The name of the sticker pack, defaults to "Sticker pack".
TYPE:
|
publisher
|
The name of the publisher, defaults to "".
TYPE:
|
crop
|
Whether to crop-center the image, defaults to False
TYPE:
|
add_msg_secret
|
Whether to generate 32 random bytes for messageSecret inside MessageContextInfo before sending, defaults to False
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
List[SendResponse]
|
A list of response(s) from the send message function. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
build_video_message
async
¶
build_video_message(file: str | bytes, caption: Optional[str] = None, quoted: Optional[Message] = None, viewonce: bool = False, gifplayback: bool = False, is_gif: bool = False, ghost_mentions: Optional[str] = None, mentions_are_lids: bool = False) -> Message
This function is used to build a video message. It uploads a video file, extracts necessary information, and constructs a message with the given parameters.
| PARAMETER | DESCRIPTION |
|---|---|
file
|
The file path or bytes of the video file to be uploaded.
TYPE:
|
caption
|
The caption to be added to the video message, defaults to None
TYPE:
|
quoted
|
A message that the video message is in response to, defaults to None
TYPE:
|
viewonce
|
A flag indicating if the video message can be viewed only once, defaults to False
TYPE:
|
gifplayback
|
Optional. Whether the video should be sent as gif. Defaults to False.
TYPE:
|
is_gif
|
Optional. Whether the video to be sent is a gif. Defaults to False.
TYPE:
|
ghost_mentions
|
List of users to tag silently (Takes precedence over auto detected mentions)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Message
|
A video message with the given parameters. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
| Python | |
|---|---|
1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 | |
send_video
async
¶
send_video(to: JID, file: str | bytes, caption: Optional[str] = None, quoted: Optional[Message] = None, viewonce: bool = False, gifplayback: bool = False, is_gif: bool = False, ghost_mentions: Optional[str] = None, mentions_are_lids: bool = False, add_msg_secret: bool = False) -> SendResponse
Sends a video to the specified recipient.
| PARAMETER | DESCRIPTION |
|---|---|
to
|
The JID (Jabber Identifier) of the recipient.
TYPE:
|
file
|
Either a file path (str), url (str) or binary data (bytes) representing the video.
TYPE:
|
caption
|
Optional. The caption of the video. Defaults to None.
TYPE:
|
quoted
|
Optional. The message to which the video is a reply. Defaults to None.
TYPE:
|
viewonce
|
Optional. Whether the video should be viewonce. Defaults to False.
TYPE:
|
gifplayback
|
Optional. Whether the video should be sent as gif. Defaults to False.
TYPE:
|
is_gif
|
Optional. Whether the video to be sent is a gif. Defaults to False.
TYPE:
|
ghost_mentions
|
List of users to tag silently (Takes precedence over auto detected mentions)
TYPE:
|
add_msg_secret
|
Optional. Whether to generate 32 random bytes for messageSecret inside MessageContextInfo before sending, defaults to False
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SendResponse
|
A function for handling the result of the video sending process. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
build_image_message
async
¶
build_image_message(file: str | bytes, caption: Optional[str] = None, quoted: Optional[Message] = None, viewonce: bool = False, ghost_mentions: Optional[str] = None, mentions_are_lids: bool = False) -> Message
This function builds an image message. It takes a file (either a string or bytes), an optional caption, an optional quoted message, and a boolean indicating whether the message should be viewed once. It then uploads the image, generates a thumbnail, and constructs the message with the given parameters and the information from the uploaded image.
| PARAMETER | DESCRIPTION |
|---|---|
file
|
The image file to be uploaded and sent, either as a string URL or bytes.
TYPE:
|
caption
|
The caption for the image message, defaults to None.
TYPE:
|
quoted
|
The message to be quoted in the image message, defaults to None.
TYPE:
|
viewonce
|
Whether the image message should be viewable only once, defaults to False.
TYPE:
|
ghost_mentions
|
List of users to tag silently (Takes precedence over auto detected mentions)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Message
|
The constructed image message. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
| Python | |
|---|---|
1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 | |
send_image
async
¶
send_image(to: JID, file: str | bytes, caption: Optional[str] = None, quoted: Optional[Message] = None, viewonce: bool = False, ghost_mentions: Optional[str] = None, mentions_are_lids: bool = False, add_msg_secret: bool = False) -> SendResponse
Sends an image to the specified recipient.
| PARAMETER | DESCRIPTION |
|---|---|
to
|
The JID (Jabber Identifier) of the recipient.
TYPE:
|
file
|
Either a file path (str), url (str) or binary data (bytes) representing the image.
TYPE:
|
caption
|
Optional. The caption of the image. Defaults to None.
TYPE:
|
quoted
|
Optional. The message to which the image is a reply. Defaults to None.
TYPE:
|
viewonce
|
Optional. Whether the image should be viewonce. Defaults to False.
TYPE:
|
ghost_mentions
|
List of users to tag silently (Takes precedence over auto detected mentions)
TYPE:
|
add_msg_secret
|
Optional. Whether to generate 32 random bytes for messageSecret inside MessageContextInfo before sending, defaults to False
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SendResponse
|
A function for handling the result of the image sending process. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
send_album
async
¶
send_album(to: JID, files: list, caption: Optional[str] = None, quoted: Optional[Message] = None, ghost_mentions: Optional[str] = None, mentions_are_lids: bool = False, add_msg_secret: bool = False) -> List[SendResponse, List[SendResponse]]
Sends an album containing images, videos or both to the specified recipient.
| PARAMETER | DESCRIPTION |
|---|---|
to
|
The JID (Jabber Identifier) of the recipient.
TYPE:
|
files
|
A list containing either a file path (str), url (str) or binary data (bytes) representing the image/video.
TYPE:
|
caption
|
Optional. The caption of the first media in the album. Defaults to None.
TYPE:
|
quoted
|
Optional. The message to which the album is a reply. Defaults to None.
TYPE:
|
ghost_mentions
|
List of users to tag silently (Takes precedence over auto detected mentions)
TYPE:
|
add_msg_secret
|
Optional. Whether to generate 32 random bytes for messageSecret inside MessageContextInfo before sending, defaults to False
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
List[SendResponse, List[SendResponse]]
|
A function for handling the result of the album sending process. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
| Python | |
|---|---|
1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 | |
build_audio_message
async
¶
build_audio_message(file: str | bytes, ptt: bool = False, quoted: Optional[Message] = None) -> Message
This method builds an audio message from a given file or bytes.
| PARAMETER | DESCRIPTION |
|---|---|
file
|
The audio file in string or bytes format to be converted into an audio message
TYPE:
|
ptt
|
A boolean indicating if the audio message is a 'push to talk' message, defaults to False
TYPE:
|
quoted
|
A message that the audio message may be replying to, defaults to None
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Message
|
The audio message built from the given parameters |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
send_audio
async
¶
send_audio(to: JID, file: str | bytes, ptt: bool = False, quoted: Optional[Message] = None, add_msg_secret: bool = False) -> SendResponse
Sends an audio to the specified recipient.
| PARAMETER | DESCRIPTION |
|---|---|
to
|
The JID (Jabber Identifier) of the recipient.
TYPE:
|
file
|
Either a file path (str), url (str) or binary data (bytes) representing the audio.
TYPE:
|
ptt
|
Optional. Whether the audio should be ptt. Defaults to False.
TYPE:
|
quoted
|
Optional. The message to which the audio is a reply. Defaults to None.
TYPE:
|
add_msg_secret
|
Optional. Whether to generate 32 random bytes for messageSecret inside MessageContextInfo before sending, defaults to False
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SendResponse
|
A function for handling the result of the audio sending process. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
send_document
async
¶
send_document(to: JID, file: str | bytes, caption: Optional[str] = None, title: Optional[str] = None, filename: Optional[str] = None, mimetype: Optional[str] = None, quoted: Optional[Message] = None, ghost_mentions: Optional[str] = None, mentions_are_lids: bool = False, add_msg_secret: bool = False) -> SendResponse
Sends a document to the specified recipient.
| PARAMETER | DESCRIPTION |
|---|---|
to
|
The JID (Jabber Identifier) of the recipient.
TYPE:
|
file
|
Either a file path (str), url (str) or binary data (bytes) representing the document.
TYPE:
|
caption
|
Optional. The caption of the document. Defaults to None.
TYPE:
|
title
|
Optional. The title of the document. Defaults to None.
TYPE:
|
filename
|
Optional. The filename of the document. Defaults to None.
TYPE:
|
quoted
|
Optional. The message to which the document is a reply. Defaults to None.
TYPE:
|
ghost_mentions
|
List of users to tag silently (Takes precedence over auto detected mentions)
TYPE:
|
add_msg_secret
|
Optional. Whether to generate 32 random bytes for messageSecret inside MessageContextInfo before sending, defaults to False
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SendResponse
|
A function for handling the result of the document sending process. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
send_contact
async
¶
send_contact(to: JID, contact_name: str, contact_number: str, quoted: Optional[Message] = None) -> SendResponse
Sends a contact to the specified recipient.
| PARAMETER | DESCRIPTION |
|---|---|
to
|
The JID (Jabber Identifier) of the recipient.
TYPE:
|
contact_name
|
The name of the contact.
TYPE:
|
contact_number
|
The number of the contact.
TYPE:
|
quoted
|
Optional. The message to which the contact is a reply. Defaults to None.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SendResponse
|
A function for handling the result of the contact sending process. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
upload
async
¶
Uploads media content.
| PARAMETER | DESCRIPTION |
|---|---|
binary
|
The binary data to be uploaded.
TYPE:
|
media_type
|
Optional. The media type of the binary data, defaults to None.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
UploadResponse
|
An UploadResponse containing information about the upload. |
| RAISES | DESCRIPTION |
|---|---|
UploadError
|
Raised if there is an issue with the upload. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
download_any
async
¶
Downloads content from a message.
| PARAMETER | DESCRIPTION |
|---|---|
message
|
The message containing the content to download.
TYPE:
|
path
|
Optional. The local path to save the downloaded content, defaults to None.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Union[None, bytes]
|
The downloaded content as bytes, or None if the content is not available. |
| RAISES | DESCRIPTION |
|---|---|
DownloadException
|
Raised if there is an issue with the download. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
download_media_with_path
async
¶
download_media_with_path(direct_path: str, enc_file_hash: bytes, file_hash: bytes, media_key: bytes, file_length: int, media_type: MediaType, mms_type: MediaTypeToMMS) -> bytes
Downloads media with the given parameters and path. The media is downloaded from the path specified.
| PARAMETER | DESCRIPTION |
|---|---|
direct_path
|
The direct path to the media to be downloaded.
TYPE:
|
enc_file_hash
|
The encrypted hash of the file.
TYPE:
|
file_hash
|
The hash of the file.
TYPE:
|
media_key
|
The key of the media to be downloaded.
TYPE:
|
file_length
|
The length of the file to be downloaded.
TYPE:
|
media_type
|
The type of the media to be downloaded.
TYPE:
|
mms_type
|
The type of the MMS to be downloaded.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bytes
|
The downloaded media in bytes. |
| RAISES | DESCRIPTION |
|---|---|
DownloadError
|
If there is an error in the download process. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
generate_message_id
async
¶
Generates a unique identifier for a message.
| RETURNS | DESCRIPTION |
|---|---|
str
|
A string representing the unique identifier for the message. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
send_chat_presence
async
¶
Sends chat presence information.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber Identifier) of the chat.
TYPE:
|
state
|
The chat presence state.
TYPE:
|
media
|
The chat presence media information.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
A string indicating the result or status of the presence information sending. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
is_on_whatsapp
async
¶
This function checks if the provided phone numbers are registered with WhatsApp.
| PARAMETER | DESCRIPTION |
|---|---|
numbers
|
A series of phone numbers to be checked.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Sequence[IsOnWhatsAppResponse]
|
A list of responses, each indicating whether the corresponding number is registered with WhatsApp. |
| RAISES | DESCRIPTION |
|---|---|
IsOnWhatsAppError
|
If an error occurs while verifying the phone numbers. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
get_user_info
async
¶
This function retrieves user information given a set of JID. It serializes the JID into a string, gets the user information from the client, deserializes the returned information, checks for any errors, and finally returns the user information.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
JID of the users to retrieve information from
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
RepeatedCompositeFieldContainer[GetUserInfoSingleReturnFunction]
|
The user information for each JID |
| RAISES | DESCRIPTION |
|---|---|
GetUserInfoError
|
If there is an error in the model returned by the client |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
get_group_info
async
¶
Retrieves information about a group.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber Identifier) of the group.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
GroupInfo
|
Information about the specified group. |
| RAISES | DESCRIPTION |
|---|---|
GetGroupInfoError
|
Raised if there is an issue retrieving group information. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
get_group_info_from_link
async
¶
Retrieves group information from a given link.
| PARAMETER | DESCRIPTION |
|---|---|
code
|
The link code.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
GroupInfo
|
An object containing the group information. |
| RAISES | DESCRIPTION |
|---|---|
GetGroupInfoError
|
If there is an error retrieving the group information. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
get_group_info_from_invite
async
¶
Retrieves group information from an invite.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber ID) of the group.
TYPE:
|
inviter
|
The JID of the user who sent the invite.
TYPE:
|
code
|
The invite code.
TYPE:
|
expiration
|
The expiration time of the invite.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
GroupInfo
|
The group information. |
| RAISES | DESCRIPTION |
|---|---|
GetGroupInfoError
|
If there is an error retrieving the group information. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
set_group_name
async
¶
Sets the name of a group.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber Identifier) of the group.
TYPE:
|
name
|
The new name to be set for the group.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
A string indicating the result or an error status. Empty string if successful. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
set_group_photo
async
¶
Sets the photo of a group.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber Identifier) of the group.
TYPE:
|
file_or_bytes
|
Either a file path (str) or binary data (bytes) representing the group photo.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
A string indicating the result or an error status. |
| RAISES | DESCRIPTION |
|---|---|
SetGroupPhotoError
|
Raised if there is an issue setting the group photo. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
set_profile_photo
async
¶
Sets profile photo.
| PARAMETER | DESCRIPTION |
|---|---|
file_or_bytes
|
Either a file path (str) or binary data (bytes) representing the group photo.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
A string indicating the result or an error status. |
| RAISES | DESCRIPTION |
|---|---|
SetGroupPhotoError
|
Raised if there is an issue setting the profile photo. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
get_lid_from_pn
async
¶
Retrieves the matching lid from the supplied jid.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber Identifier) (pn) of the target user.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
JID
|
The lid (hidden user) matching the supplied jid. |
| RAISES | DESCRIPTION |
|---|---|
GetJIDFromStoreError
|
Raised if there is an issue getting the lid from the given jid. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
get_pn_from_lid
async
¶
Retrieves the matching jid from the supplied lid.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber Identifier) (lid) of the target user.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
JID
|
The jid (phone number) matching the supplied lid. |
| RAISES | DESCRIPTION |
|---|---|
GetJIDFromStoreError
|
Raised if there is an issue getting the jid from the given lid. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
pin_message
async
¶
Currently Non-functional
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
leave_group
async
¶
Leaves a group.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber Identifier) of the target group.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
A string indicating the result or an error status. Empty string if successful. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
get_group_invite_link
async
¶
Gets or revokes the invite link for a group.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber Identifier) of the group.
TYPE:
|
revoke
|
Optional. If True, revokes the existing invite link; if False, gets the invite link. Defaults to False.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The group invite link or an error status. |
| RAISES | DESCRIPTION |
|---|---|
GetGroupInviteLinkError
|
Raised if there is an issue getting or revoking the invite link. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
join_group_with_link
async
¶
Join a group using an invite link.
| PARAMETER | DESCRIPTION |
|---|---|
code
|
The invite code or link for joining the group.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
JID
|
The JID (Jabber Identifier) of the joined group. |
| RAISES | DESCRIPTION |
|---|---|
InviteLinkError
|
Raised if the group membership is pending approval or if the link is invalid. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
join_group_with_invite
async
¶
This function allows a user to join a group in a chat application using an invite. It uses the JID (Jabber ID) of the group, the JID of the inviter, an invitation code, and an expiration time for the code.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID of the group to join.
TYPE:
|
inviter
|
The JID of the person who sent the invite.
TYPE:
|
code
|
The invitation code.
TYPE:
|
expiration
|
The expiration time of the invitation code in seconds.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
JoinGroupWithInviteError
|
If there is an error in joining the group, such as an invalid code or expired invitation. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
link_group
async
¶
Links a child group to a parent group.
| PARAMETER | DESCRIPTION |
|---|---|
parent
|
The JID of the parent group
TYPE:
|
child
|
The JID of the child group
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
LinkGroupError
|
If there is an error while linking the groups |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
mark_read
async
¶
mark_read(*message_ids: str, chat: JID, sender: JID, receipt: ReceiptType, timestamp: Optional[int] = None)
Marks the specified messages as read.
| PARAMETER | DESCRIPTION |
|---|---|
message_ids
|
Identifiers of the messages to mark as read.
TYPE:
|
chat
|
The JID of the chat.
TYPE:
|
sender
|
The JID of the sender.
TYPE:
|
receipt
|
The type of receipt indicating the message status.
TYPE:
|
timestamp
|
The timestamp of the read action, defaults to None.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
MarkReadError
|
If there is an error marking messages as read. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
newsletter_mark_viewed
async
¶
Marks the specified newsletters as viewed by the user with the given JID.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber ID) of the user who has viewed the newsletters.
TYPE:
|
message_server_ids
|
List of server IDs of the newsletters that have been viewed.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
NewsletterMarkViewedError
|
If an error occurs while marking the newsletters as viewed. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
newsletter_send_reaction
async
¶
newsletter_send_reaction(jid: JID, message_server_id: MessageServerID, reaction: str, message_id: str)
Sends a reaction to a newsletter.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The unique identifier for the recipient of the newsletter.
TYPE:
|
message_server_id
|
The unique identifier for the server where the message is stored.
TYPE:
|
reaction
|
The reaction to be sent.
TYPE:
|
message_id
|
The unique identifier for the message to which the reaction is being sent.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
NewsletterSendReactionError
|
If an error occurs while sending the reaction. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
newsletter_subscribe_live_updates
async
¶
Subscribes a user to live updates of a newsletter.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The unique identifier of the user subscribing to the newsletter.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
The duration for which the subscription is valid. |
| RAISES | DESCRIPTION |
|---|---|
NewsletterSubscribeLiveUpdatesError
|
If there is an error during the subscription process. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
newsletter_toggle_mute
async
¶
Toggle the mute status of a given JID.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber Identifier) of the user.
TYPE:
|
mute
|
The desired mute status. If True, the user will be muted. If False, the user will be unmuted.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
NewsletterToggleMuteError
|
If there is an error while toggling the mute status. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
resolve_business_message_link
async
¶
Resolves the target of a business message link.
| PARAMETER | DESCRIPTION |
|---|---|
code
|
The code of the business message link to be resolved.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
neonize_proto.BusinessMessageLinkTarget
|
The target of the business message link. |
| RAISES | DESCRIPTION |
|---|---|
ResolveContactQRLinkError
|
If an error occurs while resolving the link. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
resolve_contact_qr_link
async
¶
Resolves a QR link for a specific contact.
| PARAMETER | DESCRIPTION |
|---|---|
code
|
The QR code to be resolved.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
neonize_proto.ContactQRLinkTarget
|
The target contact of the QR link. |
| RAISES | DESCRIPTION |
|---|---|
ResolveContactQRLinkError
|
If an error occurs while resolving the QR link. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
send_app_state
async
¶
This function serializes the application state and sends it to the client. If there's an error during this process, it raises a SendAppStateError exception.
| PARAMETER | DESCRIPTION |
|---|---|
patch_info
|
Contains the information about the application state that needs to be patched.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
SendAppStateError
|
If there's an error while sending the application state, this exception is raised. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
set_default_disappearing_timer
async
¶
Sets a default disappearing timer for messages. The timer can be specified as a timedelta or an integer. If a timedelta is provided, it is converted to nanoseconds. If an integer is provided, it is used directly as the timer.
| PARAMETER | DESCRIPTION |
|---|---|
timer
|
The duration for messages to exist before disappearing. Can be a timedelta or an integer.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
SetDefaultDisappearingTimerError
|
If an error occurs while setting the disappearing timer. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
set_disappearing_timer
async
¶
set_disappearing_timer(jid: JID, timer: Union[timedelta, int], setting_ts: Optional[timedelta] = None)
Set a disappearing timer for a specific JID. The timer can be set as either a timedelta object or an integer. If a timedelta object is provided, it's converted into nanoseconds. If an integer is provided, it's interpreted as nanoseconds.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID for which the disappearing timer is to be set
TYPE:
|
timer
|
The duration for the disappearing timer. Can be a timedelta object or an integer representing nanoseconds.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
SetDisappearingTimerError
|
If there is an error in setting the disappearing timer |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
set_force_activate_delivery_receipts
async
¶
This method is used to forcibly activate or deactivate the delivery receipts for a client.
| PARAMETER | DESCRIPTION |
|---|---|
active
|
This parameter determines whether the delivery receipts should be forcibly activated or deactivated. If it's True, the delivery receipts will be forcibly activated, otherwise, they will be deactivated.
TYPE:
|
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
set_group_announce
async
¶
Sets the announcement status of a group.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The unique identifier of the group
TYPE:
|
announce
|
The announcement status to be set. If True, announcements are enabled. If False, they are disabled.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
SetGroupAnnounceError
|
If there is an error while setting the announcement status |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
set_group_locked
async
¶
Sets the locked status of a group identified by the given JID.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber ID) of the group to be locked/unlocked.
TYPE:
|
locked
|
The new locked status of the group. True to lock the group, False to unlock.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
SetGroupLockedError
|
If the operation fails, an error with the reason for the failure is raised. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
set_group_topic
async
¶
Set the topic of a group in a chat application.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The unique identifier of the group
TYPE:
|
previous_id
|
The previous identifier of the topic
TYPE:
|
new_id
|
The new identifier for the topic
TYPE:
|
topic
|
The new topic to be set
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
SetGroupTopicError
|
If there is an error setting the group topic |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
set_privacy_setting
async
¶
This method is used to set the privacy settings of a user.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The name of the privacy setting to be changed.
TYPE:
|
value
|
The new value for the privacy setting.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
SetPrivacySettingError
|
If there is an error while setting the privacy setting. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
set_passive
async
¶
Sets the passive mode of the client.
| PARAMETER | DESCRIPTION |
|---|---|
passive
|
If True, sets the client to passive mode. If False, sets the client to active mode.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
SetPassiveError
|
If an error occurs while setting the client to passive mode. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
set_status_message
async
¶
Sets a status message for a client using the client's UUID.
| PARAMETER | DESCRIPTION |
|---|---|
msg
|
The status message to be set.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
SetStatusMessageError
|
If there is an error while setting the status message. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
subscribe_presence
async
¶
This method is used to subscribe to the presence of a certain JID (Jabber ID).
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The Jabber ID (JID) that we want to subscribe to.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
SubscribePresenceError
|
If there is an error while subscribing to the presence of the JID. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
unfollow_newsletter
async
¶
Unfollows a newsletter by providing the JID (Jabber ID) of the newsletter.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The Jabber ID of the newsletter to unfollow.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
UnfollowNewsletterError
|
If there is an error while attempting to unfollow the newsletter. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
unlink_group
async
¶
This method is used to unlink a child group from a parent group.
| PARAMETER | DESCRIPTION |
|---|---|
parent
|
The JID of the parent group from which the child group is to be unlinked.
TYPE:
|
child
|
The JID of the child group which is to be unlinked from the parent group.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
UnlinkGroupError
|
If there is an error while unlinking the child group from the parent group. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
update_blocklist
async
¶
Function to update the blocklist with a given action on a specific JID.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The Jabber ID (JID) of the user to be blocked or unblocked.
TYPE:
|
action
|
The action to be performed (block or unblock) on the JID.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Blocklist
|
The updated blocklist. |
| RAISES | DESCRIPTION |
|---|---|
UpdateBlocklistError
|
If there is an error while updating the blocklist. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
update_group_participants
async
¶
update_group_participants(jid: JID, participants_changes: List[JID], action: ParticipantChange) -> RepeatedCompositeFieldContainer[GroupParticipant]
This method is used to update the list of participants in a group. It takes in the group's JID, a list of participant changes, and an action to perform.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber ID) of the group to update.
TYPE:
|
participants_changes
|
A list of JIDs representing the participants to be added or removed.
TYPE:
|
action
|
The action to perform (add, remove, promote or demote participants).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
RepeatedCompositeFieldContainer[GroupParticipant]
|
A list of the updated group participants. |
| RAISES | DESCRIPTION |
|---|---|
UpdateGroupParticipantsError
|
This error is raised if there is a problem updating the group participants. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
upload_newsletter
async
¶
Uploads the newsletter to the server.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
The newsletter content in bytes.
TYPE:
|
media_type
|
The type of media being uploaded.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
UploadResponse
|
The response from the server after the upload. |
| RAISES | DESCRIPTION |
|---|---|
UploadError
|
If there is an error during the upload process. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
create_group
async
¶
create_group(name: str, participants: List[JID] = [], linked_parent: Optional[GroupLinkedParent] = None, group_parent: Optional[GroupParent] = None) -> GroupInfo
Create a new group.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The name of the new group.
TYPE:
|
participants
|
Optional. A list of participant JIDs (Jabber Identifiers) to be included in the group. Defaults to an empty list.
TYPE:
|
linked_parent
|
Optional. Information about a linked parent group, if applicable. Defaults to None.
TYPE:
|
group_parent
|
Optional. Information about a parent group, if applicable. Defaults to None.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
GroupInfo
|
Information about the newly created group. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
get_group_request_participants
async
¶
get_group_request_participants(jid: JID) -> RepeatedCompositeFieldContainer[GroupParticipantRequest]
Get the participants of a group request.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID of the group request.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
RepeatedCompositeFieldContainer[JID]
|
A list of JIDs representing the participants of the group request. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
get_joined_groups
async
¶
Get the joined groups for the current user.
| RETURNS | DESCRIPTION |
|---|---|
RepeatedCompositeFieldContainer[GroupInfo]
|
A list of :class: |
| RAISES | DESCRIPTION |
|---|---|
GetJoinedGroupsError
|
If there was an error retrieving the joined groups. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
create_newsletter
async
¶
create_newsletter(name: str, description: str, picture: Union[str, bytes]) -> NewsletterMetadata
Create a newsletter with the given name, description, and picture.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The name of the newsletter.
TYPE:
|
description
|
The description of the newsletter.
TYPE:
|
picture
|
The picture of the newsletter. It can be either a URL or bytes.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NewsletterMetadata
|
The metadata of the created newsletter. |
| RAISES | DESCRIPTION |
|---|---|
CreateNewsletterError
|
If there is an error creating the newsletter. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
follow_newsletter
async
¶
Follows a newsletter with the given JID.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID of the newsletter to follow.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
None
|
None |
| RAISES | DESCRIPTION |
|---|---|
FollowNewsletterError
|
If there is an error following the newsletter. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
get_newsletter_info_with_invite
async
¶
Retrieves the newsletter information with an invite using the provided key.
| PARAMETER | DESCRIPTION |
|---|---|
key
|
The key used to identify the newsletter.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NewsletterMetadata
|
The newsletter metadata. |
| RAISES | DESCRIPTION |
|---|---|
GetNewsletterInfoWithInviteError
|
If there is an error retrieving the newsletter information. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
get_newsletter_message_update
async
¶
get_newsletter_message_update(jid: JID, count: int, since: int, after: int) -> RepeatedCompositeFieldContainer[NewsletterMessage]
Retrieves a list of newsletter messages that have been updated since a given timestamp.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber ID) of the user.
TYPE:
|
count
|
The maximum number of messages to retrieve.
TYPE:
|
since
|
The timestamp (in milliseconds) to retrieve messages from.
TYPE:
|
after
|
The timestamp (in milliseconds) to retrieve messages after.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
RepeatedCompositeFieldContainer[NewsletterMessage]
|
A list of updated newsletter messages. |
| RAISES | DESCRIPTION |
|---|---|
GetNewsletterMessageUpdateError
|
If there was an error retrieving the newsletter messages. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
get_newsletter_messages
async
¶
get_newsletter_messages(jid: JID, count: int, before: MessageServerID) -> RepeatedCompositeFieldContainer[NewsletterMessage]
Retrieves a list of newsletter messages for a given JID.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID (Jabber Identifier) of the user.
TYPE:
|
count
|
The maximum number of messages to retrieve.
TYPE:
|
before
|
The ID of the message before which to retrieve messages.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
RepeatedCompositeFieldContaine[NewsletterMessage]
|
A list of newsletter messages. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
get_privacy_settings
async
¶
This function retrieves the my privacy settings.
| RETURNS | DESCRIPTION |
|---|---|
PrivacySettings
|
privacy settings |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
get_profile_picture
async
¶
get_profile_picture(jid: JID, extra: GetProfilePictureParams = neonize_proto.GetProfilePictureParams()) -> ProfilePictureInfo
This function is used to get the profile picture of a user.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The unique identifier of the user whose profile picture we want to retrieve.
TYPE:
|
extra
|
Additional parameters, defaults to neonize_proto.GetProfilePictureParams()
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ProfilePictureInfo
|
The information about the profile picture. |
| RAISES | DESCRIPTION |
|---|---|
GetProfilePictureError
|
If there is an error while trying to get the profile picture. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
get_status_privacy
async
¶
Returns the status privacy settings of the user.
| RETURNS | DESCRIPTION |
|---|---|
RepeatedCompositeFieldContainer[StatusPrivacy]
|
The status privacy settings of the user. |
| RAISES | DESCRIPTION |
|---|---|
GetStatusPrivacyError
|
If there is an error in getting the status privacy. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
get_sub_groups
async
¶
Get the subgroups of a given community.
| PARAMETER | DESCRIPTION |
|---|---|
community
|
The community for which to get the subgroups.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
RepeatedCompositeFieldContainer[GroupLinkTarget]
|
The subgroups of the given community. |
| RAISES | DESCRIPTION |
|---|---|
GetSubGroupsError
|
If there is an error while getting the subgroups. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
get_subscribed_newletters
async
¶
This function retrieves the newsletters the user has subscribed to.
| RETURNS | DESCRIPTION |
|---|---|
RepeatedCompositeFieldContainer[NewsletterMetadata]
|
A container with the metadata of each subscribed newsletter |
| RAISES | DESCRIPTION |
|---|---|
GetSubscribedNewslettersError
|
If there is an error while fetching the subscribed newsletters |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
get_user_devices
async
¶
Retrieve devices associated with specified user JIDs.
| PARAMETER | DESCRIPTION |
|---|---|
jids
|
Variable number of JIDs (Jabber Identifiers) of users.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
RepeatedCompositeFieldContainer[JID]
|
Devices associated with the specified user JIDs. |
| RAISES | DESCRIPTION |
|---|---|
GetUserDevicesError
|
If there is an error retrieving user devices. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
get_blocklist
async
¶
Retrieves the blocklist from the client.
| RETURNS | DESCRIPTION |
|---|---|
Blocklist
|
Blocklist: The retrieved blocklist. |
| RAISES | DESCRIPTION |
|---|---|
GetBlocklistError
|
If there was an error retrieving the blocklist. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
get_me
async
¶
This method is used to get the device information associated with a given UUID.
| RETURNS | DESCRIPTION |
|---|---|
Device
|
It returns a Device object created from the byte string response from the client's GetMe method. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
get_contact_qr_link
async
¶
This function returns a QR link for a specific contact. If the 'revoke' parameter is set to True, it revokes the existing QR link and generates a new one.
| PARAMETER | DESCRIPTION |
|---|---|
revoke
|
If set to True, revokes the existing QR link and generates a new one. Defaults to False.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The QR link for the contact. |
| RAISES | DESCRIPTION |
|---|---|
GetContactQrLinkError
|
If there is an error in getting the QR link. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
get_linked_group_participants
async
¶
Fetches the participants of a linked group in a community.
| PARAMETER | DESCRIPTION |
|---|---|
community
|
The community in which the linked group belongs.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
RepeatedCompositeFieldContainer[JID]
|
A list of participants in the linked group. |
| RAISES | DESCRIPTION |
|---|---|
GetLinkedGroupParticipantsError
|
If there is an error while fetching the participants. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
get_newsletter_info
async
¶
Fetches the metadata of a specific newsletter using its JID.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The unique identifier of the newsletter
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
neonize_proto.NewsletterMetadata
|
The metadata of the requested newsletter |
| RAISES | DESCRIPTION |
|---|---|
GetNewsletterInfoError
|
If there is an error while fetching the newsletter information |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
PairPhone
async
¶
PairPhone(phone: str, show_push_notification: bool, client_name: ClientName = ClientName.LINUX, client_type: Optional[ClientType] = None)
Pair a phone with the client. This function will try to connect to the WhatsApp servers and pair the phone. If successful, it will show a push notification on the paired phone.
| PARAMETER | DESCRIPTION |
|---|---|
phone
|
The phone number to be paired.
TYPE:
|
show_push_notification
|
If true, a push notification will be shown on the paired phone.
TYPE:
|
client_name
|
The name of the client, defaults to LINUX.
TYPE:
|
client_type
|
The type of the client, defaults to None. If None, it will be set to FIREFOX or determined by the device properties.
TYPE:
|
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
| Python | |
|---|---|
3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 | |
idle
async
¶
stop
async
¶
get_message_for_retry
async
¶
get_message_for_retry(requester: JID, to: JID, message_id: str) -> typing.Union[None, Message]
This function retrieves a specific message for retrying transmission. It communicates with a client to get the message using provided requester, recipient, and message ID.
| PARAMETER | DESCRIPTION |
|---|---|
requester
|
The JID of the entity requesting the message.
TYPE:
|
to
|
The JID of the intended recipient of the message.
TYPE:
|
message_id
|
The unique identifier of the message to be retrieved.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Union[None, Message]
|
The message to be retried if found, None otherwise. |
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
decrypt_poll_vote
async
¶
Decrypt PollMessage
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
connect
async
¶
Establishes a connection to the WhatsApp servers.
Source code in .venv/lib/python3.12/site-packages/neonize/aioze/client.py
Events¶
neonize.events
¶
Classes¶
EventsManager
¶
Event
¶
Initializes the Event class with a client of type NewClient. Also sets up a default blocking function and an empty dictionary for list functions.
| PARAMETER | DESCRIPTION |
|---|---|
client
|
An instance of the NewClient class
TYPE:
|
Source code in .venv/lib/python3.12/site-packages/neonize/events.py
Functions¶
execute
¶
Executes a function from the list of functions based on the given code.
| PARAMETER | DESCRIPTION |
|---|---|
binary
|
The binary data to be processed by the function.
TYPE:
|
size
|
The size of the binary data.
TYPE:
|
code
|
The index of the function to be executed from the list of functions.
TYPE:
|
Source code in .venv/lib/python3.12/site-packages/neonize/events.py
Types¶
neonize.types
¶
Utilities¶
neonize.utils
¶
Classes¶
BlocklistAction
¶
Bases: Enum
Enumeration of blocklist actions.
Attributes: BLOCK (str): Block action. UNBLOCK (str): Unblock action.
ChatPresence
¶
Bases: Enum
Enum representing the presence status in a chat.
Attributes: CHAT_PRESENCE_COMPOSING (int): Indicates that the user is currently composing a message. CHAT_PRESENCE_PAUSED (int): Indicates that the user has paused composing a message.
ChatPresenceMedia
¶
Bases: Enum
Enum representing the type of media being used in a chat.
Attributes: CHAT_PRESENCE_MEDIA_TEXT (int): Indicates that the chat media type is text. CHAT_PRESENCE_MEDIA_AUDIO (int): Indicates that the chat media type is audio.
ClientName
¶
Bases: Enum
Enumeration of client names.
Attributes: LINUX (str): Linux operating system. WINDOWS (str): Windows operating system. ANDROID (str): Android operating system.
ClientType
¶
Bases: Enum
Enumeration of client types.
Attributes: UNKNOWN (int): Unknown client type. CHROME (int): Chrome browser. EDGE (int): Microsoft Edge browser. FIREFOX (int): Mozilla Firefox browser. IE (int): Internet Explorer browser. OPERA (int): Opera browser. SAFARI (int): Safari browser. ELECTRON (int): Electron framework. UWP (int): Universal Windows Platform. OTHER (int): Other client types.
MediaType
¶
Bases: Enum
Functions¶
to_mms
¶
Converts the MediaType to its corresponding MediaTypeToMMS enum member.
| RETURNS | DESCRIPTION |
|---|---|
MediaTypeToMMS
|
The corresponding MediaTypeToMMS enum member. |
Source code in .venv/lib/python3.12/site-packages/neonize/utils/enum.py
from_magic
classmethod
¶
Returns the MediaType based on file magic bytes or file extension.
| PARAMETER | DESCRIPTION |
|---|---|
fn_or_bytes
|
Either a file path (str) or binary data (bytes) for determining the MediaType.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
MediaType
|
The determined MediaType. |
Source code in .venv/lib/python3.12/site-packages/neonize/utils/enum.py
ParticipantChange
¶
Bases: Enum
Enumeration of participant change actions.
Attributes: ADD (str): Add participant action. REMOVE (str): Remove participant action. PROMOTE (str): Promote participant action. DEMOTE (str): Demote participant action.
ParticipantRequestChange
¶
Bases: Enum
Enumeration of participant request change actions.
Attributes: APPROVE (str): Approve participant request action. REJECT (str): Reject participant request action.
PrivacySetting
¶
Bases: Enum
Enumeration of privacy settings.
Attributes: UNDEFINED (str): Undefined privacy setting. ALL (str): All privacy setting. CONTACTS (str): Contacts privacy setting. CONTACTS_BLACKLIST (str): Contacts blacklist privacy setting. MATCH_LAST_SEEN (str): Match last seen privacy setting. KNOWN (str): Known privacy setting. NONE (str): None privacy setting.
PrivacySettingType
¶
Bases: Enum
Enumeration of privacy setting types.
Attributes: GROUP_ADD (str): Group add privacy setting. LAST_SEEN (str): Last seen privacy setting. STATUS (str): Status privacy setting. PROFILE (str): Profile privacy setting. READ_RECEIPTS (str): Read receipts privacy setting. ONLINE (str): Online privacy setting. CALL_ADD (str): Call add privacy setting.
ReceiptType
¶
Bases: Enum
Enum representing different types of message receipts.
Attributes: DELIVERED (bytes): Indicates that the message has been delivered. SENDER (bytes): Indicates that the message is from the sender. RETRY (bytes): Indicates a retry receipt. READ (bytes): Indicates that the message has been read. READ_SELF (bytes): Indicates that the message has been read by the sender themselves. PLAYED (bytes): Indicates that the message has been played (e.g., for audio messages). PLAYED_SELF (bytes): Indicates that the message has been played by the sender themselves. SERVER_ERROR (bytes): Indicates a server error receipt. INACTIVE (bytes): Indicates that the recipient is inactive. PEER_MSG (bytes): Indicates a peer message receipt. HISTORY_SYNC (str): Indicates that the message is part of a history sync.
FFmpeg
¶
Initializes the FFmpeg class. If the data is a URL, it retrieves the data from the URL and writes it to a temporary file. If the data is a string that is not a URL, it treats the string as a filename. If the data is bytes, it writes the bytes to a temporary file.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
The input data. This can be a URL, a filename, or bytes.
TYPE:
|
prefix
|
The prefix for the temporary file, if one is created. If None, no prefix is used.
TYPE:
|
Source code in .venv/lib/python3.12/site-packages/neonize/utils/ffmpeg.py
Functions¶
cv_to_webp
¶
cv_to_webp(animated: bool = True, enforce_not_broken: bool = False, animated_gif: bool = False, max_sticker_size: int = 0, is_webm=False) -> bytes
This function converts a given file to webp format using ffmpeg. If the animated flag is set to True, it will only convert the first 6 seconds of the file.
| PARAMETER | DESCRIPTION |
|---|---|
animated
|
If True, only the first 6 seconds of the file will be converted, defaults to True
TYPE:
|
enforce_not_broken
|
Enforce non-broken stickers by constraining sticker size to WA limits, defaults to False
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bytes
|
The converted file in bytes |
Source code in .venv/lib/python3.12/site-packages/neonize/utils/ffmpeg.py
| Python | |
|---|---|
497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 | |
gif_to_mp4
¶
This function convertes a gif to mp4 format.
Source code in .venv/lib/python3.12/site-packages/neonize/utils/ffmpeg.py
extract_thumbnail
¶
extract_thumbnail(format: ImageFormat = ImageFormat.JPG, size: Optional[Tuple[int, int] | int] = 200) -> bytes
Extracts a thumbnail from a video file.
| PARAMETER | DESCRIPTION |
|---|---|
format
|
The format of the output thumbnail, defaults to ImageFormat.JPG
TYPE:
|
size
|
The size of the output thumbnail. If an integer is provided, the thumbnail will be scaled while maintaining the aspect ratio. If a tuple of two integers is provided, it will be used as the exact dimensions for the thumbnail, defaults to 200
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bytes
|
The bytes representing the thumbnail image. |
Source code in .venv/lib/python3.12/site-packages/neonize/utils/ffmpeg.py
extract_info
¶
Extracts media file information using ffprobe tool.
This method uses ffprobe, a tool from the FFmpeg package, to extract information about a media file. It returns the information in the form of an FFProbeInfo object, which contains the format and streams of the media file.
| RETURNS | DESCRIPTION |
|---|---|
FFProbeInfo
|
An FFProbeInfo object containing the format and streams of the media file. |
Source code in .venv/lib/python3.12/site-packages/neonize/utils/ffmpeg.py
Functions¶
AspectRatioMethod
¶
AspectRatioMethod(width: int | float, height: int | float, res: int = 1280) -> Tuple[int, int]
Calculate the aspect ratio of a given width and height with respect to a resolution.
| PARAMETER | DESCRIPTION |
|---|---|
width
|
The width of the given area.
TYPE:
|
height
|
The height of the given area.
TYPE:
|
res
|
The resolution to calculate the aspect ratio with, defaults to 1280.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tuple[int, int]
|
A tuple containing the calculated width and height based on the aspect ratio. |
Source code in .venv/lib/python3.12/site-packages/neonize/utils/calc.py
get_bytes_from_name_or_url
¶
Gets bytes from either a file name or a URL.
| PARAMETER | DESCRIPTION |
|---|---|
args
|
Either a file name (str) or binary data (bytes).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bytes
|
The bytes extracted from the specified file name or URL. |
Source code in .venv/lib/python3.12/site-packages/neonize/utils/iofile.py
Jid2String
¶
Converts a Jabber Identifier (JID) to a string.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The Jabber Identifier (JID) to be converted.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The string representation of the JID. |
Source code in .venv/lib/python3.12/site-packages/neonize/utils/jid.py
JIDToNonAD
¶
Converts a JID (Jabber ID) to a non-AD (Active Directory) format by setting RawAgent and Device to 0.
| PARAMETER | DESCRIPTION |
|---|---|
jid
|
The JID to be converted.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
JID
|
A new JID object with RawAgent and Device set to 0. |
Source code in .venv/lib/python3.12/site-packages/neonize/utils/jid.py
build_jid
¶
Builds a JID (Jabber ID) from a phone number.
| PARAMETER | DESCRIPTION |
|---|---|
phone_number
|
The phone number to be used for building the JID.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
JID
|
A JID object constructed from the given phone number. |
Source code in .venv/lib/python3.12/site-packages/neonize/utils/jid.py
extract_text
¶
Extracts text content from a message.
| PARAMETER | DESCRIPTION |
|---|---|
message
|
The message object.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The extracted text content. |
Source code in .venv/lib/python3.12/site-packages/neonize/utils/message.py
get_message_type
¶
Determines the type of message.
| PARAMETER | DESCRIPTION |
|---|---|
message
|
The message object.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
MediaMessageType | TextMessageType
|
The type of the message. |
| RAISES | DESCRIPTION |
|---|---|
IndexError
|
If the message type cannot be determined. |
Source code in .venv/lib/python3.12/site-packages/neonize/utils/message.py
add_exif
¶
Adds EXIF metadata to a sticker pack.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Name of the sticker pack, defaults to an empty string.
TYPE:
|
packname
|
Publisher of the sticker pack, defaults to an empty string.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bytes
|
Byte array containing the EXIF metadata. |
Source code in .venv/lib/python3.12/site-packages/neonize/utils/sticker.py
gen_vcard
¶
Generates a vCard string for a contact.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Name of the contact.
TYPE:
|
phone_number
|
Phone number of the contact.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
vCard string for the contact. |
Source code in .venv/lib/python3.12/site-packages/neonize/utils/__init__.py
validate_link
¶
Validates if the provided link is a valid URL.
| PARAMETER | DESCRIPTION |
|---|---|
link
|
The URL to validate.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if the URL is valid, False otherwise. |
Source code in .venv/lib/python3.12/site-packages/neonize/utils/__init__.py
Exceptions¶
neonize.exc
¶
Quick Links¶
- Client Reference - Synchronous client methods
- Async Client Reference - Asynchronous client methods
- Events Reference - Event types and handlers
- Types Reference - Data types and models
- Utils Reference - Utility functions
- Exceptions Reference - Exception classes