@overpod/mcp-telegram 1.24.1 → 1.25.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 CHANGED
@@ -5,7 +5,38 @@ 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
- ## [Unreleased]
8
+ ## [1.25.0] - 2026-04-20
9
+
10
+ ### Added
11
+ - **Scheduled messages** — `telegram-get-scheduled`, `telegram-delete-scheduled`
12
+ - **Threads & replies** — `telegram-get-replies` for channel post comments
13
+ - **Message links** — `telegram-get-message-link` returns public t.me URL for a message
14
+ - **Mentions & unread reactions** — `telegram-get-unread-mentions`, `telegram-get-unread-reactions`
15
+ - **Translate** — `telegram-translate-message` (requires Telegram Premium)
16
+ - **Typing indicator** — `telegram-send-typing` with configurable action
17
+ - **Dialog management** — `telegram-archive-chat`, `telegram-pin-chat`, `telegram-mark-dialog-unread`
18
+ - **Drafts** — `telegram-save-draft`, `telegram-get-drafts`, `telegram-clear-drafts`
19
+ - **Saved Messages dialogs** — `telegram-get-saved-dialogs` for the new per-peer Saved Messages folders
20
+ - **Admin log** — `telegram-get-admin-log` for channel/supergroup moderation history
21
+ - **Reactions catalog** — `telegram-set-default-reaction`, `telegram-get-top-reactions`, `telegram-get-recent-reactions`
22
+ - **Chat permissions** — `telegram-set-chat-permissions` for default banned rights
23
+ - **Slow mode** — `telegram-set-slow-mode` for supergroups
24
+ - **Forum topics CRUD** — `telegram-create-topic`, `telegram-edit-topic`, `telegram-delete-topic`
25
+ - **Web page preview** — `telegram-get-web-preview` to inspect link previews before sending
26
+
27
+ ### Fixed
28
+ - `telegram-set-chat-permissions` now merges with the chat's current `defaultBannedRights` — omitted flags keep their current state instead of being silently cleared
29
+ - `telegram-clear-drafts` requires `chatId` (single-chat) or `confirmAllChats: true` to wipe drafts account-wide, preventing accidental loss of all drafts in one call
30
+ - `telegram-get-unread-mentions` and `telegram-get-unread-reactions` are now annotated as `WRITE` — they mark the listed items as read on the server
31
+ - `telegram-translate-message` is now annotated as `WRITE` (consumes Premium translate quota); `toLang` is validated against an ISO-639 / locale pattern and `messageIds` is capped at 1–100 positive integers
32
+ - `telegram-delete-scheduled` caps `messageIds` at 1–100 positive integers
33
+ - `telegram-set-default-reaction` validates `emoji` length (1–8 characters)
34
+ - `telegram-get-web-preview` rejects non-`http(s)` URLs, preventing use as an SSRF proxy
35
+ - `telegram-send-typing` throttles non-`cancel` actions to once per 10 seconds per chat
36
+ - `telegram-get-saved-dialogs` no longer returns a hard-coded `unreadCount: 0`
37
+ - `telegram-create-topic` now reads the new topic ID from `UpdateNewChannelMessage` (authoritative) and fails loudly if neither source is available
38
+ - `telegram-save-draft` drops `replyTo` when the draft text is empty, avoiding `MESSAGE_EMPTY` errors when clearing drafts
39
+ - Removed unused `chatMap` build in `getAdminLog`
9
40
 
10
41
  ## [1.24.1] - 2026-04-20
11
42
 
package/README.md CHANGED
@@ -18,7 +18,7 @@ An MCP (Model Context Protocol) server that connects AI assistants like Claude t
18
18
 
19
19
  ## Features
20
20
 
21
- - **59 tools** -- the most comprehensive Telegram MCP server available
21
+ - **Comprehensive tool coverage** -- the most full-featured Telegram MCP server available
22
22
  - **MTProto protocol** -- direct Telegram API access, not the limited Bot API
23
23
  - **Userbot** -- operates as your personal account, not a bot
24
24
  - **Full-featured** -- messaging, reactions, polls, scheduled messages, stickers, media, contacts, and more
@@ -304,21 +304,23 @@ const telegramMcp = new MCPClient({
304
304
  });
305
305
  ```
306
306
 
307
- ## Tools (59)
307
+ ## Tools
308
308
 
309
309
  All tools are auto-discoverable via MCP — your AI client will see the full list with parameters and descriptions when connected.
310
310
 
311
311
  | Category | Tools |
312
312
  |----------|-------|
313
313
  | **Auth** | `telegram-status`, `telegram-login` |
314
- | **Messaging** | `telegram-send-message`, `telegram-edit-message`, `telegram-delete-message`, `telegram-forward-message`, `telegram-send-scheduled` |
315
- | **Reading** | `telegram-list-chats`, `telegram-read-messages`, `telegram-search-messages`, `telegram-search-global`, `telegram-search-chats`, `telegram-get-unread`, `telegram-mark-as-read` |
316
- | **Forum Topics** | `telegram-list-topics`, `telegram-read-topic-messages` |
314
+ | **Messaging** | `telegram-send-message`, `telegram-edit-message`, `telegram-delete-message`, `telegram-forward-message`, `telegram-send-scheduled`, `telegram-send-typing`, `telegram-translate-message`, `telegram-get-message-link` |
315
+ | **Scheduled** | `telegram-get-scheduled`, `telegram-delete-scheduled` |
316
+ | **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` |
317
+ | **Drafts** | `telegram-save-draft`, `telegram-get-drafts`, `telegram-clear-drafts` |
318
+ | **Forum Topics** | `telegram-list-topics`, `telegram-read-topic-messages`, `telegram-create-topic`, `telegram-edit-topic`, `telegram-delete-topic` |
317
319
  | **Polls** | `telegram-create-poll` |
318
- | **Reactions** | `telegram-send-reaction`, `telegram-get-reactions` |
320
+ | **Reactions** | `telegram-send-reaction`, `telegram-get-reactions`, `telegram-set-default-reaction`, `telegram-get-top-reactions`, `telegram-get-recent-reactions` |
319
321
  | **Stickers** | `telegram-send-sticker`, `telegram-get-installed-stickers`, `telegram-get-recent-stickers`, `telegram-get-sticker-set`, `telegram-search-sticker-sets` |
320
- | **Media** | `telegram-send-file`, `telegram-download-media`, `telegram-get-profile-photo` |
321
- | **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` |
322
+ | **Media** | `telegram-send-file`, `telegram-download-media`, `telegram-get-profile-photo`, `telegram-get-web-preview` |
323
+ | **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` |
322
324
  | **Chat Info** | `telegram-get-chat-info`, `telegram-get-chat-members`, `telegram-get-chat-folders` |
323
325
  | **Invite Links** | `telegram-create-invite-link`, `telegram-get-invite-links`, `telegram-revoke-invite-link` |
324
326
  | **Contacts** | `telegram-get-contacts`, `telegram-add-contact`, `telegram-get-contact-requests` |
@@ -326,7 +328,7 @@ All tools are auto-discoverable via MCP — your AI client will see the full lis
326
328
  | **Profiles** | `telegram-get-profile`, `telegram-update-profile` |
327
329
  | **Account** | `telegram-get-sessions`, `telegram-terminate-session`, `telegram-set-privacy`, `telegram-set-auto-delete` |
328
330
  | **Pinning** | `telegram-pin-message`, `telegram-unpin-message` |
329
- | **Chat Settings** | `telegram-mute-chat` |
331
+ | **Chat Settings** | `telegram-mute-chat`, `telegram-archive-chat`, `telegram-pin-chat`, `telegram-mark-dialog-unread` |
330
332
 
331
333
  > **Tip**: Ask your AI assistant *"What Telegram tools are available?"* to get the full list with parameters and descriptions.
332
334
 
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,41 @@
1
+ import assert from "node:assert";
2
+ import { describe, it } from "node:test";
3
+ import { Api } from "telegram/tl/index.js";
4
+ import { describeAdminLogAction, describeAdminLogDetails } from "../telegram-client.js";
5
+ describe("describeAdminLogAction", () => {
6
+ it("converts ChangeTitle to snake_case", () => {
7
+ const action = new Api.ChannelAdminLogEventActionChangeTitle({ prevValue: "a", newValue: "b" });
8
+ assert.strictEqual(describeAdminLogAction(action), "change_title");
9
+ });
10
+ it("converts ParticipantJoin to snake_case", () => {
11
+ const action = new Api.ChannelAdminLogEventActionParticipantJoin();
12
+ assert.strictEqual(describeAdminLogAction(action), "participant_join");
13
+ });
14
+ it("handles ToggleSlowMode", () => {
15
+ const action = new Api.ChannelAdminLogEventActionToggleSlowMode({ prevValue: 0, newValue: 30 });
16
+ assert.strictEqual(describeAdminLogAction(action), "toggle_slow_mode");
17
+ });
18
+ it("handles ChangeHistoryTTL without splitting acronym", () => {
19
+ const action = new Api.ChannelAdminLogEventActionChangeHistoryTTL({ prevValue: 0, newValue: 86400 });
20
+ assert.strictEqual(describeAdminLogAction(action), "change_history_ttl");
21
+ });
22
+ });
23
+ describe("describeAdminLogDetails", () => {
24
+ const describeUser = (id) => `user_${id.toString()}`;
25
+ it("formats title change", () => {
26
+ const action = new Api.ChannelAdminLogEventActionChangeTitle({ prevValue: "old", newValue: "new" });
27
+ assert.strictEqual(describeAdminLogDetails(action, describeUser), '"old" → "new"');
28
+ });
29
+ it("formats username change", () => {
30
+ const action = new Api.ChannelAdminLogEventActionChangeUsername({ prevValue: "old", newValue: "new" });
31
+ assert.strictEqual(describeAdminLogDetails(action, describeUser), "@old → @new");
32
+ });
33
+ it("formats slow mode change", () => {
34
+ const action = new Api.ChannelAdminLogEventActionToggleSlowMode({ prevValue: 0, newValue: 30 });
35
+ assert.strictEqual(describeAdminLogDetails(action, describeUser), "0s → 30s");
36
+ });
37
+ it("returns empty string for unknown actions", () => {
38
+ const action = new Api.ChannelAdminLogEventActionParticipantJoin();
39
+ assert.strictEqual(describeAdminLogDetails(action, describeUser), "");
40
+ });
41
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import assert from "node:assert";
2
+ import { describe, it } from "node:test";
3
+ import bigInt from "big-integer";
4
+ import { Api } from "telegram/tl/index.js";
5
+ import { reactionToEmoji } from "../telegram-client.js";
6
+ describe("reactionToEmoji", () => {
7
+ it("returns emoticon for ReactionEmoji", () => {
8
+ const r = new Api.ReactionEmoji({ emoticon: "👍" });
9
+ assert.strictEqual(reactionToEmoji(r), "👍");
10
+ });
11
+ it("returns custom:<id> for ReactionCustomEmoji", () => {
12
+ const r = new Api.ReactionCustomEmoji({ documentId: bigInt(12345) });
13
+ assert.strictEqual(reactionToEmoji(r), "custom:12345");
14
+ });
15
+ it("returns star for ReactionPaid", () => {
16
+ const r = new Api.ReactionPaid();
17
+ assert.strictEqual(reactionToEmoji(r), "⭐");
18
+ });
19
+ it("returns null for ReactionEmpty", () => {
20
+ const r = new Api.ReactionEmpty();
21
+ assert.strictEqual(reactionToEmoji(r), null);
22
+ });
23
+ });
@@ -0,0 +1,107 @@
1
+ import assert from "node:assert";
2
+ import { describe, it } from "node:test";
3
+ import bigInt from "big-integer";
4
+ import { Api } from "telegram/tl/index.js";
5
+ import { mergeBannedRights, TelegramService } from "../telegram-client.js";
6
+ describe("mergeBannedRights", () => {
7
+ it("preserves omitted flags from current rights", () => {
8
+ const current = { pinMessages: true, inviteUsers: true, sendMessages: false };
9
+ const merged = mergeBannedRights(current, { sendMessages: false });
10
+ assert.strictEqual(merged.sendMessages, true, "user-specified denial applies");
11
+ assert.strictEqual(merged.pinMessages, true, "omitted flag stays banned");
12
+ assert.strictEqual(merged.inviteUsers, true, "omitted flag stays banned");
13
+ assert.strictEqual(merged.sendMedia, false, "omitted flag with no current stays unbanned");
14
+ });
15
+ it("user-provided value overrides current", () => {
16
+ const current = { pinMessages: true };
17
+ const merged = mergeBannedRights(current, { pinMessages: true });
18
+ assert.strictEqual(merged.pinMessages, false, "pinMessages:true allowed -> not banned");
19
+ });
20
+ it("fills missing flags with false when current is undefined", () => {
21
+ const merged = mergeBannedRights(undefined, { sendMessages: true });
22
+ assert.strictEqual(merged.sendMessages, false);
23
+ assert.strictEqual(merged.sendMedia, false);
24
+ assert.strictEqual(merged.pinMessages, false);
25
+ });
26
+ it("covers all nineteen flags (10 exposed + 9 extra preserved)", () => {
27
+ const merged = mergeBannedRights(undefined, {});
28
+ const keys = Object.keys(merged).sort();
29
+ assert.deepStrictEqual(keys, [
30
+ "changeInfo",
31
+ "embedLinks",
32
+ "inviteUsers",
33
+ "manageTopics",
34
+ "pinMessages",
35
+ "sendAudios",
36
+ "sendDocs",
37
+ "sendGames",
38
+ "sendGifs",
39
+ "sendInline",
40
+ "sendMedia",
41
+ "sendMessages",
42
+ "sendPhotos",
43
+ "sendPlain",
44
+ "sendPolls",
45
+ "sendRoundvideos",
46
+ "sendStickers",
47
+ "sendVideos",
48
+ "sendVoices",
49
+ ]);
50
+ });
51
+ });
52
+ describe("TelegramService.setChatPermissions", () => {
53
+ it("merges new permissions with existing defaultBannedRights", async () => {
54
+ const existingRights = new Api.ChatBannedRights({
55
+ untilDate: 0,
56
+ pinMessages: true,
57
+ inviteUsers: true,
58
+ });
59
+ const channel = new Api.Channel({
60
+ id: bigInt(12345),
61
+ title: "test",
62
+ photo: new Api.ChatPhotoEmpty(),
63
+ date: 0,
64
+ accessHash: bigInt(1),
65
+ defaultBannedRights: existingRights,
66
+ });
67
+ const inputChannel = new Api.InputPeerChannel({ channelId: bigInt(12345), accessHash: bigInt(1) });
68
+ const invocations = [];
69
+ const fakeClient = {
70
+ invoke: async (req) => {
71
+ invocations.push(req);
72
+ if (req instanceof Api.channels.GetFullChannel) {
73
+ return new Api.messages.ChatFull({
74
+ fullChat: new Api.ChannelFull({
75
+ id: bigInt(12345),
76
+ about: "",
77
+ readInboxMaxId: 0,
78
+ readOutboxMaxId: 0,
79
+ unreadCount: 0,
80
+ chatPhoto: new Api.PhotoEmpty({ id: bigInt(0) }),
81
+ notifySettings: new Api.PeerNotifySettings({}),
82
+ pts: 0,
83
+ botInfo: [],
84
+ }),
85
+ chats: [channel],
86
+ users: [],
87
+ });
88
+ }
89
+ return undefined;
90
+ },
91
+ getInputEntity: async () => inputChannel,
92
+ };
93
+ const service = new TelegramService(1, "hash");
94
+ const internals = service;
95
+ internals.client = fakeClient;
96
+ internals.connected = true;
97
+ internals.resolveChat = async () => channel;
98
+ await service.setChatPermissions("12345", { sendMessages: false });
99
+ const editCall = invocations.find((r) => r instanceof Api.messages.EditChatDefaultBannedRights);
100
+ assert.ok(editCall, "EditChatDefaultBannedRights was invoked");
101
+ const rights = editCall.bannedRights;
102
+ assert.strictEqual(rights.sendMessages, true, "sendMessages becomes banned");
103
+ assert.strictEqual(rights.pinMessages, true, "pinMessages stays banned (preserved)");
104
+ assert.strictEqual(rights.inviteUsers, true, "inviteUsers stays banned (preserved)");
105
+ assert.strictEqual(rights.sendMedia, false, "omitted flag with no prior value stays unbanned");
106
+ });
107
+ });
@@ -1,5 +1,22 @@
1
+ import bigInt from "big-integer";
1
2
  import { TelegramClient } from "telegram";
2
3
  import { Api } from "telegram/tl/index.js";
4
+ export declare function describeAdminLogAction(action: Api.TypeChannelAdminLogEventAction): string;
5
+ export declare function describeAdminLogDetails(action: Api.TypeChannelAdminLogEventAction, describeUser: (userId: bigInt.BigInteger) => string): string;
6
+ export declare function reactionToEmoji(reaction: Api.TypeReaction): string | null;
7
+ export type ChatPermissions = {
8
+ sendMessages?: boolean;
9
+ sendMedia?: boolean;
10
+ sendStickers?: boolean;
11
+ sendGifs?: boolean;
12
+ sendPolls?: boolean;
13
+ sendInline?: boolean;
14
+ embedLinks?: boolean;
15
+ changeInfo?: boolean;
16
+ inviteUsers?: boolean;
17
+ pinMessages?: boolean;
18
+ };
19
+ export declare function mergeBannedRights(current: Record<string, unknown> | undefined | null, permissions: ChatPermissions): Record<string, boolean>;
3
20
  export declare class TelegramService {
4
21
  private client;
5
22
  private apiId;
@@ -8,6 +25,7 @@ export declare class TelegramService {
8
25
  private connected;
9
26
  private sessionPath;
10
27
  private rateLimiter;
28
+ private lastTypingAt;
11
29
  lastError: string;
12
30
  get sessionDir(): string;
13
31
  getClient(): TelegramClient | null;
@@ -87,8 +105,6 @@ export declare class TelegramService {
87
105
  blockUser(userId: string): Promise<void>;
88
106
  reportSpam(chatId: string): Promise<void>;
89
107
  markAsRead(chatId: string): Promise<void>;
90
- private static TYPING_ACTIONS;
91
- setTyping(chatId: string, action?: keyof typeof TelegramService.TYPING_ACTIONS): Promise<void>;
92
108
  getMessageById(chatId: string, messageId: number): Promise<{
93
109
  id: number;
94
110
  text: string;
@@ -108,6 +124,68 @@ export declare class TelegramService {
108
124
  forwardMessage(fromChatId: string, toChatId: string, messageIds: number[]): Promise<void>;
109
125
  editMessage(chatId: string, messageId: number, newText: string): Promise<void>;
110
126
  deleteMessages(chatId: string, messageIds: number[]): Promise<void>;
127
+ getScheduledMessages(chatId: string): Promise<Array<{
128
+ id: number;
129
+ date: string;
130
+ text: string;
131
+ media?: {
132
+ type: string;
133
+ fileName?: string;
134
+ size?: number;
135
+ };
136
+ }>>;
137
+ deleteScheduledMessages(chatId: string, messageIds: number[]): Promise<void>;
138
+ getReplies(chatId: string, messageId: number, limit?: number): Promise<Array<{
139
+ id: number;
140
+ text: string;
141
+ sender: string;
142
+ date: string;
143
+ media?: {
144
+ type: string;
145
+ fileName?: string;
146
+ size?: number;
147
+ };
148
+ reactions?: {
149
+ emoji: string;
150
+ count: number;
151
+ me: boolean;
152
+ }[];
153
+ }>>;
154
+ getMessageLink(chatId: string, messageId: number, thread?: boolean): Promise<string>;
155
+ getUnreadMentions(chatId: string, limit?: number): Promise<Array<{
156
+ id: number;
157
+ text: string;
158
+ sender: string;
159
+ date: string;
160
+ media?: {
161
+ type: string;
162
+ fileName?: string;
163
+ size?: number;
164
+ };
165
+ reactions?: {
166
+ emoji: string;
167
+ count: number;
168
+ me: boolean;
169
+ }[];
170
+ }>>;
171
+ getUnreadReactions(chatId: string, limit?: number): Promise<Array<{
172
+ id: number;
173
+ text: string;
174
+ sender: string;
175
+ date: string;
176
+ media?: {
177
+ type: string;
178
+ fileName?: string;
179
+ size?: number;
180
+ };
181
+ reactions?: {
182
+ emoji: string;
183
+ count: number;
184
+ me: boolean;
185
+ }[];
186
+ }>>;
187
+ translateText(chatId: string, messageIds: number[], toLang: string): Promise<string[]>;
188
+ sendTyping(chatId: string, action?: "typing" | "upload_photo" | "upload_document" | "cancel"): Promise<void>;
111
189
  /**
112
190
  * Resolve a chat by ID, username, or display name.
113
191
  * Falls back to searching user's dialogs if getEntity() fails.
@@ -258,6 +336,13 @@ export declare class TelegramService {
258
336
  }[];
259
337
  total: number;
260
338
  }>;
339
+ setDefaultReaction(emoji: string): Promise<void>;
340
+ getTopReactions(limit: number): Promise<Array<{
341
+ emoji: string;
342
+ }>>;
343
+ getRecentReactions(limit: number): Promise<Array<{
344
+ emoji: string;
345
+ }>>;
261
346
  sendScheduledMessage(chatId: string, text: string, scheduleDate: number, replyTo?: number, parseMode?: "md" | "html"): Promise<void>;
262
347
  createPoll(chatId: string, question: string, answers: string[], options?: {
263
348
  multipleChoice?: boolean;
@@ -327,6 +412,30 @@ export declare class TelegramService {
327
412
  removeAdmin(chatId: string, userId: string): Promise<void>;
328
413
  unblockUser(userId: string): Promise<void>;
329
414
  muteChat(chatId: string, muteUntil: number): Promise<void>;
415
+ archiveChat(chatId: string, archive: boolean): Promise<void>;
416
+ pinDialog(chatId: string, pin: boolean): Promise<void>;
417
+ markDialogUnread(chatId: string, unread: boolean): Promise<void>;
418
+ getAdminLog(chatId: string, limit?: number, q?: string): Promise<Array<{
419
+ id: string;
420
+ date: string;
421
+ userId: string;
422
+ userName: string;
423
+ action: string;
424
+ details: string;
425
+ }>>;
426
+ setChatPermissions(chatId: string, permissions: ChatPermissions): Promise<void>;
427
+ setSlowMode(chatId: string, seconds: number): Promise<void>;
428
+ createForumTopic(chatId: string, title: string, iconColor?: number, iconEmojiId?: string): Promise<{
429
+ id: number;
430
+ title: string;
431
+ }>;
432
+ editForumTopic(chatId: string, topicId: number, options: {
433
+ title?: string;
434
+ iconEmojiId?: string;
435
+ closed?: boolean;
436
+ hidden?: boolean;
437
+ }): Promise<void>;
438
+ deleteForumTopic(chatId: string, topicId: number): Promise<void>;
330
439
  exportInviteLink(chatId: string, options?: {
331
440
  expireDate?: number;
332
441
  usageLimit?: number;
@@ -391,6 +500,26 @@ export declare class TelegramService {
391
500
  count: number;
392
501
  }>>;
393
502
  sendSticker(chatId: string, stickerSetShortName: string, stickerIndex: number, replyTo?: number): Promise<Api.Message | Api.UpdateShortSentMessage | undefined>;
503
+ saveDraft(chatId: string, text: string, replyTo?: number): Promise<void>;
504
+ getAllDrafts(): Promise<Array<{
505
+ chatId: string;
506
+ chatTitle: string;
507
+ text: string;
508
+ date: string;
509
+ }>>;
510
+ clearAllDrafts(): Promise<void>;
511
+ getSavedDialogs(limit: number): Promise<Array<{
512
+ peerId: string;
513
+ peerTitle: string;
514
+ lastMsgId: number;
515
+ }>>;
516
+ getWebPreview(url: string): Promise<{
517
+ type: string;
518
+ url?: string;
519
+ title?: string;
520
+ description?: string;
521
+ siteName?: string;
522
+ } | null>;
394
523
  getRecentStickers(): Promise<Array<{
395
524
  id: string;
396
525
  accessHash: string;