Repository navigation
v0.7.0
Privacy change: tg now sends usage stats to its author, on by default: how often it runs, which
commands run (chats list, never their arguments), the error codes they end with, the version,
how it was installed and the OS, tied to a random install ID. It never sends messages, chat or
contact names, phone numbers, account, chat or user IDs or queries. Nothing is sent until tg
has shown a one-line notice, or from CI, tests or a source checkout. Turn it off with
tg telemetry off, TELEGRAM_SYNC_CLI_TELEMETRY=0 or DO_NOT_TRACK=1; everything that is
sent is listed on https://usage.sergeybaus.com.
Added
- Usage stats, through usage.sergeybaus.com to PostHog. A run sends
app_started, the command
path asfeature_usedand, when it fails, the error code or Telegram's RPC error name
(FLOOD_WAIT) aserror_occurred; an error readingconfig.jsonor a cache also sends its
message, without account numbers, a data directory set byTELEGRAM_SYNC_CLI_DATA_DIR, the
home folder or the user name. The daemon and runs from a script send each event at most once
a day, and the daemon checks in hourly while it runs. Every exit waits at most 500 ms for the requests in flight. Details:
README "Usage stats" anddocs/configuration.md#usage-stats. tg telemetry status [--json],tg telemetry onandtg telemetry off: whether usage stats
are on and which rule decided, the install ID and the state file (telemetry.jsonin the
data directory);offalso deletes the install ID.- The Homebrew formula's caveats repeat the notice, and its test runs with usage stats off.
tg messages list,getandsearchitems haveattachment: the
message's file with its kind (photo, video, video note, GIF, voice, audio,
sticker, document), file name, MIME type, size, duration, dimensions, album
ID anduniqueFileId, ornull. It is read fromraw_json, so messages
cached before have it too. Fortg sql, the new table
message_attachmentsholds the same for messages written from now on;
older messages get their rows later (#89, #22).tg media download --chat <chat> --id <message>saves a message's file
into the account's media cache,accounts/<id>/media, and prints its path.
A cached file needs no network and no credentials. Otherwise the message
is fetched again for a fresh file reference, and a partial download
resumes on the next run.--outcopies the file to a directory or a path
(FILE_EXISTSunless--overwrite),--out -writes it to stdout, and
--thumbfetches its small preview. Media from chats and messages with
content protection, and self-destructing media, is refused with
CONTENT_PROTECTED. New error codes, all exit 1:NO_MEDIA,
MESSAGE_NOT_FOUND,CONTENT_PROTECTED,MEDIA_UNSUPPORTED(files from
Telegram's CDN) andFILE_EXISTS. Seedocs/media.md(#22).tg media cleanremoves partial downloads untouched for a day; with
--older-than,--chator--allit removes cached files too, and
reports the bytes it freed (#22).tg send --file <path> [--caption <text>]sends one file: a JPEG, PNG or
WebP image up to 10 MB as a photo, anything else as a document
(--force-documentfor an image too). The sent message is cached with its
attachment (#22).tg status --sizesshows each account's media cache
(accounts.accounts[].media,storage.media_bytes), counted apart from
the cache database (#22).
Changed
- History sync writes the same
message_typeandhas_mediaas live
updates:voice,video,sticker,audioanddiceinstead of
documentormedia, andhas_media0 for media Telegram apps don't show
(unsupported media, an expired photo, a link preview still pending).
Messages cached before keep their values until they are fetched again
(#22).