Telegram Sending Chipset

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.

Features:

  • Supports all Telegram Bot API sending methods (e.g., sendMessage, sendPhoto, sendVideo).
  • Configurable Telegram bot token and chat settings.
  • Dynamic method execution with flexible parameters.
  • Handles connection errors, rate limits, and invalid methods gracefully.

View source code here: GitHub

telegram.telegram_send

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:

Telegram Bot API Reference

Request Parameters

FieldTypeDescription
client_settingsConfiguration for the Telegram Bot client.
chat_idtyping.Union[str, int]Unique identifier for the target chat or username of the target channel (e.g., '@channelusername').
methodThe Telegram Bot API method to execute (e.g., 'sendMessage', 'sendPhoto', 'sendDocument').
paramstyping.Dict[str, typing.Any]Additional parameters for the method (e.g., 'text', 'photo', 'caption').

Response

FieldTypeDescription
statustyping.Literal['OK', 'CONNECTION_ERROR', 'RATE_LIMIT', 'INVALID_TOKEN', 'METHOD_NOT_FOUND', 'TELEGRAM_ERROR', 'ERROR']Status of the request.
resulttyping.Optional[typing.Any]The result of the Telegram operation (if successful).
error_messagetyping.Optional[str]Error message if the operation failed.

© 2025 South Patron LLC. All rights reserved.

AI everywhere.