Telegram
| Schemes | tgram:// |
| Cargo feature | service-telegram |
| Service | https://telegram.org/ |
| Body formats | html, markdown (first is the default) |
| Attachments | yes |
| Title length | no title (merged into the body) |
| Body length | 4,096 characters |
| Body lines | unlimited |
| Request throttle | none |
| Vendor URLs accepted | no |
URL formats
{schema}://{bot_token}
{schema}://{bot_token}/{targets}
{schema} is one of tgram://.
URL tokens
| Token | Meaning | Type | Required | Default | Notes |
|---|---|---|---|---|---|
{bot_token} | Bot Token | string | yes | secret; must match ^(bot)?(?P<key>[0-9]+:[a-z0-9_-]+)$ | |
{target_user} | Target Chat ID | string | no | must match ^((-?[0-9]{1,32})|([a-z_-][a-z0-9_-]+))$ | |
{targets} | Targets | list | no | any of target_user; separated by / |
Query parameters
| Parameter | Meaning | Type | Default | Notes |
|---|---|---|---|---|
album | Group Photo/Video Attachments | bool | no | |
content | Content Placement | choice | before | one of before, after |
detect | Detect Bot Owner | bool | yes | |
image | Include Image | bool | no | |
mdv | Markdown Version | choice | v1 | one of v1, v2 |
preview | Web Page Preview | bool | no | |
silent | Silent Notification | bool | no | |
template | Rich Message Template Path | string | secret | |
to | Targets | list | sets {targets} | |
topic | Topic Thread ID | int | also thread |
Prefixed parameters:
:name=value: Template Tokens
The common URL parameters (format, overflow, verify, redirect, cto, rto, retry, wait, store, tag, tz, user, password, port, optional, emojis) apply as well.
Examples
Accepted URLs (tokens are fake):
tgram://123456789:abcdefg_hijklmnop/
tgram://123456789:abcdefg_hijklmnop/1:5/2/
tgram://123456789:abcdefg_hijklmnop/lead2gold/
tgram://bottest@123456789:abcdefg_hijklmnop/lead2gold/
tgram://123456789:abcdefg_hijklmnop/id1/id2/23423/-30/
tgram://123456789:abcdefg_hijklmnop/9876:1234/9876:1111/id1:invalid/-55:0
tgram://123456789:abcdefg_hijklmnop/?topic=9
tgram://123456789:abcdefg_hijklmnop/12345/?album=yes
Rejected URLs:
tgram://123456789:abcdefg_hijklmnop/id1/?topic=invalid
tgram://123456789:abcdefg_hijklmnop/id1/?content=invalid
tgram://alpha:abcdefg_hijklmnop/lead2gold/
tgram://:@/
Send one from the command line:
mercurio -t 'Backup' -b 'Finished in 42s' 'tgram://123456789:abcdefg_hijklmnop/'
Notes
Telegram (tgram://): messages through the Telegram Bot API.
Without a chat id the bot owner is detected with getUpdates once and kept in the persistent store (bot_owner).
Differences with Apprise
- HTML that Apprise’s parser rejects is sent unreduced.