Client Reference¶
The Client class is the primary interface for connecting to Shad Messenger and managing events.
- class aioshad.Client(session: str | Session = 'shad', phone_number: str | None = None, session_directory: str = '.', dispatcher: Dispatcher | None = None, messenger_host: str | None = None, proxy: str | None = None, timeout: float = 30.0)[source]¶
Bases:
objectHigh-performance asynchronous client for Shad Messenger. Supports both Telethon/Pyrogram-style decorator @client.on_message and Aiogram-style Dispatcher & Routers with FSM and Middlewares.
- conversation(chat_guid: str, timeout: float | None = None) Any[source]¶
Starts an interactive conversation session with a chat.
- async delete_message(object_guid: str, message_id: str | int, delete_type: str = 'Global') Dict[str, Any][source]¶
- async delete_messages(object_guid: str, message_ids: str | int | List[str | int], delete_type: str = 'Global') Dict[str, Any][source]¶
- async download_file(file_inline_or_url: str | Dict[str, Any], destination: str | Path | None = None) bytes[source]¶
- async forward_messages(from_object_guid: str, to_object_guid: str, message_ids: str | int | List[str | int]) Dict[str, Any][source]¶
- async get_chat_history(object_guid: str, limit: int = 50, max_id: str | None = None, min_id: str | None = None, sort: str = 'FromMax') List[Message][source]¶
- async get_messages(object_guid: str, limit: int = 50, sort: str = 'FromMax', max_id: str | None = None, min_id: str | None = None) Dict[str, Any][source]¶
- async get_voice_chat_participants(chat_guid: str, voice_chat_id: str | None = None) Dict[str, Any][source]¶
- async join_voice_chat(chat_guid: str, voice_chat_id: str | None = None, sdp_offer_data: str = '') Dict[str, Any][source]¶
- property me: str | None¶
Returns the user GUID of the logged in account.
- property methods: Methods¶
- on_message_edited(*filters: Any) Callable[[Any], Any][source]¶
Decorator to register a message edited handler.
- async send_file(object_guid: str, file: str | bytes | Path, file_name: str | None = None, mime: str | None = None, caption: str | None = None, reply_to_message_id: str | None = None) Message[source]¶
- async send_message(object_guid: str, text: str | None = None, reply_to_message_id: str | None = None, file_inline: Dict[str, Any] | None = None) Message[source]¶
- async send_photo(object_guid: str, photo: str | bytes | Path, caption: str | None = None, reply_to_message_id: str | None = None, file_name: str | None = None) Message[source]¶
- async send_voice(object_guid: str, voice: str | bytes | Path, caption: str | None = None, duration: int | None = None, reply_to_message_id: str | None = None) Message[source]¶
- async set_voice_chat_state(chat_guid: str, voice_chat_id: str, activity: str = 'Speaking', participant_object_guid: str | None = None) Dict[str, Any][source]¶
- property transport: Transport¶