Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Telegram

Schemestgram://
Cargo featureservice-telegram
Servicehttps://telegram.org/
Body formatshtml, markdown (first is the default)
Attachmentsyes
Title lengthno title (merged into the body)
Body length4,096 characters
Body linesunlimited
Request throttlenone
Vendor URLs acceptedno

URL formats

{schema}://{bot_token}
{schema}://{bot_token}/{targets}

{schema} is one of tgram://.

URL tokens

TokenMeaningTypeRequiredDefaultNotes
{bot_token}Bot Tokenstringyessecret; must match ^(bot)?(?P<key>[0-9]+:[a-z0-9_-]+)$
{target_user}Target Chat IDstringnomust match ^((-?[0-9]{1,32})|([a-z_-][a-z0-9_-]+))$
{targets}Targetslistnoany of target_user; separated by /

Query parameters

ParameterMeaningTypeDefaultNotes
albumGroup Photo/Video Attachmentsboolno
contentContent Placementchoicebeforeone of before, after
detectDetect Bot Ownerboolyes
imageInclude Imageboolno
mdvMarkdown Versionchoicev1one of v1, v2
previewWeb Page Previewboolno
silentSilent Notificationboolno
templateRich Message Template Pathstringsecret
toTargetslistsets {targets}
topicTopic Thread IDintalso 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.