Repository navigation
Added
-
tg messages listtakes--type,--sinceand--until, so every voice note of a chat, or
the chat since Monday, is one command instead oftg api messages.searchwith a hand-built
peer and filter.--typetakes one or more message types, comma-separated or repeated
(voice,photo,video,document…), plusroundandanimationfor the round video
messages and GIFs thatvideoalso covers;--sinceand--untiltake the forms of
tg messages search. A filtered page reads only the cache, needs no credentials for a chat
the cache knows (a cached@usernameincluded, withallowedChatsset too), explains a name
the cache can't resolve, and pages with--beforeand--afteras before. It addscomplete,trueonly when one cached range covers the page up to the chat's
newest known message and, with--type, every message in it has its type (a date window never
guesses the date of a message the cache lacks);missing
(history,types) says why it isfalse,missingBeforewhere the newest gap ends, and
suggestionone sentence.nextof an incomplete page has what fills it
(tg messages list --fresh,tg db migrate), then the same page again, with--account
kept;nextcarries--sinceand--untilresolved to UTC seconds. Without the new flags the
output is unchanged.tg messages searchtakes--typetoo, echoes it infilters.typeand
addstypesPending; itsnextthen finishes a pending migration. Both commands suggest a
one-time manual fetch for media whose type is unknown. When only the type is missing,
listomits the automatic next page even if it has enough known matches to fill the limit. -
tg media downloadtakes several--idvalues and downloads the files of those messages of
the chat in one run: up to 100 IDs per fetch, one private-chat protection check, up to 5 files at
a time (2 of 20 MiB or more) and a flood wait that pauses the whole batch instead of failing
files. A file fails on waits only after six in a row with no part downloaded between them,
so a large download throttled by Telegram's speed limit completes. It prints one JSON line per file as each finishes, success or error, and exits 1 when
any failed. Cached files need no network and partial files resume, as before. One--id
prints what it printed before; a repeated--idstill runs as a batch, downloading the ID once. -
--outtakes a name template such as./media/{chat}/{date}_{id}_{name}(placeholders
{chat},{id},{date},{name},{kind}); each filled part is made a safe file name,
and one that exists as a symlink fails that file instead of being followed.
With several--id, a directory--outnames files{id}_{name}, so two photos no longer
collide onphoto.jpg. Repeating a batch accepts existing files with identical bytes. A
collision between different files in one batch returnsFILE_EXISTSeven with--overwrite.
Without--overwrite, a new file is published with a hard link; on a filesystem without
hard links (exFAT, FAT, some network shares) it is copied instead, never over an existing
file. If the copy is interrupted, use--overwriteto replace a partial export. -
Transcribe voice and video notes with a local Whisper program using
tg media transcribe. Search their transcripts withtg messages search, including snippets and counts.
Fixed
tg messages search --sinceand--untilwith milliseconds round up to the next second,
since message dates are whole seconds:--until 00:01:40.500Zno longer leaves out a message
sent at00:01:40, and--sincewith milliseconds no longer takes one sent just before it.
Itsnextcarries the bounds resolved to UTC, so a relative bound (60s) keeps its window
across pages.- With
allowedChatsset,tg messages searchresolves its chat and the list from the cache
alone, so a cached@usernamewithout an access hash needs no credentials again. tg messages search --freshisINVALID_ARGSthat says search reads only the cache, instead
of a generic unknown option.- A string flag's value that looks like a repeatable flag is no longer read as that flag:
tg send --caption '--file=x'sends that caption. - A cached page of history vouches for the IDs above its newest message only up to the chat's
newest message known before the request: a fetch that Telegram answers with nothing new now
settles the gap (tg messages list --before 21 --freshbelow a known message 30, a chat
Telegram shows empty, or a chat whose newest messages were deleted), and a message cached while
the request ran no longer vouches for a page that could miss a message sent meanwhile. The
daemon's history pages follow the same rule.