Parameter | Type | Default | Description |
---|---|---|---|
token | Optional[str] | None | Telegram Bot API token. If not provided, will check TELEGRAM_TOKEN environment variable. |
chat_id | Union[str, int] | - | The ID of the chat to send messages to. |
Function | Description |
---|---|
send_message | Sends a message to the specified Telegram chat. Takes a message string as input and returns the API response as text. If an error occurs, returns an error message. |