Skip to content

Latest commit

 

History

History
126 lines (84 loc) · 4.87 KB

File metadata and controls

126 lines (84 loc) · 4.87 KB

tlgr search

3 operations. Every one takes the global flags (--json, --plain, -a/--account, --results-only, --select, --dry-run, --yes, --no-input, --flood-wait-max, -v) anywhere on the line.

Command Summary
search global Search messages across every chat
search hashtag Search a hashtag or cashtag, in a chat or across public posts
search post Full-text search across all public channel posts

search global

Search messages across every chat.

Pagination is the (offset_rate, offset_peer, offset_id) triple, carried whole in --cursor; a message id alone would restart the walk at the top. Global search never covers chats you have left or secret chats, so an empty answer is not proof of absence.

tlgr search global [QUERY] [OPTIONS]

paginated (RATE cursor) · returns Page[Message]

Argument Type Required Meaning
QUERY text no What to look for.
Flag Type Default Meaning
--archived flag Search the archive folder.
--community chat Scope to one community (layer 229).
--folder int Scope to a chat folder.
--missed flag With --type call: only missed calls.
--only user group channel
--sent-media flag Search my own recently sent documents instead.
--since datetime Only after this time.
--type text Media filter, as message search.
--until datetime Only before this time.

Pagination is transport-level: --limit/-n, --cursor TOKEN, --all (walked inside the daemon, paced by the account's own rate limiter).

Also invocable as: tlgr search message

$ tlgr search global 'release notes' --json
Catalog coverage (5 full, 0 partial)

Full: messages-core.search-calls-log, messages-core.search-global, messages-core.search-global-media-tabs, messages-core.search-global-scope, messages-core.search-sent-media

--community (layer 229) is refused with NOT_SUPPORTED; every other scope — users / groups / broadcasts / folder — works on layer 227.

search hashtag

Search a hashtag or cashtag, in a chat or across public posts.

Without --chat this is the global public-post search. The recently-searched list is tlgr's own state: this layer has no getRecentHashtags, and the official clients keep it locally too.

tlgr search hashtag [TAG] [OPTIONS]

paginated (RATE cursor) · returns Page[Message]

Argument Type Required Meaning
TAG text no The hashtag or cashtag.
Flag Type Default Meaning
--chat chat Search this chat only.
--forget text Remove a recent hashtag, or all.
--public flag Global public-post search (channels.searchPosts).
--recent flag List recently searched hashtags instead of searching.
--stories flag Search public stories instead.

Pagination is transport-level: --limit/-n, --cursor TOKEN, --all (walked inside the daemon, paced by the account's own rate limiter).

$ tlgr search hashtag telegram --json
Catalog coverage (4 full, 0 partial)

Full: contacts-users.search-hashtag-history, messages-core.search-hashtag-in-chat, messages-core.search-hashtag-public-posts, messages-core.search-recent-hashtags

The two recent-hashtag ids have no MTProto method; they are tlgr's own per-account state, which is what the official clients do too. Story hashtag search is refused here and belongs to the story group.

search post

Full-text search across all public channel posts.

Free while the quota lasts. --quota reports what is left and what the query would cost, without spending anything; paying needs an explicit --pay-stars N, because spending Stars is a human decision.

tlgr search post <QUERY> [OPTIONS]

mutating · destructive (needs --yes off a TTY) · paginated (RATE cursor) · returns Page[Message]

Argument Type Required Meaning
QUERY text yes What to look for.
Flag Type Default Meaning
--pay-stars int Agree to spend N Stars on this search.
--quota flag Report the free searches left and the Star price.

Pagination is transport-level: --limit/-n, --cursor TOKEN, --all (walked inside the daemon, paced by the account's own rate limiter).

$ tlgr search post 'release notes' --json
Catalog coverage (2 full, 0 partial)

Full: contacts-users.search-public-posts, messages-core.search-public-posts-fulltext