# telegram.message.send

Sends a message to a Telegram chat through the Bot API

# telegram.message.send

```
telegram.message.send --credential TEXT --recipient TEXT --text TEXT [--image TEXT] [--file TEXT] [--format text|markdown|html] [--keyboard KEY=TEXT…] [--in-reply-to N] [--silent] → message
```

Sends a message to a Telegram chat through the Bot API. It sends text, or a photo (`--image`) or a document (`--file`) with `--text` as its caption. `--image` and `--file` take a URL Telegram can fetch or a Telegram file_id. Answers `message: { id, recipient, sent_at, telegram }` — `recipient` is the chat id, `telegram` the Message Telegram returned — and keeps the payload; a refusal from Telegram delivers `error`.

## Flags

- `--credential` (required): The telegram_bot credential: the bot that sends.
- `--recipient` (required): The chat to send to: its id, or @username of a public channel.
- `--text` (required): The message text; with --image or --file, its caption.
- `--image`: A photo to send: a URL Telegram can fetch, or a Telegram file_id. Not with --file.
- `--file`: A document to send: a URL Telegram can fetch, or a Telegram file_id. Not with --image.
- `--format`: How --text is read: text (default), markdown (Telegram MarkdownV2) or html.
- `--keyboard`: An inline button, LABEL=DATA, one per row; DATA comes back as a callback_query's data. Repeat for several, or one {{ object }}.
- `--in-reply-to`: The id of a message in the same chat this one replies to.
- `--silent`: Deliver without a notification sound.
