@overpod/mcp-telegram 1.26.0 → 1.26.1

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.
Files changed (72) hide show
  1. package/dist/index.js +4 -1
  2. package/dist/rate-limiter.d.ts +1 -1
  3. package/dist/rate-limiter.js +8 -8
  4. package/dist/telegram-client.d.ts +6 -470
  5. package/dist/telegram-client.js +17 -874
  6. package/dist/telegram-helpers.d.ts +470 -0
  7. package/dist/telegram-helpers.js +870 -0
  8. package/dist/tools/account.js +7 -7
  9. package/dist/tools/boosts.js +4 -4
  10. package/dist/tools/chats.js +7 -7
  11. package/dist/tools/contacts.js +3 -3
  12. package/dist/tools/extras.js +3 -3
  13. package/dist/tools/group-calls.js +3 -3
  14. package/dist/tools/messages.js +17 -17
  15. package/dist/tools/quick-replies.js +3 -3
  16. package/dist/tools/reactions.js +2 -2
  17. package/dist/tools/shared.d.ts +3 -3
  18. package/dist/tools/shared.js +8 -7
  19. package/dist/tools/stars.js +3 -3
  20. package/dist/tools/stickers.js +5 -5
  21. package/dist/tools/stories.js +5 -5
  22. package/package.json +1 -1
  23. package/dist/__tests__/admin-log.test.d.ts +0 -1
  24. package/dist/__tests__/admin-log.test.js +0 -41
  25. package/dist/__tests__/approve-join-request.test.d.ts +0 -1
  26. package/dist/__tests__/approve-join-request.test.js +0 -107
  27. package/dist/__tests__/boosts.test.d.ts +0 -1
  28. package/dist/__tests__/boosts.test.js +0 -310
  29. package/dist/__tests__/broadcast-stats.test.d.ts +0 -1
  30. package/dist/__tests__/broadcast-stats.test.js +0 -172
  31. package/dist/__tests__/business-chat-links.test.d.ts +0 -1
  32. package/dist/__tests__/business-chat-links.test.js +0 -102
  33. package/dist/__tests__/get-message-buttons.test.d.ts +0 -1
  34. package/dist/__tests__/get-message-buttons.test.js +0 -122
  35. package/dist/__tests__/group-calls.test.d.ts +0 -1
  36. package/dist/__tests__/group-calls.test.js +0 -503
  37. package/dist/__tests__/inline-query-send.test.d.ts +0 -1
  38. package/dist/__tests__/inline-query-send.test.js +0 -94
  39. package/dist/__tests__/inline-query.test.d.ts +0 -1
  40. package/dist/__tests__/inline-query.test.js +0 -115
  41. package/dist/__tests__/megagroup-stats.test.d.ts +0 -1
  42. package/dist/__tests__/megagroup-stats.test.js +0 -166
  43. package/dist/__tests__/press-button.test.d.ts +0 -1
  44. package/dist/__tests__/press-button.test.js +0 -123
  45. package/dist/__tests__/quick-replies.test.d.ts +0 -1
  46. package/dist/__tests__/quick-replies.test.js +0 -245
  47. package/dist/__tests__/rate-limiter.test.d.ts +0 -1
  48. package/dist/__tests__/rate-limiter.test.js +0 -81
  49. package/dist/__tests__/reactions.test.d.ts +0 -1
  50. package/dist/__tests__/reactions.test.js +0 -23
  51. package/dist/__tests__/set-chat-permissions-merge.test.d.ts +0 -1
  52. package/dist/__tests__/set-chat-permissions-merge.test.js +0 -107
  53. package/dist/__tests__/set-chat-reactions.test.d.ts +0 -1
  54. package/dist/__tests__/set-chat-reactions.test.js +0 -129
  55. package/dist/__tests__/stars-status.test.d.ts +0 -1
  56. package/dist/__tests__/stars-status.test.js +0 -205
  57. package/dist/__tests__/stars-transactions.test.d.ts +0 -1
  58. package/dist/__tests__/stars-transactions.test.js +0 -82
  59. package/dist/__tests__/stories.test.d.ts +0 -1
  60. package/dist/__tests__/stories.test.js +0 -361
  61. package/dist/__tests__/toggle-anti-spam.test.d.ts +0 -1
  62. package/dist/__tests__/toggle-anti-spam.test.js +0 -80
  63. package/dist/__tests__/toggle-channel-signatures.test.d.ts +0 -1
  64. package/dist/__tests__/toggle-channel-signatures.test.js +0 -80
  65. package/dist/__tests__/toggle-forum-mode.test.d.ts +0 -1
  66. package/dist/__tests__/toggle-forum-mode.test.js +0 -80
  67. package/dist/__tests__/toggle-prehistory-hidden.test.d.ts +0 -1
  68. package/dist/__tests__/toggle-prehistory-hidden.test.js +0 -80
  69. package/dist/__tests__/tools/shared.test.d.ts +0 -1
  70. package/dist/__tests__/tools/shared.test.js +0 -110
  71. package/dist/__tests__/updates.test.d.ts +0 -1
  72. package/dist/__tests__/updates.test.js +0 -221
@@ -0,0 +1,470 @@
1
+ import type bigInt from "big-integer";
2
+ import { Api } from "telegram/tl/index.js";
3
+ export declare function describeAdminLogAction(action: Api.TypeChannelAdminLogEventAction): string;
4
+ export declare function describeAdminLogDetails(action: Api.TypeChannelAdminLogEventAction, describeUser: (userId: bigInt.BigInteger) => string): string;
5
+ export declare function reactionToEmoji(reaction: Api.TypeReaction): string | null;
6
+ export type CompactStatsGraph = {
7
+ type: "async";
8
+ token: string;
9
+ } | {
10
+ type: "error";
11
+ error: string;
12
+ } | {
13
+ type: "data";
14
+ data: unknown;
15
+ zoomToken?: string;
16
+ };
17
+ export type StatsValue = {
18
+ current: number;
19
+ previous: number;
20
+ };
21
+ export type BroadcastStatsSummary = {
22
+ period: {
23
+ minDate: number;
24
+ maxDate: number;
25
+ };
26
+ followers: StatsValue;
27
+ viewsPerPost: StatsValue;
28
+ sharesPerPost: StatsValue;
29
+ reactionsPerPost: StatsValue;
30
+ viewsPerStory: StatsValue;
31
+ sharesPerStory: StatsValue;
32
+ reactionsPerStory: StatsValue;
33
+ enabledNotifications: {
34
+ part: number;
35
+ total: number;
36
+ percent: number;
37
+ };
38
+ recentPostsInteractions: Array<{
39
+ kind: "message";
40
+ msgId: number;
41
+ views: number;
42
+ forwards: number;
43
+ reactions: number;
44
+ } | {
45
+ kind: "story";
46
+ storyId: number;
47
+ views: number;
48
+ forwards: number;
49
+ reactions: number;
50
+ }>;
51
+ graphs?: Record<string, CompactStatsGraph>;
52
+ };
53
+ export type MegagroupStatsSummary = {
54
+ period: {
55
+ minDate: number;
56
+ maxDate: number;
57
+ };
58
+ members: StatsValue;
59
+ messages: StatsValue;
60
+ viewers: StatsValue;
61
+ posters: StatsValue;
62
+ topPosters: Array<{
63
+ userId: string;
64
+ messages: number;
65
+ avgChars: number;
66
+ }>;
67
+ topAdmins: Array<{
68
+ userId: string;
69
+ deleted: number;
70
+ kicked: number;
71
+ banned: number;
72
+ }>;
73
+ topInviters: Array<{
74
+ userId: string;
75
+ invitations: number;
76
+ }>;
77
+ graphs?: Record<string, CompactStatsGraph>;
78
+ };
79
+ export declare function summarizeMegagroupStats(stats: Api.stats.MegagroupStats, includeGraphs: boolean): MegagroupStatsSummary;
80
+ export declare function summarizeBroadcastStats(stats: Api.stats.BroadcastStats, includeGraphs: boolean): BroadcastStatsSummary;
81
+ export type ChatPermissions = {
82
+ sendMessages?: boolean;
83
+ sendMedia?: boolean;
84
+ sendStickers?: boolean;
85
+ sendGifs?: boolean;
86
+ sendPolls?: boolean;
87
+ sendInline?: boolean;
88
+ embedLinks?: boolean;
89
+ changeInfo?: boolean;
90
+ inviteUsers?: boolean;
91
+ pinMessages?: boolean;
92
+ };
93
+ export declare function mergeBannedRights(current: Record<string, unknown> | undefined | null, permissions: ChatPermissions): Record<string, boolean>;
94
+ export type MessageButtonDescriptor = {
95
+ row: number;
96
+ col: number;
97
+ type: string;
98
+ label: string;
99
+ data?: string;
100
+ url?: string;
101
+ switchQuery?: string;
102
+ samePeer?: boolean;
103
+ userId?: string;
104
+ buttonId?: number;
105
+ copyText?: string;
106
+ requiresPassword?: boolean;
107
+ quiz?: boolean;
108
+ };
109
+ export declare function describeKeyboardButton(button: Api.TypeKeyboardButton, row: number, col: number): MessageButtonDescriptor;
110
+ export type CompactPeer = {
111
+ kind: "user";
112
+ id: string;
113
+ } | {
114
+ kind: "chat";
115
+ id: string;
116
+ } | {
117
+ kind: "channel";
118
+ id: string;
119
+ };
120
+ export type UpdatesMessageSummary = {
121
+ id: number;
122
+ peer: CompactPeer;
123
+ fromId?: CompactPeer;
124
+ date: number;
125
+ text: string;
126
+ isService: boolean;
127
+ };
128
+ export type UpdatesDifferenceSummary = {
129
+ state: {
130
+ pts: number;
131
+ qts: number;
132
+ date: number;
133
+ seq: number;
134
+ unreadCount?: number;
135
+ };
136
+ isFinal: boolean;
137
+ newMessages: UpdatesMessageSummary[];
138
+ deletedMessageIds: Array<{
139
+ peer?: CompactPeer;
140
+ messageIds: number[];
141
+ }>;
142
+ otherUpdates: Array<{
143
+ type: string;
144
+ }>;
145
+ fallback?: {
146
+ kind: "tooLong";
147
+ suggestedAction: string;
148
+ };
149
+ };
150
+ export type ChannelDifferenceSummary = {
151
+ channelId: string;
152
+ pts: number;
153
+ isFinal: boolean;
154
+ timeout?: number;
155
+ newMessages: UpdatesMessageSummary[];
156
+ otherUpdates: Array<{
157
+ type: string;
158
+ }>;
159
+ fallback?: {
160
+ kind: "tooLong";
161
+ suggestedAction: string;
162
+ };
163
+ };
164
+ export declare function peerToCompact(peer: Api.TypePeer | undefined): CompactPeer | undefined;
165
+ export declare function summarizeUpdatesDifference(diff: Api.updates.TypeDifference, cursor: {
166
+ pts: number;
167
+ qts: number;
168
+ date: number;
169
+ }): UpdatesDifferenceSummary;
170
+ export declare function summarizeChannelDifference(diff: Api.updates.TypeChannelDifference, channelId: string, fallbackPts: number): ChannelDifferenceSummary;
171
+ export type StoryItemSummary = {
172
+ id: number;
173
+ kind: "active" | "deleted" | "skipped";
174
+ date?: number;
175
+ expireDate?: number;
176
+ caption?: string;
177
+ mediaType?: string;
178
+ pinned?: boolean;
179
+ public?: boolean;
180
+ closeFriends?: boolean;
181
+ edited?: boolean;
182
+ noforwards?: boolean;
183
+ fromId?: CompactPeer;
184
+ viewsCount?: number;
185
+ reactionsCount?: number;
186
+ };
187
+ export type PeerStoriesSummary = {
188
+ peer: CompactPeer;
189
+ maxReadId?: number;
190
+ stories: StoryItemSummary[];
191
+ };
192
+ export type AllStoriesSummary = {
193
+ modified: boolean;
194
+ state: string;
195
+ hasMore?: boolean;
196
+ count?: number;
197
+ peerStories: PeerStoriesSummary[];
198
+ stealthMode?: {
199
+ activeUntilDate?: number;
200
+ cooldownUntilDate?: number;
201
+ };
202
+ };
203
+ export type StoriesByIdSummary = {
204
+ count: number;
205
+ stories: StoryItemSummary[];
206
+ pinnedToTop?: number[];
207
+ };
208
+ export type StoryViewSummary = {
209
+ kind: "user";
210
+ userId: string;
211
+ date: number;
212
+ reaction?: string | null;
213
+ blocked?: boolean;
214
+ blockedMyStoriesFrom?: boolean;
215
+ } | {
216
+ kind: "publicForward";
217
+ messageId?: number;
218
+ peer?: CompactPeer;
219
+ blocked?: boolean;
220
+ blockedMyStoriesFrom?: boolean;
221
+ } | {
222
+ kind: "publicRepost";
223
+ peer?: CompactPeer;
224
+ storyId?: number;
225
+ blocked?: boolean;
226
+ blockedMyStoriesFrom?: boolean;
227
+ };
228
+ export type StoryViewsListSummary = {
229
+ count: number;
230
+ viewsCount: number;
231
+ forwardsCount: number;
232
+ reactionsCount: number;
233
+ views: StoryViewSummary[];
234
+ nextOffset?: string;
235
+ };
236
+ export type MyBoostSummary = {
237
+ slot: number;
238
+ peer?: CompactPeer;
239
+ date: number;
240
+ expires: number;
241
+ cooldownUntilDate?: number;
242
+ };
243
+ export type MyBoostsSummary = {
244
+ count: number;
245
+ myBoosts: MyBoostSummary[];
246
+ };
247
+ export declare function summarizeMyBoost(boost: Api.TypeMyBoost): MyBoostSummary;
248
+ export declare function summarizeMyBoosts(result: Api.premium.TypeMyBoosts): MyBoostsSummary;
249
+ export type PrepaidGiveawaySummary = {
250
+ kind: "premium" | "stars";
251
+ id: string;
252
+ quantity: number;
253
+ date: number;
254
+ months?: number;
255
+ stars?: string;
256
+ boosts?: number;
257
+ };
258
+ export type BoostsStatusSummary = {
259
+ level: number;
260
+ boosts: number;
261
+ currentLevelBoosts: number;
262
+ nextLevelBoosts?: number;
263
+ giftBoosts?: number;
264
+ premiumAudience?: {
265
+ part: number;
266
+ total: number;
267
+ };
268
+ boostUrl: string;
269
+ myBoost?: boolean;
270
+ myBoostSlots?: number[];
271
+ prepaidGiveaways?: PrepaidGiveawaySummary[];
272
+ };
273
+ export declare function summarizePrepaidGiveaway(g: Api.TypePrepaidGiveaway): PrepaidGiveawaySummary;
274
+ export declare function summarizeBoostsStatus(result: Api.premium.TypeBoostsStatus): BoostsStatusSummary;
275
+ export type BoostSummary = {
276
+ id: string;
277
+ userId?: string;
278
+ date: number;
279
+ expires: number;
280
+ gift?: boolean;
281
+ giveaway?: boolean;
282
+ unclaimed?: boolean;
283
+ giveawayMsgId?: number;
284
+ usedGiftSlug?: string;
285
+ multiplier?: number;
286
+ stars?: string;
287
+ };
288
+ export type BoostsListSummary = {
289
+ count: number;
290
+ boosts: BoostSummary[];
291
+ nextOffset?: string;
292
+ };
293
+ export declare function summarizeBoost(boost: Api.TypeBoost): BoostSummary;
294
+ export declare function summarizeBoostsList(result: Api.premium.TypeBoostsList): BoostsListSummary;
295
+ export type BusinessChatLinkSummary = {
296
+ link: string;
297
+ message: string;
298
+ title?: string;
299
+ views: number;
300
+ entityCount: number;
301
+ };
302
+ export type BusinessChatLinksSummary = {
303
+ count: number;
304
+ links: BusinessChatLinkSummary[];
305
+ };
306
+ export declare function summarizeBusinessChatLink(link: Api.TypeBusinessChatLink): BusinessChatLinkSummary;
307
+ export declare function summarizeBusinessChatLinks(result: Api.account.TypeBusinessChatLinks): BusinessChatLinksSummary;
308
+ export type GroupCallInfoSummary = {
309
+ kind: "active";
310
+ id: string;
311
+ accessHash: string;
312
+ participantsCount: number;
313
+ title?: string;
314
+ scheduleDate?: number;
315
+ recordStartDate?: number;
316
+ streamDcId?: number;
317
+ unmutedVideoCount?: number;
318
+ unmutedVideoLimit: number;
319
+ version: number;
320
+ joinMuted?: boolean;
321
+ canChangeJoinMuted?: boolean;
322
+ joinDateAsc?: boolean;
323
+ scheduleStartSubscribed?: boolean;
324
+ canStartVideo?: boolean;
325
+ recordVideoActive?: boolean;
326
+ rtmpStream?: boolean;
327
+ listenersHidden?: boolean;
328
+ } | {
329
+ kind: "discarded";
330
+ id: string;
331
+ accessHash: string;
332
+ duration: number;
333
+ };
334
+ export type GroupCallParticipantSummary = {
335
+ peer: CompactPeer | undefined;
336
+ date: number;
337
+ activeDate?: number;
338
+ source: number;
339
+ volume?: number;
340
+ muted?: boolean;
341
+ left?: boolean;
342
+ canSelfUnmute?: boolean;
343
+ justJoined?: boolean;
344
+ self?: boolean;
345
+ mutedByYou?: boolean;
346
+ volumeByAdmin?: boolean;
347
+ videoJoined?: boolean;
348
+ about?: string;
349
+ raiseHandRating?: string;
350
+ hasVideo?: boolean;
351
+ hasPresentation?: boolean;
352
+ };
353
+ export type GroupCallSummary = {
354
+ call: GroupCallInfoSummary;
355
+ participants: GroupCallParticipantSummary[];
356
+ participantsNextOffset?: string;
357
+ };
358
+ export type GroupCallParticipantsSummary = {
359
+ count: number;
360
+ participants: GroupCallParticipantSummary[];
361
+ nextOffset?: string;
362
+ version: number;
363
+ };
364
+ export declare function summarizeGroupCallInfo(call: Api.TypeGroupCall): GroupCallInfoSummary;
365
+ export declare function summarizeGroupCallParticipant(p: Api.TypeGroupCallParticipant): GroupCallParticipantSummary;
366
+ export declare function summarizeGroupCall(result: Api.phone.TypeGroupCall): GroupCallSummary;
367
+ export declare function summarizeGroupCallParticipants(result: Api.phone.TypeGroupParticipants): GroupCallParticipantsSummary;
368
+ export type StarsAmountSummary = {
369
+ amount: string;
370
+ nanos: number;
371
+ };
372
+ export type StarsTransactionPeerSummary = {
373
+ kind: "appStore";
374
+ } | {
375
+ kind: "playMarket";
376
+ } | {
377
+ kind: "premiumBot";
378
+ } | {
379
+ kind: "fragment";
380
+ } | {
381
+ kind: "ads";
382
+ } | {
383
+ kind: "api";
384
+ } | {
385
+ kind: "unsupported";
386
+ } | {
387
+ kind: "peer";
388
+ peer: CompactPeer | undefined;
389
+ };
390
+ export type StarsTransactionSummary = {
391
+ id: string;
392
+ stars: StarsAmountSummary;
393
+ date: number;
394
+ peer: StarsTransactionPeerSummary;
395
+ refund?: boolean;
396
+ pending?: boolean;
397
+ failed?: boolean;
398
+ gift?: boolean;
399
+ reaction?: boolean;
400
+ title?: string;
401
+ description?: string;
402
+ msgId?: number;
403
+ subscriptionPeriod?: number;
404
+ giveawayPostId?: number;
405
+ transactionDate?: number;
406
+ transactionUrl?: string;
407
+ };
408
+ export type StarsSubscriptionPricingSummary = {
409
+ period: number;
410
+ amount: string;
411
+ };
412
+ export type StarsSubscriptionSummary = {
413
+ id: string;
414
+ peer: CompactPeer | undefined;
415
+ untilDate: number;
416
+ pricing: StarsSubscriptionPricingSummary;
417
+ canceled?: boolean;
418
+ canRefulfill?: boolean;
419
+ missingBalance?: boolean;
420
+ botCanceled?: boolean;
421
+ chatInviteHash?: string;
422
+ title?: string;
423
+ invoiceSlug?: string;
424
+ };
425
+ export type StarsStatusSummary = {
426
+ balance: StarsAmountSummary;
427
+ subscriptions?: StarsSubscriptionSummary[];
428
+ subscriptionsNextOffset?: string;
429
+ subscriptionsMissingBalance?: string;
430
+ history?: StarsTransactionSummary[];
431
+ nextOffset?: string;
432
+ };
433
+ export declare function summarizeStarsAmount(amount: Api.TypeStarsAmount): StarsAmountSummary;
434
+ export declare function summarizeStarsTransactionPeer(peer: Api.TypeStarsTransactionPeer): StarsTransactionPeerSummary;
435
+ export declare function summarizeStarsTransaction(tx: Api.TypeStarsTransaction): StarsTransactionSummary;
436
+ export declare function summarizeStarsSubscription(sub: Api.TypeStarsSubscription): StarsSubscriptionSummary;
437
+ export type QuickReplySummary = {
438
+ shortcutId: number;
439
+ shortcut: string;
440
+ topMessage: number;
441
+ count: number;
442
+ };
443
+ export type QuickRepliesSummary = {
444
+ notModified?: boolean;
445
+ quickReplies?: QuickReplySummary[];
446
+ };
447
+ export declare function summarizeQuickReply(reply: Api.TypeQuickReply): QuickReplySummary;
448
+ export declare function summarizeQuickReplies(result: Api.messages.TypeQuickReplies): QuickRepliesSummary;
449
+ export type QuickReplyMessageSummary = {
450
+ id: number;
451
+ date: number;
452
+ text: string;
453
+ isService: boolean;
454
+ fromId?: CompactPeer;
455
+ replyToMsgId?: number;
456
+ };
457
+ export type QuickReplyMessagesSummary = {
458
+ notModified?: boolean;
459
+ count?: number;
460
+ messages?: QuickReplyMessageSummary[];
461
+ };
462
+ export declare function summarizeQuickReplyMessage(msg: Api.TypeMessage): QuickReplyMessageSummary | null;
463
+ export declare function summarizeQuickReplyMessages(result: Api.messages.TypeMessages): QuickReplyMessagesSummary;
464
+ export declare function summarizeStarsStatus(result: Api.payments.TypeStarsStatus): StarsStatusSummary;
465
+ export declare function summarizeStoryItem(item: Api.TypeStoryItem): StoryItemSummary;
466
+ export declare function summarizePeerStories(ps: Api.TypePeerStories): PeerStoriesSummary | null;
467
+ export declare function summarizeStoriesById(result: Api.stories.TypeStories): StoriesByIdSummary;
468
+ export declare function summarizeStoryView(view: Api.TypeStoryView): StoryViewSummary;
469
+ export declare function summarizeStoryViewsList(result: Api.stories.TypeStoryViewsList): StoryViewsListSummary;
470
+ export declare function summarizeAllStories(result: Api.stories.TypeAllStories): AllStoriesSummary;