middleware.py imports, the senderID source, synchronous error handling, and common return bodies.
Import style
getSenderID() reads the current runtime context ID from runtime arguments. autClaw injects runtime credentials for message triggers, route triggers, and cron / fake contexts; plugins should not build /api/plugins/runtime URLs manually.
Common return values
SendReceipt
Text, media, and recall methods usually return a send receipt.receipt.get("ok") is False. Message IDs may appear as either message_id or messageid.
FileDownloadResult
fileDownload(...) and downloadAdapterFile(...) return local file information.
MediaItem
sender.getMediaItems() returns media items from the current event or the latest listen(...) / input(...) result.
downloadAdapterFile(...). Do not parse platform-specific raw fields manually.
WaitPaySuccess
waitPay(...) returns a payment event object on success; it returns the string "timeout" on timeout and "busy" when another waiter is active.
Error handling
Python SDK calls return synchronously. Runtime request failures, missing required arguments, or dependency installation failures raiseException.
Next steps
- Read users, chats, and reply to messages:
Sender message capabilities - View complete signatures:
Python signatures