@overpod/mcp-telegram 1.28.1 → 1.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +169 -0
- package/README.md +21 -8
- package/dist/telegram-client.d.ts +316 -4
- package/dist/telegram-client.js +1250 -5
- package/dist/telegram-helpers.d.ts +111 -1
- package/dist/telegram-helpers.js +270 -0
- package/dist/tools/account.js +221 -6
- package/dist/tools/business.d.ts +3 -0
- package/dist/tools/business.js +333 -0
- package/dist/tools/fact-check.d.ts +3 -0
- package/dist/tools/fact-check.js +72 -0
- package/dist/tools/folders.d.ts +3 -0
- package/dist/tools/folders.js +239 -0
- package/dist/tools/index.js +10 -0
- package/dist/tools/messages.js +183 -4
- package/dist/tools/reactions.js +62 -0
- package/dist/tools/send-media.d.ts +3 -0
- package/dist/tools/send-media.js +259 -0
- package/dist/tools/shared.d.ts +28 -0
- package/dist/tools/shared.js +59 -0
- package/dist/tools/stories.js +303 -1
- package/dist/tools/transcribe.d.ts +3 -0
- package/dist/tools/transcribe.js +75 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,175 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.33.0] — 2026-04-24
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
**Folder management (6 new tools):**
|
|
13
|
+
- **telegram-create-folder** — Create a new chat folder. Accepts `title` (max 12 chars), optional `emoticon`, type flags (`contacts`, `nonContacts`, `groups`, `broadcasts`, `bots`), filter flags (`excludeMuted`, `excludeRead`, `excludeArchived`), and peer lists (`includePeers`, `excludePeers`, `pinnedPeers` max 5). Auto-assigns the next available folder ID ≥ 2. Returns the new ID
|
|
14
|
+
- **telegram-edit-folder** — Edit an existing folder by `id`. Only pass fields to change — omitted fields preserve current values (fetches current state first via `messages.GetDialogFilters`)
|
|
15
|
+
- **telegram-delete-folder** — Delete a chat folder by ID. Chats remain in All Chats. System folders (0 = All Chats, 1 = Archive) cannot be deleted. Uses `messages.UpdateDialogFilter` without a filter argument
|
|
16
|
+
- **telegram-reorder-folders** — Set the display order of folders by passing an ordered array of folder IDs. Uses `messages.UpdateDialogFiltersOrder`
|
|
17
|
+
- **telegram-get-suggested-folders** — Fetch Telegram's server-side folder suggestions based on your chat list (e.g. "Unread", "Work", "Personal"). Skips `DialogFilterDefault` entries that lack a title
|
|
18
|
+
- **telegram-toggle-folder-tags** — Enable or disable folder tag labels on messages in chat lists. Requires Telegram Premium. Uses `messages.ToggleDialogFilterTags`
|
|
19
|
+
|
|
20
|
+
**Global privacy (2 new tools):**
|
|
21
|
+
- **telegram-get-global-privacy-settings** — Read all five global privacy flags: `archiveAndMuteNewNoncontactPeers`, `keepArchivedUnmuted`, `keepArchivedFolders`, `hideReadMarks`, `newNoncontactPeersRequirePremium`. Returns JSON
|
|
22
|
+
- **telegram-set-global-privacy-settings** — Update any subset of global privacy flags. Fetches current settings first and merges only the fields you pass. `hideReadMarks` and `newNoncontactPeersRequirePremium` require Telegram Premium
|
|
23
|
+
|
|
24
|
+
## [1.32.0] — 2026-04-24
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
**Profile write (8 new tools):**
|
|
29
|
+
- **telegram-set-emoji-status** — Set custom animated emoji status next to your name (Telegram Premium). Pass `documentId` or `collectibleId`; omit both to clear. Supports optional expiry via `untilUnix`
|
|
30
|
+
- **telegram-list-emoji-statuses** — List available emoji statuses: `default`, `recent`, `channel_default`, or `collectible` (Premium). Returns `documentId`, `until`, collectible `title`/`slug`
|
|
31
|
+
- **telegram-clear-recent-emoji-statuses** — Remove all entries from the "recent" emoji status picker section
|
|
32
|
+
- **telegram-set-profile-color** — Set your name or profile background color. `forProfile=false` = chat list name color; `forProfile=true` = profile page background (Premium). Accepts color index 0-6 (free) or 7-20 (Premium) plus optional background pattern emoji
|
|
33
|
+
- **telegram-set-birthday** — Add/update birthday on profile (`day` + `month` required, `year` optional to hide age). Pass `clear=true` to remove
|
|
34
|
+
- **telegram-set-personal-channel** — Feature a channel on your profile as "Personal Channel". Pass `channelId` or `clear=true` to remove
|
|
35
|
+
- **telegram-set-profile-photo** — Upload static (JPEG/PNG) or animated (MP4, square, ≤10s) avatar. Optional `fallback=true` sets it as the privacy fallback shown when your main photo is hidden
|
|
36
|
+
- **telegram-delete-profile-photo** — Delete one or more profile photos by photo ID (stringified long). Fetches your photo history internally to build the required `InputPhoto`; reports which IDs were not found
|
|
37
|
+
|
|
38
|
+
**Business write (9 tools, including migrated read-only tool):**
|
|
39
|
+
- **telegram-get-business-chat-links** — Moved from `account.ts` to new `business.ts` module. Behavior unchanged (read-only list of Business chat links)
|
|
40
|
+
- **telegram-create-business-chat-link** — Create a `t.me/m/...` deep-link pre-filled with a message. Supports `parseMode` (md/html), optional admin `title`. Returns JSON with `link`, `slug`, `message`, `views`
|
|
41
|
+
- **telegram-edit-business-chat-link** — Update an existing Business chat link by slug. Same options as create
|
|
42
|
+
- **telegram-delete-business-chat-link** — Delete a Business chat link by slug
|
|
43
|
+
- **telegram-resolve-business-chat-link** — Resolve a slug to see who it opens a chat with and the pre-filled message. Returns `peerId`, `peerType`, `message`, `entityCount`
|
|
44
|
+
- **telegram-set-business-hours** — Configure weekly work hours (Telegram Business required). Input: `timezone` (IANA string) + `schedule` array of `{day, openFrom, openTo}` in HH:MM. Internally converts to minute-of-week (0–10079). `clear=true` disables
|
|
45
|
+
- **telegram-set-business-location** — Set street address ± geo coordinates for Business profile. `clear=true` removes
|
|
46
|
+
- **telegram-set-business-greeting** — Auto-reply for new conversations using a Quick Reply shortcut as template. `audience` enum (all_new / contacts_only / non_contacts / existing_only), `noActivityDays`, optional include/excludeUsers. `clear=true` disables
|
|
47
|
+
- **telegram-set-business-away** — Auto-reply when offline or outside hours. `schedule` enum (always / outside_hours / custom). `custom` requires `customFrom`/`customTo` Unix timestamps. `offlineOnly` flag. Same audience model as greeting. `clear=true` disables
|
|
48
|
+
- **telegram-set-business-intro** — Intro card shown to new users: `title` (≤32) + `description` (≤70) + optional sticker (requires `stickerId` + `stickerAccessHash` + `stickerFileReference` all together). `clear=true` removes
|
|
49
|
+
|
|
50
|
+
### Notes
|
|
51
|
+
- All Premium-gated tools (`telegram-set-emoji-status`, `telegram-set-profile-color` with index ≥ 7 or `backgroundEmojiId`) throw `PREMIUM_ACCOUNT_REQUIRED` from Telegram on non-Premium accounts — the error is propagated as-is
|
|
52
|
+
- All Business-gated tools throw `BUSINESS_PEER_INVALID` or similar when the account lacks Telegram Business subscription
|
|
53
|
+
- `telegram-get-business-chat-links` moved to `src/tools/business.ts` — tool name and behavior unchanged
|
|
54
|
+
- `telegram-set-profile-photo`: uploads via GramJS `uploadFile` (4 workers). Video must be square MP4, ≤10s; server enforces its own size limits
|
|
55
|
+
- `telegram-delete-profile-photo`: calls `photos.GetUserPhotos` first (up to 100) to resolve `accessHash` + `fileReference` from the photo ID; IDs not in your history are returned in `missing` array
|
|
56
|
+
|
|
57
|
+
## [1.31.0] — 2026-04-24
|
|
58
|
+
|
|
59
|
+
### Added
|
|
60
|
+
- **telegram-vote-poll** — Vote in a poll by option index (single/multi-choice). Empty array retracts vote.
|
|
61
|
+
- **telegram-get-poll-results** — Get aggregated poll results: vote counts, percentages, quiz answer status
|
|
62
|
+
- **telegram-get-poll-voters** — List users who voted for specific poll options (public polls only, paginated)
|
|
63
|
+
- **telegram-close-poll** — Permanently close a poll (irreversible; prevents further voting)
|
|
64
|
+
- **telegram-transcribe-audio** — Start server-side transcription of a voice/video note (Telegram Premium)
|
|
65
|
+
- **telegram-get-transcription** — Poll for updated transcription status (idempotent re-call)
|
|
66
|
+
- **telegram-rate-transcription** — Rate transcription quality (good/poor) to improve speech-to-text
|
|
67
|
+
- **telegram-get-fact-check** — Get fact-check annotations on channel messages (batch up to 100)
|
|
68
|
+
- **telegram-edit-fact-check** — Add/update fact-check annotation (requires fact-checker privileges)
|
|
69
|
+
- **telegram-delete-fact-check** — Remove fact-check annotation (requires fact-checker privileges)
|
|
70
|
+
- **telegram-send-paid-reaction** — Send paid reaction (★ Stars) on a channel post with optional privacy
|
|
71
|
+
- **telegram-toggle-paid-reaction-privacy** — Change leaderboard visibility of your paid reaction
|
|
72
|
+
- **telegram-get-paid-reaction-privacy** — Get your current default paid reaction privacy setting
|
|
73
|
+
|
|
74
|
+
### Notes
|
|
75
|
+
- `telegram-close-poll`: One-way operation — closed polls cannot be reopened
|
|
76
|
+
- `telegram-transcribe-audio`: Premium feature. Non-Premium accounts have limited free trials; `trialRemainsNum` shows count
|
|
77
|
+
- `telegram-get-transcription`: Idempotent — returns same transcriptionId with updated text once processing completes
|
|
78
|
+
- `telegram-edit-fact-check` / `telegram-delete-fact-check`: Require fact-checker privileges; regular users get permission errors
|
|
79
|
+
- `telegram-send-paid-reaction`: Stars are debited from your Telegram balance; `count` range 1-2500
|
|
80
|
+
- `telegram-toggle-paid-reaction-privacy`: Per-message toggle (Layer 198 API)
|
|
81
|
+
|
|
82
|
+
### New helpers (exported from `telegram-client`)
|
|
83
|
+
- `summarizePoll(poll, results?)` — summarize a GramJS Poll+PollResults into a compact typed object
|
|
84
|
+
- `extractPollMediaFromUpdates(updates)` — extract poll + results from any Updates envelope
|
|
85
|
+
- `extractPeerId(peer)` — convert TypePeer to string ID
|
|
86
|
+
|
|
87
|
+
### Testing
|
|
88
|
+
- 29 new mock-only tests (cumulative: 447 total)
|
|
89
|
+
|
|
90
|
+
## [1.30.0] — 2026-04-24
|
|
91
|
+
|
|
92
|
+
### Added
|
|
93
|
+
- **telegram-send-story** — Publish a photo or video story to your profile or a channel with privacy controls (everyone/contacts/close_friends/selected), period (6-48h), pinning, and no-forward flag. Accepts absolute file path, auto-detects photo/video from extension (jpg/jpeg/png/webp/heic/heif → photo; everything else → video). Caption supports md/html parse mode.
|
|
94
|
+
- **telegram-edit-story** — Edit an existing story: replace media, update caption (empty string clears it), or change privacy rules. At least one field (filePath, caption, or privacy) must be provided.
|
|
95
|
+
- **telegram-delete-stories** — Delete one or more stories (irreversible; requires `confirm: true`; up to 100 IDs per call). Returns the actually-deleted IDs from Telegram (partial success possible).
|
|
96
|
+
- **telegram-react-to-story** — React to a story with an emoji, or remove the reaction by passing empty string `""`.
|
|
97
|
+
- **telegram-export-story-link** — Get a shareable `t.me/…` URL for a public story.
|
|
98
|
+
- **telegram-read-stories** — Mark stories as seen up to a given story ID (maxId, inclusive). Returns count of newly-seen stories.
|
|
99
|
+
- **telegram-toggle-story-pinned** — Pin/unpin stories in profile highlights (Telegram allows up to 3 pinned stories). Returns affected story IDs.
|
|
100
|
+
- **telegram-toggle-story-pinned-to-top** — Pin stories to the very top of the pinned row; pass `[]` to clear all top-pinned stories.
|
|
101
|
+
- **telegram-activate-stealth-mode** — Hide your story views retroactively (`past: true`) and/or for the next 25 minutes (`future: true`). At least one of past/future must be true. Requires Telegram Premium — non-Premium accounts receive PREMIUM_ACCOUNT_REQUIRED.
|
|
102
|
+
- **telegram-get-stories-archive** — Fetch auto-archived (expired) stories from a peer's archive, paginated via `offsetId` + `limit` (1–100, default 50).
|
|
103
|
+
- **telegram-report-story** — Report a story via Telegram's multi-step option flow. First call with `option: ""` starts the flow; subsequent calls pass the base64 option bytes from the previous response's `options[n].option` field.
|
|
104
|
+
- **telegram-get-discussion-message** — For a channel post with comments enabled, returns the linked discussion-group info: `discussionGroupId`, `discussionMsgId`, `unreadCount`, `readInboxMaxId`, `readOutboxMaxId`, `topMessage`. Use `discussionGroupId` + `discussionMsgId` with `telegram-send-message` (replyTo=discussionMsgId) to post a comment.
|
|
105
|
+
- **telegram-get-groups-for-discussion** — List groups eligible to link as discussion group to a channel you admin (channels.GetGroupsForDiscussion). No parameters required.
|
|
106
|
+
- **telegram-get-message-read-participants** — List who has read a message in a small group (≤100 members, ≤7 days old). Returns `readers` array with `userId` and `readAt` (ISO timestamp). Returns CHAT_TOO_BIG error for large groups or channels.
|
|
107
|
+
- **telegram-get-outbox-read-date** — Get when your recipient read your outgoing private message. Returns `"Read at <ISO date>"` or `"Not read yet"` (maps NOT_READ_YET error to null). Propagates YOUR_PRIVACY_RESTRICTED / USER_PRIVACY_RESTRICTED as errors.
|
|
108
|
+
|
|
109
|
+
### New helpers in `telegram-helpers.ts`
|
|
110
|
+
- `StoryPrivacy` type and `buildStoryPrivacyRules()` — builds GramJS `TypeInputPrivacyRule[]` from privacy enum + allow/disallow user ID lists
|
|
111
|
+
- `detectMediaType()` — infers photo/video from file extension (safe default: video)
|
|
112
|
+
- `extractStoryIdFromUpdates()` — extracts story ID from SendStory Updates envelope (prefers UpdateStoryID, falls back to UpdateStory)
|
|
113
|
+
- `summarizeDiscussionMessage()`, `DiscussionMessageSummary` type
|
|
114
|
+
- `summarizeGroupsForDiscussion()`, `GroupsForDiscussionSummary` type
|
|
115
|
+
- `summarizeReadParticipants()`, `ReadParticipantsSummary` type
|
|
116
|
+
- `summarizeReportResult()`, `ReportResultSummary` type (discriminated union: reported / chooseOption / addComment)
|
|
117
|
+
|
|
118
|
+
### Notes
|
|
119
|
+
- `telegram-activate-stealth-mode` requires Telegram Premium — non-Premium accounts receive PREMIUM_ACCOUNT_REQUIRED
|
|
120
|
+
- `telegram-get-message-read-participants` only works for groups ≤100 members and messages ≤7 days old
|
|
121
|
+
- `telegram-delete-stories` requires `confirm: true` (irreversible)
|
|
122
|
+
- `telegram-send-story`: MediaAreas (venue/reaction/URL tags on the story frame) are not supported in this version
|
|
123
|
+
- `telegram-report-story`: Multi-step flow — first call with `option: ""` starts the flow; subsequent calls pass the base64 option bytes from the previous response
|
|
124
|
+
|
|
125
|
+
### Testing
|
|
126
|
+
- 45 new mock-only tests in `src/__tests__/stories-v2.test.ts` (cumulative: 418 total)
|
|
127
|
+
|
|
128
|
+
## [1.29.0] - 2026-04-23
|
|
129
|
+
|
|
130
|
+
### Added
|
|
131
|
+
- **Phase 5 Block A — Rich media sending (7 new tools)** — functional parity with Telegram UI for content types that could not be sent before.
|
|
132
|
+
- `telegram-send-voice` — send a voice note (OGG/Opus preferred) with optional caption, parseMode, reply/topic. Shows as a waveform UI in the chat.
|
|
133
|
+
- `telegram-send-video-note` — send a round-shaped video message (MP4, square recommended; duration ≤60s enforced client-side, length ≤640px).
|
|
134
|
+
- `telegram-send-location` — send a geographic location; single tool handles both static pins and live-updating locations (`livePeriod` 60–86400 seconds; optional `heading` 1–360°, `proximityRadius` meters).
|
|
135
|
+
- `telegram-send-venue` — send a venue card (title, address, lat/long + optional provider-specific metadata).
|
|
136
|
+
- `telegram-send-contact` — send a contact card (phone number in E.164-like format `^\+?\d{6,15}$`, first name, optional last name and vCard).
|
|
137
|
+
- `telegram-send-dice` — send an animated dice/game emoji (🎲 🎯 🎰 🏀 ⚽ 🎳) and receive the server-rolled value in the response.
|
|
138
|
+
- `telegram-send-album` — send 2–10 grouped photos/videos as a single album message with per-item or album-level caption.
|
|
139
|
+
- **Block B — enhancements to existing `telegram-send-message`:**
|
|
140
|
+
- `quoteText` — attach a verbatim quote from the replied-to message (requires `replyTo`). Uses raw `messages.SendMessage` + `InputReplyToMessage.quoteText` under the hood.
|
|
141
|
+
- `effect` — Premium message effect ID (numeric string) attached to the outgoing message.
|
|
142
|
+
- **Defence-in-depth for file-path inputs (`isSafeAbsolutePath`)** — all new `filePath` parameters reject:
|
|
143
|
+
- URL schemes (`http:`, `https:`, `file:`, `ftp:`, `data:`, `javascript:`, `ws:`, `wss:`) — no SSRF via GramJS URL-fetching.
|
|
144
|
+
- UNC / SMB shares (`\\server\share`, `//server/share`) — no NTLM-relay from Windows hosts.
|
|
145
|
+
- Path traversal (`..` segments inside an absolute path) — no escape out of the intended directory.
|
|
146
|
+
- POSIX pseudo-filesystems (`/proc`, `/sys`, `/dev`, `/run`) — prevents AI prompt-injection from reading `/proc/self/environ` and leaking env vars / session paths to Telegram.
|
|
147
|
+
- Embedded NUL byte and bare `/` — rejected explicitly.
|
|
148
|
+
- **UTF-16 surrogate sanitation on input** — all free-text parameters (message `text`, captions, venue title/address/provider/venueId/venueType, contact name/vCard, quoteText) now strip unpaired surrogates before reaching GramJS's TL encoder. Complements the existing v1.11.1 output-side fix.
|
|
149
|
+
- **Shared helpers in `telegram-helpers.ts`:**
|
|
150
|
+
- `buildReplyTo(replyTo?, topicId?)` — construct `InputReplyToMessage` (supports topic root where `replyToMsgId === topicId`).
|
|
151
|
+
- `generateRandomBigInt()` — cryptographically-random 64-bit `long` for TL `randomId`.
|
|
152
|
+
- `extractMessageId(result)` — unified parser across `Api.Updates`, `UpdatesCombined`, `Api.Message`, `UpdateShortSentMessage`, `UpdateNewMessage`, `UpdateNewChannelMessage`.
|
|
153
|
+
- `extractDiceResult(result)` — dice-specific extractor returning `{id, value?}` from `MessageMediaDice`.
|
|
154
|
+
|
|
155
|
+
### Changed
|
|
156
|
+
- `telegram-send-contact`: `phone` field now validated against `^\+?\d{6,15}$` (E.164-like) to reject malformed/hallucinated numbers.
|
|
157
|
+
- `telegram-send-venue`: `provider` relaxed from a 2-value enum to a free string (≤32 chars) to match TL `venueProvider: string`.
|
|
158
|
+
- `TelegramService.sendMessage()`: gained an optional 6th `extra: { quoteText?, effect? }` parameter. When set, falls back to raw `messages.SendMessage` (high-level `client.sendMessage` does not support these fields). Backward-compatible — existing callers see no change.
|
|
159
|
+
|
|
160
|
+
### Security
|
|
161
|
+
- `quoteText` without `replyTo` now raises a clear error instead of silently dropping the quote.
|
|
162
|
+
- GramJS private `_parseMessageText` usage in the quoteText/effect raw path is feature-detected; future GramJS bumps surface a clear "version incompatible" error instead of crashing.
|
|
163
|
+
- `effect` ID regex tightened to `^\d{1,19}$` (Int64-safe range).
|
|
164
|
+
|
|
165
|
+
### Testing
|
|
166
|
+
- 371 unit tests (was 322 in v1.28.1, +49). All tests mock-only (no live Telegram connection).
|
|
167
|
+
- New coverage: all 8 new/changed service methods, helper edge cases (channel path, combined updates, direct Api.Message, UpdateShortSentMessage), SSRF guard (POSIX/Windows accept + URL/UNC/traversal/pseudo-fs reject), raw-path `sendMessage` with `quoteText` / `effect`.
|
|
168
|
+
|
|
169
|
+
### Notes & known limitations
|
|
170
|
+
- **`telegram-send-video-note` caption omitted** — Telegram UI does not render captions under round video notes; including it here would silently drop.
|
|
171
|
+
- **`telegram-send-contact.userId` field dropped** — GramJS 2.26.22 `InputMediaContact` TL schema (Layer 198) has no `userId` slot. The card is standalone; recipients see the number and name, not a link to a Telegram user. Will return once GramJS advances.
|
|
172
|
+
- **TTL / self-destruct media** — deferred. Requires raw `InputMediaUploadedPhoto({ttlSeconds})` path which bypasses the high-level `sendFile`; will ship in a follow-up.
|
|
173
|
+
- **`telegram-send-voice.duration` removed vs. initial design** — GramJS auto-detects duration from the audio file; letting the AI override it caused the Telegram UI to display wrong playback times.
|
|
174
|
+
- **Album mixed photo+video** — GramJS accepts mixed arrays via extension-based detection, but this is not covered by tests; recommend uniform media type per album until a live-test checkpoint confirms.
|
|
175
|
+
- **Album flood control** — a 10-item album fans out 10 `messages.UploadMedia` calls inside one rate-limit slot; under heavy contention the later items may still hit `FLOOD_WAIT`. Rate limiter retries apply.
|
|
176
|
+
|
|
8
177
|
## [1.26.0] - 2026-04-20
|
|
9
178
|
|
|
10
179
|
### Added
|
package/README.md
CHANGED
|
@@ -24,14 +24,16 @@ An MCP (Model Context Protocol) server that connects AI assistants like Claude t
|
|
|
24
24
|
- **Full-featured** -- messaging, reactions, polls, scheduled messages, stickers, media, contacts, and more
|
|
25
25
|
- **Forum Topics** -- list topics, read per-topic messages, send to specific topics, per-topic unread counts
|
|
26
26
|
- **Stickers** -- search sticker sets, browse installed/recent stickers, send stickers to any chat
|
|
27
|
-
- **Account management** -- update profile, manage privacy settings, sessions, auto-delete timers
|
|
27
|
+
- **Account & profile management** -- update profile, set emoji status, birthday, personal channel, profile photo, manage privacy settings, sessions, auto-delete timers
|
|
28
28
|
- **Global search** -- search messages across all chats at once
|
|
29
29
|
- **Real-time polling** -- fetch updates via stateless cursors; agent owns `{pts, qts, date}` state
|
|
30
30
|
- **Inline bots & buttons** -- query inline bots, send results, press callback buttons
|
|
31
|
-
- **Stories** -- read stories from peers, get story view stats
|
|
31
|
+
- **Stories** -- read stories from peers, get story view stats; publish/edit/delete stories, react, pin, stealth mode, archive, report (v1.30.0)
|
|
32
|
+
- **Discussion** -- get discussion-group info for channel posts with comments, list groups eligible for discussion (v1.30.0)
|
|
33
|
+
- **Read Receipts** -- who read a message in a small group, when your private message was read (v1.30.0)
|
|
32
34
|
- **Admin controls** -- toggle channel signatures, anti-spam, forum mode, prehistory; approve join requests
|
|
33
35
|
- **Stats** -- channel and supergroup analytics (GetBroadcastStats / GetMegagroupStats)
|
|
34
|
-
- **Boosts & Business** -- boost status, boosters list, Telegram Business chat links
|
|
36
|
+
- **Boosts & Business** -- boost status, boosters list, Telegram Business chat links CRUD, work hours, location, greeting/away/intro messages
|
|
35
37
|
- **QR code login** -- authenticate by scanning a QR code in the Telegram app
|
|
36
38
|
- **Session persistence** -- login once, stay connected across restarts
|
|
37
39
|
- **Human-readable output** -- sender names are resolved, not just numeric IDs
|
|
@@ -317,21 +319,27 @@ All tools are auto-discoverable via MCP — your AI client will see the full lis
|
|
|
317
319
|
| Category | Tools |
|
|
318
320
|
|----------|-------|
|
|
319
321
|
| **Auth** | `telegram-status`, `telegram-login`, `telegram-logout` |
|
|
320
|
-
| **Messaging** | `telegram-send-message
|
|
322
|
+
| **Messaging** | `telegram-send-message` (incl. `quoteText` for verbatim reply quotes and Premium message `effect`), `telegram-edit-message`, `telegram-delete-message`, `telegram-forward-message`, `telegram-send-scheduled`, `telegram-send-typing`, `telegram-translate-message`, `telegram-get-message-link` |
|
|
321
323
|
| **Scheduled** | `telegram-get-scheduled`, `telegram-delete-scheduled` |
|
|
322
324
|
| **Reading** | `telegram-list-chats`, `telegram-read-messages`, `telegram-search-messages`, `telegram-search-global`, `telegram-search-chats`, `telegram-get-unread`, `telegram-mark-as-read`, `telegram-get-replies`, `telegram-get-unread-mentions`, `telegram-get-unread-reactions`, `telegram-get-saved-dialogs` |
|
|
323
325
|
| **Drafts** | `telegram-save-draft`, `telegram-get-drafts`, `telegram-clear-drafts` |
|
|
324
326
|
| **Forum Topics** | `telegram-list-topics`, `telegram-read-topic-messages`, `telegram-create-topic`, `telegram-edit-topic`, `telegram-delete-topic` |
|
|
325
327
|
| **Polls** | `telegram-create-poll` |
|
|
328
|
+
| **Poll Interaction (v1.31.0)** | `telegram-vote-poll`, `telegram-get-poll-results`, `telegram-get-poll-voters`, `telegram-close-poll` |
|
|
326
329
|
| **Reactions** | `telegram-send-reaction`, `telegram-get-reactions`, `telegram-set-default-reaction`, `telegram-get-top-reactions`, `telegram-get-recent-reactions` |
|
|
330
|
+
| **Paid Reactions (v1.31.0)** | `telegram-send-paid-reaction` (★ Stars), `telegram-toggle-paid-reaction-privacy`, `telegram-get-paid-reaction-privacy` |
|
|
331
|
+
| **Audio Transcription (v1.31.0)** | `telegram-transcribe-audio` (Premium), `telegram-get-transcription`, `telegram-rate-transcription` |
|
|
332
|
+
| **Fact-check (v1.31.0)** | `telegram-get-fact-check`, `telegram-edit-fact-check`, `telegram-delete-fact-check` |
|
|
327
333
|
| **Stickers** | `telegram-send-sticker`, `telegram-get-installed-stickers`, `telegram-get-recent-stickers`, `telegram-get-sticker-set`, `telegram-search-sticker-sets` |
|
|
328
334
|
| **Media** | `telegram-send-file`, `telegram-download-media`, `telegram-get-profile-photo`, `telegram-get-web-preview` |
|
|
335
|
+
| **Rich Media Sending** | `telegram-send-voice`, `telegram-send-video-note` (round video), `telegram-send-location` (static or live), `telegram-send-venue`, `telegram-send-contact`, `telegram-send-dice` (🎲🎯🎰🏀⚽🎳), `telegram-send-album` (2–10 grouped photos/videos) |
|
|
329
336
|
| **Groups** | `telegram-create-group`, `telegram-edit-group`, `telegram-invite-to-group`, `telegram-join-chat`, `telegram-leave-group`, `telegram-kick-user`, `telegram-ban-user`, `telegram-unban-user`, `telegram-set-admin`, `telegram-remove-admin`, `telegram-get-my-role`, `telegram-set-chat-permissions`, `telegram-set-slow-mode`, `telegram-get-admin-log` |
|
|
330
337
|
| **Chat Info** | `telegram-get-chat-info`, `telegram-get-chat-members`, `telegram-get-chat-folders` |
|
|
331
338
|
| **Invite Links** | `telegram-create-invite-link`, `telegram-get-invite-links`, `telegram-revoke-invite-link` |
|
|
332
339
|
| **Contacts** | `telegram-get-contacts`, `telegram-add-contact`, `telegram-get-contact-requests` |
|
|
333
340
|
| **Moderation** | `telegram-block-user`, `telegram-unblock-user`, `telegram-report-spam` |
|
|
334
|
-
| **Profiles** | `telegram-get-profile`, `telegram-update-profile` |
|
|
341
|
+
| **Profiles (read)** | `telegram-get-profile`, `telegram-update-profile` |
|
|
342
|
+
| **Profile (write, v1.32.0)** | `telegram-set-emoji-status` (Premium), `telegram-list-emoji-statuses`, `telegram-clear-recent-emoji-statuses`, `telegram-set-profile-color` (Premium), `telegram-set-birthday`, `telegram-set-personal-channel`, `telegram-set-profile-photo`, `telegram-delete-profile-photo` |
|
|
335
343
|
| **Account** | `telegram-get-sessions`, `telegram-terminate-session`, `telegram-set-privacy`, `telegram-set-auto-delete` |
|
|
336
344
|
| **Pinning** | `telegram-pin-message`, `telegram-unpin-message` |
|
|
337
345
|
| **Chat Settings** | `telegram-mute-chat`, `telegram-archive-chat`, `telegram-pin-chat`, `telegram-mark-dialog-unread` |
|
|
@@ -339,8 +347,12 @@ All tools are auto-discoverable via MCP — your AI client will see the full lis
|
|
|
339
347
|
| **Stats** | `telegram-get-broadcast-stats`, `telegram-get-megagroup-stats` |
|
|
340
348
|
| **Inline Bots & Buttons** | `telegram-inline-query`, `telegram-inline-query-send`, `telegram-press-button`, `telegram-get-message-buttons` |
|
|
341
349
|
| **Real-Time Polling** | `telegram-get-state`, `telegram-get-updates`, `telegram-get-channel-updates` |
|
|
342
|
-
| **Stories** | `telegram-get-all-stories`, `telegram-get-peer-stories`, `telegram-get-stories-by-id`, `telegram-get-story-views` |
|
|
343
|
-
| **
|
|
350
|
+
| **Stories (read)** | `telegram-get-all-stories`, `telegram-get-peer-stories`, `telegram-get-stories-by-id`, `telegram-get-story-views` |
|
|
351
|
+
| **Stories (write, v1.30.0)** | `telegram-send-story`, `telegram-edit-story`, `telegram-delete-stories`, `telegram-react-to-story`, `telegram-export-story-link`, `telegram-read-stories`, `telegram-toggle-story-pinned`, `telegram-toggle-story-pinned-to-top`, `telegram-activate-stealth-mode` (Premium), `telegram-get-stories-archive`, `telegram-report-story` |
|
|
352
|
+
| **Discussion (v1.30.0)** | `telegram-get-discussion-message`, `telegram-get-groups-for-discussion` |
|
|
353
|
+
| **Read Receipts (v1.30.0)** | `telegram-get-message-read-participants`, `telegram-get-outbox-read-date` |
|
|
354
|
+
| **Boosts** | `telegram-get-my-boosts`, `telegram-get-boosts-status`, `telegram-get-boosts-list` |
|
|
355
|
+
| **Business (v1.32.0)** | `telegram-get-business-chat-links`, `telegram-create-business-chat-link`, `telegram-edit-business-chat-link`, `telegram-delete-business-chat-link`, `telegram-resolve-business-chat-link`, `telegram-set-business-hours`, `telegram-set-business-location`, `telegram-set-business-greeting`, `telegram-set-business-away`, `telegram-set-business-intro` |
|
|
344
356
|
| **Opt-in (env-gated)** | `telegram-get-group-call`, `telegram-get-group-call-participants` (requires `MCP_TELEGRAM_ENABLE_GROUP_CALLS=1`), `telegram-get-stars-status`, `telegram-get-stars-transactions` (requires `MCP_TELEGRAM_ENABLE_STARS=1`), `telegram-get-quick-replies`, `telegram-get-quick-reply-messages` (requires `MCP_TELEGRAM_ENABLE_QUICK_REPLIES=1`) |
|
|
345
357
|
|
|
346
358
|
> **Tip**: Ask your AI assistant *"What Telegram tools are available?"* to get the full list with parameters and descriptions.
|
|
@@ -385,7 +397,8 @@ src/
|
|
|
385
397
|
reactions.ts -- Reactions, set-chat-reactions
|
|
386
398
|
extras.ts -- Pin, schedule, polls, topics
|
|
387
399
|
stickers.ts -- Sticker sets, send, search, browse
|
|
388
|
-
account.ts -- Sessions, privacy, auto-delete, profile, chat mute/folders, invite links
|
|
400
|
+
account.ts -- Sessions, privacy, auto-delete, profile, emoji status, birthday, chat mute/folders, invite links
|
|
401
|
+
business.ts -- Telegram Business: chat links CRUD, work hours, location, greeting/away/intro
|
|
389
402
|
boosts.ts -- Boost status, my boosts, boosters list
|
|
390
403
|
stories.ts -- Stories: list all, peer, by-id, view stats
|
|
391
404
|
group-calls.ts -- Group call info and participants (opt-in: MCP_TELEGRAM_ENABLE_GROUP_CALLS)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TelegramClient } from "telegram";
|
|
2
2
|
import { Api } from "telegram/tl/index.js";
|
|
3
|
-
import type { AllStoriesSummary, BoostsListSummary, BoostsStatusSummary, BroadcastStatsSummary, BusinessChatLinksSummary, ChannelDifferenceSummary, ChatPermissions, GroupCallParticipantsSummary, GroupCallSummary, MegagroupStatsSummary, MessageButtonDescriptor, MyBoostsSummary, PeerStoriesSummary, QuickRepliesSummary, QuickReplyMessagesSummary, StarsStatusSummary, StoriesByIdSummary, StoryViewsListSummary, UpdatesDifferenceSummary } from "./telegram-helpers.js";
|
|
4
|
-
export type { AllStoriesSummary, BoostSummary, BoostsListSummary, BoostsStatusSummary, BroadcastStatsSummary, BusinessChatLinkSummary, BusinessChatLinksSummary, ChannelDifferenceSummary, ChatPermissions, CompactPeer, CompactStatsGraph, GroupCallInfoSummary, GroupCallParticipantSummary, GroupCallParticipantsSummary, GroupCallSummary, MegagroupStatsSummary, MessageButtonDescriptor, MyBoostSummary, MyBoostsSummary, PeerStoriesSummary, PrepaidGiveawaySummary, QuickRepliesSummary, QuickReplyMessageSummary, QuickReplyMessagesSummary, QuickReplySummary, StarsAmountSummary, StarsStatusSummary, StarsSubscriptionPricingSummary, StarsSubscriptionSummary, StarsTransactionPeerSummary, StarsTransactionSummary, StatsValue, StoriesByIdSummary, StoryItemSummary, StoryViewSummary, StoryViewsListSummary, UpdatesDifferenceSummary, UpdatesMessageSummary, } from "./telegram-helpers.js";
|
|
5
|
-
export { describeAdminLogAction, describeAdminLogDetails, describeKeyboardButton, mergeBannedRights, peerToCompact, reactionToEmoji, summarizeAllStories, summarizeBoost, summarizeBoostsList, summarizeBoostsStatus, summarizeBroadcastStats, summarizeBusinessChatLink, summarizeBusinessChatLinks, summarizeChannelDifference, summarizeGroupCall, summarizeGroupCallInfo, summarizeGroupCallParticipant, summarizeGroupCallParticipants, summarizeMegagroupStats, summarizeMyBoost, summarizeMyBoosts, summarizePeerStories, summarizePrepaidGiveaway, summarizeQuickReplies, summarizeQuickReply, summarizeQuickReplyMessage, summarizeQuickReplyMessages, summarizeStarsAmount, summarizeStarsStatus, summarizeStarsSubscription, summarizeStarsTransaction, summarizeStarsTransactionPeer, summarizeStoriesById, summarizeStoryItem, summarizeStoryView, summarizeStoryViewsList, summarizeUpdatesDifference, } from "./telegram-helpers.js";
|
|
3
|
+
import type { AllStoriesSummary, BoostsListSummary, BoostsStatusSummary, BroadcastStatsSummary, BusinessChatLinksSummary, ChannelDifferenceSummary, ChatPermissions, DiscussionMessageSummary, EmojiStatusSummary, GroupCallParticipantsSummary, GroupCallSummary, GroupsForDiscussionSummary, MegagroupStatsSummary, MessageButtonDescriptor, MyBoostsSummary, PeerStoriesSummary, PollSummary, QuickRepliesSummary, QuickReplyMessagesSummary, ReadParticipantsSummary, ReportResultSummary, ResolvedBusinessChatLinkSummary, StarsStatusSummary, StoriesByIdSummary, StoryPrivacy, StoryViewsListSummary, UpdatesDifferenceSummary } from "./telegram-helpers.js";
|
|
4
|
+
export type { AllStoriesSummary, BoostSummary, BoostsListSummary, BoostsStatusSummary, BroadcastStatsSummary, BusinessChatLinkSummary, BusinessChatLinksSummary, ChannelDifferenceSummary, ChatPermissions, CompactPeer, CompactStatsGraph, DiscussionMessageSummary, EmojiStatusSummary, GroupCallInfoSummary, GroupCallParticipantSummary, GroupCallParticipantsSummary, GroupCallSummary, GroupsForDiscussionSummary, MegagroupStatsSummary, MessageButtonDescriptor, MyBoostSummary, MyBoostsSummary, PeerStoriesSummary, PeerSummary, PollSummary, PrepaidGiveawaySummary, QuickRepliesSummary, QuickReplyMessageSummary, QuickReplyMessagesSummary, QuickReplySummary, ReadParticipantsSummary, ReportResultSummary, ResolvedBusinessChatLinkSummary, StarsAmountSummary, StarsStatusSummary, StarsSubscriptionPricingSummary, StarsSubscriptionSummary, StarsTransactionPeerSummary, StarsTransactionSummary, StatsValue, StoriesByIdSummary, StoryItemSummary, StoryPrivacy, StoryViewSummary, StoryViewsListSummary, UpdatesDifferenceSummary, UpdatesMessageSummary, } from "./telegram-helpers.js";
|
|
5
|
+
export { buildStoryPrivacyRules, describeAdminLogAction, describeAdminLogDetails, describeKeyboardButton, detectMediaType, extractPeerId, extractPollMediaFromUpdates, extractStoryIdFromUpdates, mergeBannedRights, peerToCompact, reactionToEmoji, summarizeAllStories, summarizeBoost, summarizeBoostsList, summarizeBoostsStatus, summarizeBroadcastStats, summarizeBusinessChatLink, summarizeBusinessChatLinks, summarizeChannelDifference, summarizeDiscussionMessage, summarizeEmojiStatus, summarizeGroupCall, summarizeGroupCallInfo, summarizeGroupCallParticipant, summarizeGroupCallParticipants, summarizeGroupsForDiscussion, summarizeMegagroupStats, summarizeMyBoost, summarizeMyBoosts, summarizePeer, summarizePeerStories, summarizePoll, summarizePrepaidGiveaway, summarizeQuickReplies, summarizeQuickReply, summarizeQuickReplyMessage, summarizeQuickReplyMessages, summarizeReadParticipants, summarizeReportResult, summarizeStarsAmount, summarizeStarsStatus, summarizeStarsSubscription, summarizeStarsTransaction, summarizeStarsTransactionPeer, summarizeStoriesById, summarizeStoryItem, summarizeStoryView, summarizeStoryViewsList, summarizeUpdatesDifference, } from "./telegram-helpers.js";
|
|
6
6
|
export type ChatEntity = Api.User | Api.Chat | Api.Channel | Api.TypeUser | Api.TypeChat;
|
|
7
7
|
export declare class TelegramService {
|
|
8
8
|
private client;
|
|
@@ -51,8 +51,72 @@ export declare class TelegramService {
|
|
|
51
51
|
username?: string;
|
|
52
52
|
firstName?: string;
|
|
53
53
|
}>;
|
|
54
|
-
sendMessage(chatId: string, text: string, replyTo?: number, parseMode?: "md" | "html", topicId?: number
|
|
54
|
+
sendMessage(chatId: string, text: string, replyTo?: number, parseMode?: "md" | "html", topicId?: number, extra?: {
|
|
55
|
+
quoteText?: string;
|
|
56
|
+
effect?: string;
|
|
57
|
+
}): Promise<Api.Message | Api.UpdateShortSentMessage | undefined>;
|
|
55
58
|
sendFile(chatId: string, filePath: string, caption?: string): Promise<void>;
|
|
59
|
+
sendVoice(chatId: string, filePath: string, opts?: {
|
|
60
|
+
caption?: string;
|
|
61
|
+
replyTo?: number;
|
|
62
|
+
topicId?: number;
|
|
63
|
+
parseMode?: "md" | "html";
|
|
64
|
+
}): Promise<{
|
|
65
|
+
id: number;
|
|
66
|
+
}>;
|
|
67
|
+
sendVideoNote(chatId: string, filePath: string, opts?: {
|
|
68
|
+
duration?: number;
|
|
69
|
+
length?: number;
|
|
70
|
+
replyTo?: number;
|
|
71
|
+
topicId?: number;
|
|
72
|
+
}): Promise<{
|
|
73
|
+
id: number;
|
|
74
|
+
}>;
|
|
75
|
+
sendContact(chatId: string, phone: string, firstName: string, opts?: {
|
|
76
|
+
lastName?: string;
|
|
77
|
+
vcard?: string;
|
|
78
|
+
replyTo?: number;
|
|
79
|
+
topicId?: number;
|
|
80
|
+
}): Promise<{
|
|
81
|
+
id: number;
|
|
82
|
+
}>;
|
|
83
|
+
sendDice(chatId: string, emoji: string, opts?: {
|
|
84
|
+
replyTo?: number;
|
|
85
|
+
topicId?: number;
|
|
86
|
+
}): Promise<{
|
|
87
|
+
id: number;
|
|
88
|
+
value?: number;
|
|
89
|
+
}>;
|
|
90
|
+
sendLocation(chatId: string, latitude: number, longitude: number, opts?: {
|
|
91
|
+
accuracyRadius?: number;
|
|
92
|
+
livePeriod?: number;
|
|
93
|
+
heading?: number;
|
|
94
|
+
proximityRadius?: number;
|
|
95
|
+
replyTo?: number;
|
|
96
|
+
topicId?: number;
|
|
97
|
+
}): Promise<{
|
|
98
|
+
id: number;
|
|
99
|
+
}>;
|
|
100
|
+
sendVenue(chatId: string, latitude: number, longitude: number, title: string, address: string, opts?: {
|
|
101
|
+
provider?: string;
|
|
102
|
+
venueId?: string;
|
|
103
|
+
venueType?: string;
|
|
104
|
+
replyTo?: number;
|
|
105
|
+
topicId?: number;
|
|
106
|
+
}): Promise<{
|
|
107
|
+
id: number;
|
|
108
|
+
}>;
|
|
109
|
+
sendAlbum(chatId: string, items: Array<{
|
|
110
|
+
filePath: string;
|
|
111
|
+
caption?: string;
|
|
112
|
+
}>, opts?: {
|
|
113
|
+
caption?: string;
|
|
114
|
+
parseMode?: "md" | "html";
|
|
115
|
+
replyTo?: number;
|
|
116
|
+
topicId?: number;
|
|
117
|
+
}): Promise<{
|
|
118
|
+
ids: number[];
|
|
119
|
+
}>;
|
|
56
120
|
downloadMedia(chatId: string, messageId: number, downloadPath: string): Promise<string>;
|
|
57
121
|
downloadMediaAsBuffer(chatId: string, messageId: number): Promise<{
|
|
58
122
|
buffer: Buffer;
|
|
@@ -341,6 +405,58 @@ export declare class TelegramService {
|
|
|
341
405
|
quiz?: boolean;
|
|
342
406
|
correctAnswer?: number;
|
|
343
407
|
}): Promise<number>;
|
|
408
|
+
sendPollVote(chatId: string, messageId: number, optionIndexes: number[]): Promise<{
|
|
409
|
+
totalVoters: number;
|
|
410
|
+
chosenLabels: string[];
|
|
411
|
+
isRetracted: boolean;
|
|
412
|
+
}>;
|
|
413
|
+
getPollResults(chatId: string, messageId: number): Promise<PollSummary>;
|
|
414
|
+
getPollVoters(chatId: string, messageId: number, opts?: {
|
|
415
|
+
optionIndex?: number;
|
|
416
|
+
limit?: number;
|
|
417
|
+
offset?: string;
|
|
418
|
+
}): Promise<{
|
|
419
|
+
total: number;
|
|
420
|
+
nextOffset?: string;
|
|
421
|
+
voters: Array<{
|
|
422
|
+
peerId: string;
|
|
423
|
+
name?: string;
|
|
424
|
+
username?: string;
|
|
425
|
+
options: string[];
|
|
426
|
+
date: number;
|
|
427
|
+
}>;
|
|
428
|
+
}>;
|
|
429
|
+
closePoll(chatId: string, messageId: number): Promise<{
|
|
430
|
+
totalVoters: number;
|
|
431
|
+
}>;
|
|
432
|
+
transcribeAudio(chatId: string, messageId: number): Promise<{
|
|
433
|
+
transcriptionId: string;
|
|
434
|
+
text: string;
|
|
435
|
+
pending: boolean;
|
|
436
|
+
trialRemainsNum?: number;
|
|
437
|
+
trialRemainsUntilDate?: number;
|
|
438
|
+
}>;
|
|
439
|
+
rateTranscription(chatId: string, messageId: number, transcriptionId: string, good: boolean): Promise<void>;
|
|
440
|
+
getFactCheck(chatId: string, messageIds: number[]): Promise<Array<{
|
|
441
|
+
messageId: number;
|
|
442
|
+
needCheck: boolean;
|
|
443
|
+
country?: string;
|
|
444
|
+
text?: string;
|
|
445
|
+
hash: string;
|
|
446
|
+
}>>;
|
|
447
|
+
editFactCheck(chatId: string, messageId: number, text: string, _opts?: {
|
|
448
|
+
parseMode?: "md" | "html";
|
|
449
|
+
}): Promise<void>;
|
|
450
|
+
deleteFactCheck(chatId: string, messageId: number): Promise<void>;
|
|
451
|
+
sendPaidReaction(chatId: string, messageId: number, count: number, opts?: {
|
|
452
|
+
private?: boolean;
|
|
453
|
+
}): Promise<{
|
|
454
|
+
count: number;
|
|
455
|
+
}>;
|
|
456
|
+
togglePaidReactionPrivacy(chatId: string, messageId: number, privateFlag: boolean): Promise<void>;
|
|
457
|
+
getPaidReactionPrivacy(): Promise<{
|
|
458
|
+
private: boolean;
|
|
459
|
+
}>;
|
|
344
460
|
getForumTopics(chatId: string, limit?: number): Promise<Array<{
|
|
345
461
|
id: number;
|
|
346
462
|
title: string;
|
|
@@ -530,6 +646,57 @@ export declare class TelegramService {
|
|
|
530
646
|
includeCount: number;
|
|
531
647
|
}>>;
|
|
532
648
|
setAutoDelete(chatId: string, period: number): Promise<void>;
|
|
649
|
+
createFolder(opts: {
|
|
650
|
+
title: string;
|
|
651
|
+
emoticon?: string;
|
|
652
|
+
contacts?: boolean;
|
|
653
|
+
nonContacts?: boolean;
|
|
654
|
+
groups?: boolean;
|
|
655
|
+
broadcasts?: boolean;
|
|
656
|
+
bots?: boolean;
|
|
657
|
+
excludeMuted?: boolean;
|
|
658
|
+
excludeRead?: boolean;
|
|
659
|
+
excludeArchived?: boolean;
|
|
660
|
+
includePeers?: string[];
|
|
661
|
+
excludePeers?: string[];
|
|
662
|
+
pinnedPeers?: string[];
|
|
663
|
+
}): Promise<number>;
|
|
664
|
+
editFolder(id: number, opts: {
|
|
665
|
+
title?: string;
|
|
666
|
+
emoticon?: string;
|
|
667
|
+
contacts?: boolean;
|
|
668
|
+
nonContacts?: boolean;
|
|
669
|
+
groups?: boolean;
|
|
670
|
+
broadcasts?: boolean;
|
|
671
|
+
bots?: boolean;
|
|
672
|
+
excludeMuted?: boolean;
|
|
673
|
+
excludeRead?: boolean;
|
|
674
|
+
excludeArchived?: boolean;
|
|
675
|
+
includePeers?: string[];
|
|
676
|
+
excludePeers?: string[];
|
|
677
|
+
pinnedPeers?: string[];
|
|
678
|
+
}): Promise<void>;
|
|
679
|
+
deleteFolder(id: number): Promise<void>;
|
|
680
|
+
reorderFolders(ids: number[]): Promise<void>;
|
|
681
|
+
getSuggestedFolders(): Promise<Array<{
|
|
682
|
+
title: string;
|
|
683
|
+
emoticon?: string;
|
|
684
|
+
}>>;
|
|
685
|
+
toggleDialogFilterTags(enabled: boolean): Promise<void>;
|
|
686
|
+
getGlobalPrivacySettings(): Promise<{
|
|
687
|
+
archiveAndMuteNewNoncontactPeers: boolean;
|
|
688
|
+
keepArchivedUnmuted: boolean;
|
|
689
|
+
keepArchivedFolders: boolean;
|
|
690
|
+
hideReadMarks: boolean;
|
|
691
|
+
newNoncontactPeersRequirePremium: boolean;
|
|
692
|
+
}>;
|
|
693
|
+
setGlobalPrivacySettings(opts: {
|
|
694
|
+
archiveAndMuteNewNoncontactPeers?: boolean;
|
|
695
|
+
keepArchivedUnmuted?: boolean;
|
|
696
|
+
keepArchivedFolders?: boolean;
|
|
697
|
+
hideReadMarks?: boolean;
|
|
698
|
+
newNoncontactPeersRequirePremium?: boolean;
|
|
699
|
+
}): Promise<void>;
|
|
533
700
|
getActiveSessions(): Promise<Array<{
|
|
534
701
|
hash: string;
|
|
535
702
|
device: string;
|
|
@@ -621,6 +788,101 @@ export declare class TelegramService {
|
|
|
621
788
|
limit?: number;
|
|
622
789
|
}): Promise<BoostsListSummary>;
|
|
623
790
|
getBusinessChatLinks(): Promise<BusinessChatLinksSummary>;
|
|
791
|
+
setEmojiStatus(opts: {
|
|
792
|
+
documentId?: string;
|
|
793
|
+
collectibleId?: string;
|
|
794
|
+
untilUnix?: number;
|
|
795
|
+
}): Promise<void>;
|
|
796
|
+
listEmojiStatuses(kind: "default" | "recent" | "channel_default" | "collectible", limit: number): Promise<EmojiStatusSummary[]>;
|
|
797
|
+
clearRecentEmojiStatuses(): Promise<void>;
|
|
798
|
+
setProfileColor(opts: {
|
|
799
|
+
forProfile: boolean;
|
|
800
|
+
color?: number;
|
|
801
|
+
backgroundEmojiId?: string;
|
|
802
|
+
}): Promise<void>;
|
|
803
|
+
setBirthday(opts: {
|
|
804
|
+
day?: number;
|
|
805
|
+
month?: number;
|
|
806
|
+
year?: number;
|
|
807
|
+
clear?: boolean;
|
|
808
|
+
}): Promise<void>;
|
|
809
|
+
setPersonalChannel(opts: {
|
|
810
|
+
channelId?: string;
|
|
811
|
+
clear?: boolean;
|
|
812
|
+
}): Promise<string | null>;
|
|
813
|
+
setProfilePhoto(opts: {
|
|
814
|
+
filePath: string;
|
|
815
|
+
isVideo: boolean;
|
|
816
|
+
videoStartTs?: number;
|
|
817
|
+
fallback: boolean;
|
|
818
|
+
}): Promise<{
|
|
819
|
+
id: string;
|
|
820
|
+
}>;
|
|
821
|
+
deleteProfilePhotos(photoIds: string[]): Promise<{
|
|
822
|
+
deleted: string[];
|
|
823
|
+
missing: string[];
|
|
824
|
+
}>;
|
|
825
|
+
private buildBusinessRecipients;
|
|
826
|
+
private resolveInputUsers;
|
|
827
|
+
private parseEntities;
|
|
828
|
+
setBusinessWorkHours(opts: {
|
|
829
|
+
timezone?: string;
|
|
830
|
+
openNow?: boolean;
|
|
831
|
+
schedule?: Array<{
|
|
832
|
+
day: string;
|
|
833
|
+
openFrom: string;
|
|
834
|
+
openTo: string;
|
|
835
|
+
}>;
|
|
836
|
+
clear?: boolean;
|
|
837
|
+
}): Promise<void>;
|
|
838
|
+
setBusinessLocation(opts: {
|
|
839
|
+
address?: string;
|
|
840
|
+
latitude?: number;
|
|
841
|
+
longitude?: number;
|
|
842
|
+
clear?: boolean;
|
|
843
|
+
}): Promise<void>;
|
|
844
|
+
setBusinessGreeting(opts: {
|
|
845
|
+
shortcutId?: number;
|
|
846
|
+
audience: "all_new" | "contacts_only" | "non_contacts" | "existing_only";
|
|
847
|
+
includeUsers?: string[];
|
|
848
|
+
excludeUsers?: string[];
|
|
849
|
+
noActivityDays: number;
|
|
850
|
+
clear?: boolean;
|
|
851
|
+
}): Promise<void>;
|
|
852
|
+
setBusinessAway(opts: {
|
|
853
|
+
shortcutId?: number;
|
|
854
|
+
schedule: "always" | "outside_hours" | "custom";
|
|
855
|
+
customFrom?: number;
|
|
856
|
+
customTo?: number;
|
|
857
|
+
offlineOnly: boolean;
|
|
858
|
+
audience: "all_new" | "contacts_only" | "non_contacts" | "existing_only";
|
|
859
|
+
includeUsers?: string[];
|
|
860
|
+
excludeUsers?: string[];
|
|
861
|
+
clear?: boolean;
|
|
862
|
+
}): Promise<void>;
|
|
863
|
+
setBusinessIntro(opts: {
|
|
864
|
+
title?: string;
|
|
865
|
+
description?: string;
|
|
866
|
+
stickerId?: string;
|
|
867
|
+
stickerAccessHash?: string;
|
|
868
|
+
stickerFileReference?: string;
|
|
869
|
+
clear?: boolean;
|
|
870
|
+
}): Promise<void>;
|
|
871
|
+
createBusinessChatLink(opts: {
|
|
872
|
+
message: string;
|
|
873
|
+
title?: string;
|
|
874
|
+
parseMode?: "md" | "html";
|
|
875
|
+
}): Promise<BusinessChatLinksSummary["links"][0] & {
|
|
876
|
+
slug: string;
|
|
877
|
+
}>;
|
|
878
|
+
editBusinessChatLink(opts: {
|
|
879
|
+
slug: string;
|
|
880
|
+
message: string;
|
|
881
|
+
title?: string;
|
|
882
|
+
parseMode?: "md" | "html";
|
|
883
|
+
}): Promise<BusinessChatLinksSummary["links"][0]>;
|
|
884
|
+
deleteBusinessChatLink(slug: string): Promise<void>;
|
|
885
|
+
resolveBusinessChatLink(slug: string): Promise<ResolvedBusinessChatLinkSummary>;
|
|
624
886
|
getGroupCall(chatId: string, options?: {
|
|
625
887
|
limit?: number;
|
|
626
888
|
}): Promise<GroupCallSummary>;
|
|
@@ -644,5 +906,55 @@ export declare class TelegramService {
|
|
|
644
906
|
ids?: number[];
|
|
645
907
|
hash?: string;
|
|
646
908
|
}): Promise<QuickReplyMessagesSummary>;
|
|
909
|
+
sendStory(chatId: string, filePath: string, opts: {
|
|
910
|
+
type?: "photo" | "video";
|
|
911
|
+
caption?: string;
|
|
912
|
+
parseMode?: "md" | "html";
|
|
913
|
+
privacy: StoryPrivacy;
|
|
914
|
+
allowUserIds?: string[];
|
|
915
|
+
disallowUserIds?: string[];
|
|
916
|
+
period?: number;
|
|
917
|
+
pinned?: boolean;
|
|
918
|
+
noforwards?: boolean;
|
|
919
|
+
}): Promise<{
|
|
920
|
+
id: number | undefined;
|
|
921
|
+
period: number;
|
|
922
|
+
}>;
|
|
923
|
+
editStory(chatId: string, storyId: number, opts: {
|
|
924
|
+
filePath?: string;
|
|
925
|
+
type?: "photo" | "video";
|
|
926
|
+
caption?: string;
|
|
927
|
+
parseMode?: "md" | "html";
|
|
928
|
+
privacy?: StoryPrivacy;
|
|
929
|
+
allowUserIds?: string[];
|
|
930
|
+
disallowUserIds?: string[];
|
|
931
|
+
}): Promise<{
|
|
932
|
+
changed: string[];
|
|
933
|
+
}>;
|
|
934
|
+
deleteStories(chatId: string, ids: number[]): Promise<{
|
|
935
|
+
deleted: number[];
|
|
936
|
+
}>;
|
|
937
|
+
sendStoryReaction(chatId: string, storyId: number, emoji: string, addToRecent?: boolean): Promise<void>;
|
|
938
|
+
exportStoryLink(chatId: string, storyId: number): Promise<{
|
|
939
|
+
link: string;
|
|
940
|
+
}>;
|
|
941
|
+
readStories(chatId: string, maxId: number): Promise<{
|
|
942
|
+
ids: number[];
|
|
943
|
+
}>;
|
|
944
|
+
toggleStoryPinned(chatId: string, ids: number[], pinned: boolean): Promise<{
|
|
945
|
+
affected: number[];
|
|
946
|
+
}>;
|
|
947
|
+
toggleStoryPinnedToTop(chatId: string, ids: number[]): Promise<{
|
|
948
|
+
ok: boolean;
|
|
949
|
+
}>;
|
|
950
|
+
activateStealthMode(past?: boolean, future?: boolean): Promise<void>;
|
|
951
|
+
getStoriesArchive(chatId: string, offsetId: number, limit: number): Promise<StoriesByIdSummary>;
|
|
952
|
+
reportStory(chatId: string, ids: number[], option: string, message: string): Promise<ReportResultSummary>;
|
|
953
|
+
getDiscussionMessage(chatId: string, messageId: number): Promise<DiscussionMessageSummary>;
|
|
954
|
+
getGroupsForDiscussion(): Promise<GroupsForDiscussionSummary>;
|
|
955
|
+
getMessageReadParticipants(chatId: string, messageId: number): Promise<ReadParticipantsSummary>;
|
|
956
|
+
getOutboxReadDate(chatId: string, messageId: number): Promise<{
|
|
957
|
+
readAt: string | null;
|
|
958
|
+
}>;
|
|
647
959
|
private resolveInputGroupCall;
|
|
648
960
|
}
|