Skip to content

v0.7.0

Choose a tag to compare

@github-actions github-actions released this 28 Oct 23:10
· 10 commits to main since this release

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 as feature_used and, when it fails, the error code or Telegram's RPC error name
    (FLOOD_WAIT) as error_occurred; an error reading config.json or a cache also sends its
    message, without account numbers, a data directory set by TELEGRAM_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" and docs/configuration.md#usage-stats.
  • tg telemetry status [--json], tg telemetry on and tg telemetry off: whether usage stats
    are on and which rule decided, the install ID and the state file (telemetry.json in the
    data directory); off also deletes the install ID.
  • The Homebrew formula's caveats repeat the notice, and its test runs with usage stats off.
  • tg messages list, get and search items have attachment: 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 and uniqueFileId, or null. It is read from raw_json, so messages
    cached before have it too. For tg sql, the new table
    message_attachments holds 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. --out copies the file to a directory or a path
    (FILE_EXISTS unless --overwrite), --out - writes it to stdout, and
    --thumb fetches 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) and FILE_EXISTS. See docs/media.md (#22).
  • tg media clean removes partial downloads untouched for a day; with
    --older-than, --chat or --all it 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-document for an image too). The sent message is cached with its
    attachment (#22).
  • tg status --sizes shows 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_type and has_media as live
    updates: voice, video, sticker, audio and dice instead of
    document or media, and has_media 0 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).