account: Message length property

This commit is contained in:
Nick Ninov
2026-08-29 16:40:08 +03:00
parent 82e9e2ad59
commit d90ca78869
2 changed files with 32 additions and 2 deletions
+27
View File
@@ -1908,6 +1908,33 @@ for chat in account.chats:
print(f"{chat['type']}\t{chat['name']}\t{chat['id']}")
```
#### `message_length`
The maximum number of characters a single message may contain, as enforced by Status App.
Returns `int`.
```python
from status_sdk import Account
account = Account()
params = {
"name": "status-app-bot",
"password": "SNTPUMP"
}
account.login(**params)
print(account.message_length)
# This is under the assumption you already have a contact / joined a community
chat = account.chats[0]
report = "A very long report..."
# Split a long text into messages the app accepts
for index in range(0, len(report), account.message_length):
account.send_message(chat["id"], report[index:index + account.message_length])
```
### Wallet
#### `chains`
+5 -2
View File
@@ -13,7 +13,6 @@ from .signal import Signal
from .logger import Logger
class Account:
# Enum mappings from original wakuext.py
__mappings = {
"contact_request": {
@@ -594,6 +593,10 @@ class Account:
balance.insert(0, "timestamp", datetime.datetime.now())
return balance.copy()
@property
def message_length(self) -> int:
return 2_000
@property
def status(self) -> str:
"""
@@ -738,7 +741,7 @@ class Account:
if not message:
message = ""
if len(message) > 2_000:
if len(message) > self.message_length:
raise exceptions.MessageTooLongError(f"Message cannot be longer than 2000 characters (got {len(message)})...")
msg_params = {