This module provides a flexible wrapper for sending messages via Telegram's Bot API. It defines a dynamic chip that can execute any Telegram sending method asynchronously, with configurable client settings and error handling.
View source code here: GitHub
Sends a message or media using Telegram's Bot API.
This chip dynamically executes any Telegram sending method (e.g., sendMessage, sendPhoto) based on the provided method name and parameters. Refer to the Telegram Bot API documentation for available methods and parameters:
Field | Type | Description |
---|---|---|
client_settings | Configuration for the Telegram Bot client. | |
chat_id | typing.Union[str, int] | Unique identifier for the target chat or username of the target channel (e.g., '@channelusername'). |
method | The Telegram Bot API method to execute (e.g., 'sendMessage', 'sendPhoto', 'sendDocument'). | |
params | typing.Dict[str, typing.Any] | Additional parameters for the method (e.g., 'text', 'photo', 'caption'). |
Field | Type | Description |
---|---|---|
status | typing.Literal['OK', 'CONNECTION_ERROR', 'RATE_LIMIT', 'INVALID_TOKEN', 'METHOD_NOT_FOUND', 'TELEGRAM_ERROR', 'ERROR'] | Status of the request. |
result | typing.Optional[typing.Any] | The result of the Telegram operation (if successful). |
error_message | typing.Optional[str] | Error message if the operation failed. |
© 2025 South Patron LLC. All rights reserved.
AI everywhere.