@core-ease/telegram-kit 3.0.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 (86) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +299 -0
  3. package/dist/animation/index.d.mts +4 -0
  4. package/dist/animation/index.d.ts +4 -0
  5. package/dist/animation/index.js +2413 -0
  6. package/dist/animation/index.mjs +5 -0
  7. package/dist/animation/lottie/index.d.mts +10 -0
  8. package/dist/animation/lottie/index.d.ts +10 -0
  9. package/dist/animation/lottie/index.js +2313 -0
  10. package/dist/animation/lottie/index.mjs +4 -0
  11. package/dist/animation/tgs/index.d.mts +18 -0
  12. package/dist/animation/tgs/index.d.ts +18 -0
  13. package/dist/animation/tgs/index.js +2402 -0
  14. package/dist/animation/tgs/index.mjs +4 -0
  15. package/dist/bot/index.d.mts +477 -0
  16. package/dist/bot/index.d.ts +477 -0
  17. package/dist/bot/index.js +870 -0
  18. package/dist/bot/index.mjs +847 -0
  19. package/dist/bot-D8BnLWIi.d.mts +2041 -0
  20. package/dist/bot-D8BnLWIi.d.ts +2041 -0
  21. package/dist/browser.global.js +23 -0
  22. package/dist/chunk-7AARTHNW.mjs +40 -0
  23. package/dist/chunk-7CVYPKAL.mjs +15 -0
  24. package/dist/chunk-B3PWALX5.mjs +4418 -0
  25. package/dist/chunk-BQEUEAVK.mjs +2262 -0
  26. package/dist/chunk-FPWYSKK2.mjs +3089 -0
  27. package/dist/chunk-JXK5HCDV.mjs +254 -0
  28. package/dist/chunk-OMH2JGOH.mjs +88 -0
  29. package/dist/chunk-PXO36YTU.mjs +38 -0
  30. package/dist/core/index.d.mts +151 -0
  31. package/dist/core/index.d.ts +151 -0
  32. package/dist/core/index.js +3837 -0
  33. package/dist/core/index.mjs +495 -0
  34. package/dist/dev/index.d.mts +77 -0
  35. package/dist/dev/index.d.ts +77 -0
  36. package/dist/dev/index.js +3214 -0
  37. package/dist/dev/index.mjs +151 -0
  38. package/dist/engine-BDm1_hzn.d.mts +382 -0
  39. package/dist/engine-BDm1_hzn.d.ts +382 -0
  40. package/dist/format/index.d.mts +61 -0
  41. package/dist/format/index.d.ts +61 -0
  42. package/dist/format/index.js +121 -0
  43. package/dist/format/index.mjs +112 -0
  44. package/dist/hooks/index.d.mts +1 -0
  45. package/dist/hooks/index.d.ts +1 -0
  46. package/dist/hooks/index.js +4234 -0
  47. package/dist/hooks/index.mjs +3 -0
  48. package/dist/hooks-C5Per70R.d.mts +1066 -0
  49. package/dist/hooks-C5Per70R.d.ts +1066 -0
  50. package/dist/index.d.mts +849 -0
  51. package/dist/index.d.ts +849 -0
  52. package/dist/index.js +5026 -0
  53. package/dist/index.mjs +478 -0
  54. package/dist/keyboards/index.d.mts +50 -0
  55. package/dist/keyboards/index.d.ts +50 -0
  56. package/dist/keyboards/index.js +127 -0
  57. package/dist/keyboards/index.mjs +124 -0
  58. package/dist/links/index.d.mts +53 -0
  59. package/dist/links/index.d.ts +53 -0
  60. package/dist/links/index.js +139 -0
  61. package/dist/links/index.mjs +133 -0
  62. package/dist/lottie/index.d.mts +3 -0
  63. package/dist/lottie/index.d.ts +3 -0
  64. package/dist/lottie/index.js +2313 -0
  65. package/dist/lottie/index.mjs +4 -0
  66. package/dist/qr/index.d.mts +75 -0
  67. package/dist/qr/index.d.ts +75 -0
  68. package/dist/qr/index.js +983 -0
  69. package/dist/qr/index.mjs +946 -0
  70. package/dist/sdk/index.d.mts +322 -0
  71. package/dist/sdk/index.d.ts +322 -0
  72. package/dist/sdk/index.js +3138 -0
  73. package/dist/sdk/index.mjs +2 -0
  74. package/dist/server/index.d.mts +28 -0
  75. package/dist/server/index.d.ts +28 -0
  76. package/dist/server/index.js +254 -0
  77. package/dist/server/index.mjs +246 -0
  78. package/dist/tgs/index.d.mts +3 -0
  79. package/dist/tgs/index.d.ts +3 -0
  80. package/dist/tgs/index.js +2402 -0
  81. package/dist/tgs/index.mjs +4 -0
  82. package/dist/webapp-B-3_74nK.d.mts +842 -0
  83. package/dist/webapp-B-3_74nK.d.ts +842 -0
  84. package/dist/webapp-BDi9q3-a.d.mts +42 -0
  85. package/dist/webapp-YvmwFYUQ.d.ts +42 -0
  86. package/package.json +165 -0
@@ -0,0 +1,477 @@
1
+ import { G as GetUpdatesParams, U as Update, S as SetWebhookParams, D as DeleteWebhookParams, W as WebhookInfo, a as User, B as BotDescription, b as BotShortDescription, c as BotName, d as SendMessageParams, M as Message, F as ForwardMessageParams, e as ForwardMessagesParams, f as MessageId, C as CopyMessageParams, g as CopyMessagesParams, h as SendPhotoParams, i as SendAudioParams, j as SendDocumentParams, k as SendVideoParams, l as SendAnimationParams, m as SendVoiceParams, n as SendVideoNoteParams, o as SendStickerParams, p as SendMediaGroupParams, q as SendLocationParams, r as SendVenueParams, s as SendContactParams, t as SendPollParams, u as SendDiceParams, v as SendChatActionParams, w as SetMessageReactionParams, E as EditMessageTextParams, x as EditMessageCaptionParams, y as EditMessageMediaParams, z as EditMessageReplyMarkupParams, R as ReplyMarkup, P as Poll, A as DeleteMessageParams, H as DeleteMessagesParams, I as PinChatMessageParams, J as UnpinChatMessageParams, K as File, L as GetUserProfilePhotosParams, N as UserProfilePhotos, O as ChatFullInfo, Q as ChatMember, T as BanChatMemberParams, V as UnbanChatMemberParams, X as RestrictChatMemberParams, Y as PromoteChatMemberParams, Z as CreateChatInviteLinkParams, _ as ChatInviteLink, $ as EditChatInviteLinkParams, a0 as RevokeChatInviteLinkParams, a1 as SetMyCommandsParams, a2 as GetMyCommandsParams, a3 as BotCommand, a4 as DeleteMyCommandsParams, a5 as MenuButton, a6 as AnswerCallbackQueryParams, a7 as AnswerInlineQueryParams, a8 as AnswerWebAppQueryParams, a9 as AnswerShippingQueryParams, aa as AnswerPreCheckoutQueryParams, ab as SendInvoiceParams, ac as CreateInvoiceLinkParams, ad as StickerSet, ae as Sticker, af as CreateNewStickerSetParams, ag as AddStickerToSetParams, ah as InputSticker, ai as SendGameParams, aj as SetGameScoreParams, ak as GetGameHighScoresParams, al as GameHighScore, am as CreateForumTopicParams, an as ForumTopic, ao as EditForumTopicParams, ap as GetStarTransactionsParams, aq as StarTransactions, ar as RefundStarPaymentParams, as as SendPaidMediaParams, at as GetBusinessConnectionParams, au as BusinessConnection, av as SetChatStickerSetParams, aw as DeleteChatStickerSetParams, ax as CreateChatSubscriptionInviteLinkParams, ay as EditChatSubscriptionInviteLinkParams, az as GetAvailableGiftsParams, aA as Gifts, aB as SendGiftParams, aC as SetUserEmojiStatusParams, aD as VerifyUserParams, aE as RemoveUserVerificationParams, aF as VerifyChatParams, aG as RemoveChatVerificationParams, aH as ReadBusinessMessageParams, aI as DeleteBusinessMessagesParams, aJ as AllowUserMessagesParams, aK as DisallowUserMessagesParams, aL as GetUserChatBoostsParams, aM as UserChatBoosts, aN as SavePreparedInlineMessageParams, aO as PreparedInlineMessage, aP as BusinessMessagesDeleted, aQ as CallbackQuery, aR as InlineQuery, aS as ChosenInlineResult, aT as ShippingQuery, aU as PreCheckoutQuery, aV as PollAnswer, aW as ChatMemberUpdated, aX as ChatJoinRequest, aY as ChatBoostUpdated, aZ as ChatBoostRemoved, a_ as MessageReactionUpdated, a$ as PaidMediaPurchased, b0 as MessageReactionCountUpdated } from '../bot-D8BnLWIi.js';
2
+ export { b1 as AffiliateInfo, b2 as Animation, b3 as Audio, b4 as BackgroundFill, b5 as BackgroundType, b6 as Birthdate, b7 as BotCommandScope, b8 as BusinessIntro, b9 as BusinessLocation, ba as BusinessOpeningHours, bb as BusinessOpeningHoursInterval, bc as Chat, bd as ChatBackground, be as ChatBoostAdded, bf as ChatLocation, bg as ChatMemberAdministrator, bh as ChatMemberBanned, bi as ChatMemberLeft, bj as ChatMemberMember, bk as ChatMemberOwner, bl as ChatMemberRestricted, bm as ChatPermissions, bn as ChatPhoto, bo as ChatShared, bp as ChatType, bq as Contact, br as Dice, bs as Document, bt as ForceReply, bu as ForumTopicClosed, bv as ForumTopicCreated, bw as ForumTopicEdited, bx as ForumTopicReopened, by as Game, bz as GeneralForumTopicHidden, bA as GeneralForumTopicUnhidden, bB as Gift, bC as Giveaway, bD as GiveawayCompleted, bE as GiveawayCreated, bF as GiveawayWinners, bG as InlineKeyboardButton, bH as InlineKeyboardMarkup, bI as InlineQueryResult, bJ as InlineQueryResultsButton, bK as InputMedia, bL as InputPaidMedia, bM as InputPollOption, bN as Invoice, bO as KeyboardButton, bP as LabeledPrice, bQ as LinkPreviewOptions, bR as Location, bS as LoginUrl, bT as MaskPosition, bU as MessageAutoDeleteTimerChanged, bV as MessageEntity, bW as MessageOrigin, bX as OrderInfo, bY as PaidMediaInfo, bZ as PhotoSize, b_ as PollOption, b$ as ProximityAlertTriggered, c0 as ReactionType, c1 as RefundedPayment, c2 as ReplyKeyboardMarkup, c3 as ReplyKeyboardRemove, c4 as ReplyParameters, c5 as ResponseParameters, c6 as RevenueWithdrawalState, c7 as SendCommonParams, c8 as SharedUser, c9 as ShippingAddress, ca as ShippingOption, cb as StarTransaction, cc as Story, cd as SuccessfulPayment, ce as TelegramApiError, cf as TelegramApiResponse, cg as TransactionPartner, ch as UsersShared, ci as Venue, cj as Video, ck as VideoChatEnded, cl as VideoChatParticipantsInvited, cm as VideoChatScheduled, cn as VideoChatStarted, co as VideoNote, cp as Voice, cq as WebAppData, cr as WebAppInfo, cs as WriteAccessAllowed } from '../bot-D8BnLWIi.js';
3
+
4
+ interface TelegramBotOptions {
5
+ token: string;
6
+ apiBase?: string;
7
+ timeout?: number;
8
+ }
9
+ declare class TelegramBot {
10
+ private readonly apiBase;
11
+ private readonly timeout;
12
+ constructor(options: TelegramBotOptions);
13
+ private request;
14
+ getUpdates(params?: GetUpdatesParams): Promise<Update[]>;
15
+ setWebhook(params: SetWebhookParams): Promise<true>;
16
+ deleteWebhook(params?: DeleteWebhookParams): Promise<true>;
17
+ getWebhookInfo(): Promise<WebhookInfo>;
18
+ getMe(): Promise<User>;
19
+ logOut(): Promise<true>;
20
+ close(): Promise<true>;
21
+ setMyDescription(params?: {
22
+ description?: string;
23
+ language_code?: string;
24
+ }): Promise<true>;
25
+ getMyDescription(params?: {
26
+ language_code?: string;
27
+ }): Promise<BotDescription>;
28
+ setMyShortDescription(params?: {
29
+ short_description?: string;
30
+ language_code?: string;
31
+ }): Promise<true>;
32
+ getMyShortDescription(params?: {
33
+ language_code?: string;
34
+ }): Promise<BotShortDescription>;
35
+ setMyName(params?: {
36
+ name?: string;
37
+ language_code?: string;
38
+ }): Promise<true>;
39
+ getMyName(params?: {
40
+ language_code?: string;
41
+ }): Promise<BotName>;
42
+ sendMessage(params: SendMessageParams): Promise<Message>;
43
+ forwardMessage(params: ForwardMessageParams): Promise<Message>;
44
+ forwardMessages(params: ForwardMessagesParams): Promise<MessageId[]>;
45
+ copyMessage(params: CopyMessageParams): Promise<MessageId>;
46
+ copyMessages(params: CopyMessagesParams): Promise<MessageId[]>;
47
+ sendPhoto(params: SendPhotoParams): Promise<Message>;
48
+ sendAudio(params: SendAudioParams): Promise<Message>;
49
+ sendDocument(params: SendDocumentParams): Promise<Message>;
50
+ sendVideo(params: SendVideoParams): Promise<Message>;
51
+ sendAnimation(params: SendAnimationParams): Promise<Message>;
52
+ sendVoice(params: SendVoiceParams): Promise<Message>;
53
+ sendVideoNote(params: SendVideoNoteParams): Promise<Message>;
54
+ sendSticker(params: SendStickerParams): Promise<Message>;
55
+ sendMediaGroup(params: SendMediaGroupParams): Promise<Message[]>;
56
+ sendLocation(params: SendLocationParams): Promise<Message>;
57
+ sendVenue(params: SendVenueParams): Promise<Message>;
58
+ sendContact(params: SendContactParams): Promise<Message>;
59
+ sendPoll(params: SendPollParams): Promise<Message>;
60
+ sendDice(params: SendDiceParams): Promise<Message>;
61
+ sendChatAction(params: SendChatActionParams): Promise<true>;
62
+ setMessageReaction(params: SetMessageReactionParams): Promise<true>;
63
+ editMessageText(params: EditMessageTextParams): Promise<Message | true>;
64
+ editMessageCaption(params: EditMessageCaptionParams): Promise<Message | true>;
65
+ editMessageMedia(params: EditMessageMediaParams): Promise<Message | true>;
66
+ editMessageReplyMarkup(params: EditMessageReplyMarkupParams): Promise<Message | true>;
67
+ stopPoll(params: {
68
+ chat_id: number | string;
69
+ message_id: number;
70
+ business_connection_id?: string;
71
+ reply_markup?: ReplyMarkup;
72
+ }): Promise<Poll>;
73
+ deleteMessage(params: DeleteMessageParams): Promise<true>;
74
+ deleteMessages(params: DeleteMessagesParams): Promise<true>;
75
+ pinChatMessage(params: PinChatMessageParams): Promise<true>;
76
+ unpinChatMessage(params: UnpinChatMessageParams): Promise<true>;
77
+ unpinAllChatMessages(params: {
78
+ chat_id: number | string;
79
+ business_connection_id?: string;
80
+ }): Promise<true>;
81
+ getFile(params: {
82
+ file_id: string;
83
+ }): Promise<File>;
84
+ getUserProfilePhotos(params: GetUserProfilePhotosParams): Promise<UserProfilePhotos>;
85
+ getChat(params: {
86
+ chat_id: number | string;
87
+ }): Promise<ChatFullInfo>;
88
+ getChatAdministrators(params: {
89
+ chat_id: number | string;
90
+ }): Promise<ChatMember[]>;
91
+ getChatMemberCount(params: {
92
+ chat_id: number | string;
93
+ }): Promise<number>;
94
+ getChatMember(params: {
95
+ chat_id: number | string;
96
+ user_id: number;
97
+ }): Promise<ChatMember>;
98
+ banChatMember(params: BanChatMemberParams): Promise<true>;
99
+ unbanChatMember(params: UnbanChatMemberParams): Promise<true>;
100
+ restrictChatMember(params: RestrictChatMemberParams): Promise<true>;
101
+ promoteChatMember(params: PromoteChatMemberParams): Promise<true>;
102
+ setChatAdministratorCustomTitle(params: {
103
+ chat_id: number | string;
104
+ user_id: number;
105
+ custom_title: string;
106
+ }): Promise<true>;
107
+ banChatSenderChat(params: {
108
+ chat_id: number | string;
109
+ sender_chat_id: number;
110
+ }): Promise<true>;
111
+ unbanChatSenderChat(params: {
112
+ chat_id: number | string;
113
+ sender_chat_id: number;
114
+ }): Promise<true>;
115
+ setChatPermissions(params: {
116
+ chat_id: number | string;
117
+ permissions: Record<string, boolean>;
118
+ use_independent_chat_permissions?: boolean;
119
+ }): Promise<true>;
120
+ exportChatInviteLink(params: {
121
+ chat_id: number | string;
122
+ }): Promise<string>;
123
+ createChatInviteLink(params: CreateChatInviteLinkParams): Promise<ChatInviteLink>;
124
+ editChatInviteLink(params: EditChatInviteLinkParams): Promise<ChatInviteLink>;
125
+ revokeChatInviteLink(params: RevokeChatInviteLinkParams): Promise<ChatInviteLink>;
126
+ approveChatJoinRequest(params: {
127
+ chat_id: number | string;
128
+ user_id: number;
129
+ }): Promise<true>;
130
+ declineChatJoinRequest(params: {
131
+ chat_id: number | string;
132
+ user_id: number;
133
+ }): Promise<true>;
134
+ setChatPhoto(params: {
135
+ chat_id: number | string;
136
+ photo: string;
137
+ }): Promise<true>;
138
+ deleteChatPhoto(params: {
139
+ chat_id: number | string;
140
+ }): Promise<true>;
141
+ setChatTitle(params: {
142
+ chat_id: number | string;
143
+ title: string;
144
+ }): Promise<true>;
145
+ setChatDescription(params: {
146
+ chat_id: number | string;
147
+ description?: string;
148
+ }): Promise<true>;
149
+ leaveChat(params: {
150
+ chat_id: number | string;
151
+ }): Promise<true>;
152
+ setMyCommands(params: SetMyCommandsParams): Promise<true>;
153
+ getMyCommands(params?: GetMyCommandsParams): Promise<BotCommand[]>;
154
+ deleteMyCommands(params?: DeleteMyCommandsParams): Promise<true>;
155
+ getChatMenuButton(params?: {
156
+ chat_id?: number;
157
+ }): Promise<MenuButton>;
158
+ setChatMenuButton(params?: {
159
+ chat_id?: number;
160
+ menu_button?: MenuButton;
161
+ }): Promise<true>;
162
+ setMyDefaultAdministratorRights(params?: {
163
+ rights?: Record<string, boolean>;
164
+ for_channels?: boolean;
165
+ }): Promise<true>;
166
+ getMyDefaultAdministratorRights(params?: {
167
+ for_channels?: boolean;
168
+ }): Promise<Record<string, unknown>>;
169
+ answerCallbackQuery(params: AnswerCallbackQueryParams): Promise<true>;
170
+ answerInlineQuery(params: AnswerInlineQueryParams): Promise<true>;
171
+ answerWebAppQuery(params: AnswerWebAppQueryParams): Promise<{
172
+ inline_message_id: string;
173
+ }>;
174
+ answerShippingQuery(params: AnswerShippingQueryParams): Promise<true>;
175
+ answerPreCheckoutQuery(params: AnswerPreCheckoutQueryParams): Promise<true>;
176
+ sendInvoice(params: SendInvoiceParams): Promise<Message>;
177
+ createInvoiceLink(params: CreateInvoiceLinkParams): Promise<string>;
178
+ getStickerSet(params: {
179
+ name: string;
180
+ }): Promise<StickerSet>;
181
+ getCustomEmojiStickers(params: {
182
+ custom_emoji_ids: string[];
183
+ }): Promise<Sticker[]>;
184
+ createNewStickerSet(params: CreateNewStickerSetParams): Promise<true>;
185
+ addStickerToSet(params: AddStickerToSetParams): Promise<true>;
186
+ setStickerPositionInSet(params: {
187
+ sticker: string;
188
+ position: number;
189
+ }): Promise<true>;
190
+ deleteStickerFromSet(params: {
191
+ sticker: string;
192
+ }): Promise<true>;
193
+ replaceStickerInSet(params: {
194
+ user_id: number;
195
+ name: string;
196
+ old_sticker: string;
197
+ sticker: InputSticker;
198
+ }): Promise<true>;
199
+ setStickerEmojiList(params: {
200
+ sticker: string;
201
+ emoji_list: string[];
202
+ }): Promise<true>;
203
+ setStickerKeywords(params: {
204
+ sticker: string;
205
+ keywords?: string[];
206
+ }): Promise<true>;
207
+ setStickerMaskPosition(params: {
208
+ sticker: string;
209
+ mask_position?: Record<string, unknown>;
210
+ }): Promise<true>;
211
+ setStickerSetTitle(params: {
212
+ name: string;
213
+ title: string;
214
+ }): Promise<true>;
215
+ setStickerSetThumbnail(params: {
216
+ name: string;
217
+ user_id: number;
218
+ thumbnail?: string;
219
+ format: string;
220
+ }): Promise<true>;
221
+ setCustomEmojiStickerSetThumbnail(params: {
222
+ name: string;
223
+ custom_emoji_id?: string;
224
+ }): Promise<true>;
225
+ deleteStickerSet(params: {
226
+ name: string;
227
+ }): Promise<true>;
228
+ sendGame(params: SendGameParams): Promise<Message>;
229
+ setGameScore(params: SetGameScoreParams): Promise<Message | true>;
230
+ getGameHighScores(params: GetGameHighScoresParams): Promise<GameHighScore[]>;
231
+ createForumTopic(params: CreateForumTopicParams): Promise<ForumTopic>;
232
+ editForumTopic(params: EditForumTopicParams): Promise<true>;
233
+ closeForumTopic(params: {
234
+ chat_id: number | string;
235
+ message_thread_id: number;
236
+ }): Promise<true>;
237
+ reopenForumTopic(params: {
238
+ chat_id: number | string;
239
+ message_thread_id: number;
240
+ }): Promise<true>;
241
+ deleteForumTopic(params: {
242
+ chat_id: number | string;
243
+ message_thread_id: number;
244
+ }): Promise<true>;
245
+ unpinAllForumTopicMessages(params: {
246
+ chat_id: number | string;
247
+ message_thread_id: number;
248
+ }): Promise<true>;
249
+ hideGeneralForumTopic(params: {
250
+ chat_id: number | string;
251
+ }): Promise<true>;
252
+ unhideGeneralForumTopic(params: {
253
+ chat_id: number | string;
254
+ }): Promise<true>;
255
+ unpinAllGeneralForumTopicMessages(params: {
256
+ chat_id: number | string;
257
+ }): Promise<true>;
258
+ setMyStarTransactionWithdrawalLimit(params: {
259
+ daily_limit: number;
260
+ }): Promise<true>;
261
+ getStarTransactions(params?: GetStarTransactionsParams): Promise<StarTransactions>;
262
+ refundStarPayment(params: RefundStarPaymentParams): Promise<true>;
263
+ sendPaidMedia(params: SendPaidMediaParams): Promise<Message>;
264
+ getBusinessConnection(params: GetBusinessConnectionParams): Promise<BusinessConnection>;
265
+ setChatStickerSet(params: SetChatStickerSetParams): Promise<true>;
266
+ deleteChatStickerSet(params: DeleteChatStickerSetParams): Promise<true>;
267
+ createChatSubscriptionInviteLink(params: CreateChatSubscriptionInviteLinkParams): Promise<ChatInviteLink>;
268
+ editChatSubscriptionInviteLink(params: EditChatSubscriptionInviteLinkParams): Promise<ChatInviteLink>;
269
+ getAvailableGifts(_params?: GetAvailableGiftsParams): Promise<Gifts>;
270
+ sendGift(params: SendGiftParams): Promise<true>;
271
+ setUserEmojiStatus(params: SetUserEmojiStatusParams): Promise<true>;
272
+ verifyUser(params: VerifyUserParams): Promise<true>;
273
+ removeUserVerification(params: RemoveUserVerificationParams): Promise<true>;
274
+ verifyChat(params: VerifyChatParams): Promise<true>;
275
+ removeChatVerification(params: RemoveChatVerificationParams): Promise<true>;
276
+ readBusinessMessage(params: ReadBusinessMessageParams): Promise<true>;
277
+ deleteBusinessMessages(params: DeleteBusinessMessagesParams): Promise<true>;
278
+ allowUserMessages(params: AllowUserMessagesParams): Promise<true>;
279
+ disallowUserMessages(params: DisallowUserMessagesParams): Promise<true>;
280
+ getUserChatBoosts(params: GetUserChatBoostsParams): Promise<UserChatBoosts>;
281
+ savePreparedInlineMessage(params: SavePreparedInlineMessageParams): Promise<PreparedInlineMessage>;
282
+ getFileDownloadUrl(filePath: string): string;
283
+ getFileWithUrl(fileId: string): Promise<File & {
284
+ downloadUrl: string;
285
+ }>;
286
+ editMessageLiveLocation(params: Record<string, unknown>): Promise<Message | true>;
287
+ stopMessageLiveLocation(params: Record<string, unknown>): Promise<Message | true>;
288
+ sendChecklist(params: Record<string, unknown>): Promise<Message>;
289
+ editMessageChecklist(params: Record<string, unknown>): Promise<Message | true>;
290
+ uploadStickerFile(params: {
291
+ user_id: number;
292
+ sticker: unknown;
293
+ sticker_format: 'static' | 'animated' | 'video';
294
+ }): Promise<File>;
295
+ setPassportDataErrors(params: {
296
+ user_id: number;
297
+ errors: Array<Record<string, unknown>>;
298
+ }): Promise<true>;
299
+ getForumTopicIconStickers(): Promise<Sticker[]>;
300
+ editGeneralForumTopic(params: {
301
+ chat_id: number | string;
302
+ name: string;
303
+ }): Promise<true>;
304
+ closeGeneralForumTopic(params: {
305
+ chat_id: number | string;
306
+ }): Promise<true>;
307
+ reopenGeneralForumTopic(params: {
308
+ chat_id: number | string;
309
+ }): Promise<true>;
310
+ editUserStarSubscription(params: {
311
+ user_id: number;
312
+ telegram_payment_charge_id: string;
313
+ is_canceled: boolean;
314
+ }): Promise<true>;
315
+ getBusinessAccountGifts(params: {
316
+ business_connection_id: string;
317
+ exclude_unsaved?: boolean;
318
+ exclude_saved?: boolean;
319
+ exclude_unlimited?: boolean;
320
+ exclude_limited?: boolean;
321
+ exclude_unique?: boolean;
322
+ sort_by_price?: boolean;
323
+ offset?: string;
324
+ limit?: number;
325
+ }): Promise<unknown>;
326
+ getBusinessAccountStarBalance(params: {
327
+ business_connection_id: string;
328
+ }): Promise<{
329
+ amount: number;
330
+ }>;
331
+ convertGiftToStars(params: {
332
+ business_connection_id: string;
333
+ owned_gift_id: string;
334
+ }): Promise<true>;
335
+ upgradeGift(params: {
336
+ business_connection_id: string;
337
+ owned_gift_id: string;
338
+ keep_original_details?: boolean;
339
+ star_count?: number;
340
+ }): Promise<true>;
341
+ transferGift(params: {
342
+ business_connection_id: string;
343
+ owned_gift_id: string;
344
+ new_owner_chat_id: number;
345
+ star_count?: number;
346
+ }): Promise<true>;
347
+ transferBusinessAccountStars(params: {
348
+ business_connection_id: string;
349
+ star_count: number;
350
+ }): Promise<true>;
351
+ setBusinessAccountName(params: {
352
+ business_connection_id: string;
353
+ first_name: string;
354
+ last_name?: string;
355
+ }): Promise<true>;
356
+ setBusinessAccountUsername(params: {
357
+ business_connection_id: string;
358
+ username?: string;
359
+ }): Promise<true>;
360
+ setBusinessAccountBio(params: {
361
+ business_connection_id: string;
362
+ bio?: string;
363
+ }): Promise<true>;
364
+ setBusinessAccountProfilePhoto(params: {
365
+ business_connection_id: string;
366
+ photo: unknown;
367
+ is_public?: boolean;
368
+ }): Promise<true>;
369
+ removeBusinessAccountProfilePhoto(params: {
370
+ business_connection_id: string;
371
+ is_public?: boolean;
372
+ }): Promise<true>;
373
+ setBusinessAccountGiftSettings(params: {
374
+ business_connection_id: string;
375
+ show_gift_button: boolean;
376
+ accepted_gift_types: Record<string, boolean>;
377
+ }): Promise<true>;
378
+ postStory(params: Record<string, unknown>): Promise<unknown>;
379
+ editStory(params: Record<string, unknown>): Promise<unknown>;
380
+ deleteStory(params: {
381
+ business_connection_id: string;
382
+ story_id: number;
383
+ }): Promise<true>;
384
+ callMethod<T = unknown>(method: string, params?: unknown): Promise<T>;
385
+ }
386
+
387
+ type MessageFilter = (message: Message) => boolean | Promise<boolean>;
388
+ type UpdateHandler$1 = (update: Update) => void | Promise<void>;
389
+ interface MessageHandler {
390
+ filter?: MessageFilter;
391
+ handler: (message: Message) => void | Promise<void>;
392
+ }
393
+ interface DispatcherOptions {
394
+ onError?: (error: Error, update: Update) => void;
395
+ botUsername?: string;
396
+ }
397
+ declare class Dispatcher {
398
+ private readonly options;
399
+ private readonly messageHandlers;
400
+ private readonly editedMessageHandlers;
401
+ private readonly channelPostHandlers;
402
+ private readonly editedChannelPostHandlers;
403
+ private readonly businessMessageHandlers;
404
+ private readonly editedBusinessMessageHandlers;
405
+ private readonly deletedBusinessMessagesHandlers;
406
+ private readonly pollHandlers;
407
+ private readonly callbackQueryHandlers;
408
+ private readonly inlineQueryHandlers;
409
+ private readonly chosenInlineResultHandlers;
410
+ private readonly shippingQueryHandlers;
411
+ private readonly preCheckoutQueryHandlers;
412
+ private readonly pollAnswerHandlers;
413
+ private readonly myChatMemberHandlers;
414
+ private readonly chatMemberHandlers;
415
+ private readonly chatJoinRequestHandlers;
416
+ private readonly chatBoostHandlers;
417
+ private readonly removedChatBoostHandlers;
418
+ private readonly messageReactionHandlers;
419
+ private readonly businessConnectionHandlers;
420
+ private readonly purchasedPaidMediaHandlers;
421
+ private readonly messageReactionCountHandlers;
422
+ private botUsername;
423
+ constructor(options?: DispatcherOptions);
424
+ setBotUsername(username: string): this;
425
+ onMessage(handler: (message: Message) => void | Promise<void>, filter?: MessageFilter): this;
426
+ onCommand(command: string, handler: (message: Message) => void | Promise<void>): this;
427
+ onEditedMessage(handler: (message: Message) => void | Promise<void>, filter?: MessageFilter): this;
428
+ onChannelPost(handler: (message: Message) => void | Promise<void>, filter?: MessageFilter): this;
429
+ onEditedChannelPost(handler: (message: Message) => void | Promise<void>, filter?: MessageFilter): this;
430
+ onBusinessMessage(handler: (message: Message) => void | Promise<void>, filter?: MessageFilter): this;
431
+ onEditedBusinessMessage(handler: (message: Message) => void | Promise<void>, filter?: MessageFilter): this;
432
+ onDeletedBusinessMessages(handler: (event: BusinessMessagesDeleted) => void | Promise<void>): this;
433
+ onPoll(handler: (poll: Poll) => void | Promise<void>): this;
434
+ onCallbackQuery(handler: (query: CallbackQuery) => void | Promise<void>, pattern?: string | RegExp): this;
435
+ onInlineQuery(handler: (query: InlineQuery) => void | Promise<void>): this;
436
+ onChosenInlineResult(handler: (result: ChosenInlineResult) => void | Promise<void>): this;
437
+ onShippingQuery(handler: (query: ShippingQuery) => void | Promise<void>): this;
438
+ onPreCheckoutQuery(handler: (query: PreCheckoutQuery) => void | Promise<void>): this;
439
+ onPollAnswer(handler: (answer: PollAnswer) => void | Promise<void>): this;
440
+ onMyChatMember(handler: (update: ChatMemberUpdated) => void | Promise<void>): this;
441
+ onChatMember(handler: (update: ChatMemberUpdated) => void | Promise<void>): this;
442
+ onChatJoinRequest(handler: (request: ChatJoinRequest) => void | Promise<void>): this;
443
+ onChatBoost(handler: (boost: ChatBoostUpdated) => void | Promise<void>): this;
444
+ onRemovedChatBoost(handler: (boost: ChatBoostRemoved) => void | Promise<void>): this;
445
+ onMessageReaction(handler: (reaction: MessageReactionUpdated) => void | Promise<void>): this;
446
+ onBusinessConnection(handler: (connection: BusinessConnection) => void | Promise<void>): this;
447
+ onPurchasedPaidMedia(handler: (media: PaidMediaPurchased) => void | Promise<void>): this;
448
+ onMessageReactionCount(handler: (reaction: MessageReactionCountUpdated) => void | Promise<void>): this;
449
+ dispatch(update: Update): Promise<void>;
450
+ private _runMessageHandlers;
451
+ private _runCallbackQueryHandlers;
452
+ toHandler(): (update: Update) => Promise<void>;
453
+ }
454
+
455
+ interface PollingOptions {
456
+ timeout?: number;
457
+ limit?: number;
458
+ allowedUpdates?: string[];
459
+ onError?: (error: Error) => void;
460
+ retryAfterMs?: number;
461
+ }
462
+ type UpdateHandler = (update: Update) => void | Promise<void>;
463
+ declare class TelegramPoller {
464
+ private readonly getUpdates;
465
+ private readonly handler;
466
+ private readonly options;
467
+ private running;
468
+ private offset;
469
+ private abortController;
470
+ constructor(getUpdates: (params?: GetUpdatesParams) => Promise<Update[]>, handler: UpdateHandler, options?: PollingOptions);
471
+ start(): void;
472
+ stop(): void;
473
+ get isRunning(): boolean;
474
+ private _loop;
475
+ }
476
+
477
+ export { AddStickerToSetParams, AllowUserMessagesParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AnswerPreCheckoutQueryParams, AnswerShippingQueryParams, AnswerWebAppQueryParams, BanChatMemberParams, BotCommand, BotDescription, BotName, BotShortDescription, BusinessConnection, BusinessMessagesDeleted, CallbackQuery, ChatFullInfo, ChatInviteLink, ChatJoinRequest, ChatMember, ChatMemberUpdated, ChosenInlineResult, CopyMessageParams, CopyMessagesParams, CreateChatInviteLinkParams, CreateChatSubscriptionInviteLinkParams, CreateForumTopicParams, CreateInvoiceLinkParams, CreateNewStickerSetParams, DeleteBusinessMessagesParams, DeleteChatStickerSetParams, DeleteMessageParams, DeleteMessagesParams, DeleteMyCommandsParams, DeleteWebhookParams, DisallowUserMessagesParams, Dispatcher, type DispatcherOptions, EditChatInviteLinkParams, EditChatSubscriptionInviteLinkParams, EditForumTopicParams, EditMessageCaptionParams, EditMessageMediaParams, EditMessageReplyMarkupParams, EditMessageTextParams, File, ForumTopic, ForwardMessageParams, ForwardMessagesParams, GameHighScore, GetAvailableGiftsParams, GetBusinessConnectionParams, GetGameHighScoresParams, GetMyCommandsParams, GetStarTransactionsParams, GetUpdatesParams, GetUserChatBoostsParams, GetUserProfilePhotosParams, Gifts, InlineQuery, InputSticker, MenuButton, Message, type MessageFilter, type MessageHandler, MessageId, PaidMediaPurchased, PinChatMessageParams, Poll, PollAnswer, type PollingOptions, PreCheckoutQuery, PreparedInlineMessage, PromoteChatMemberParams, ReadBusinessMessageParams, RefundStarPaymentParams, RemoveChatVerificationParams, RemoveUserVerificationParams, ReplyMarkup, RestrictChatMemberParams, RevokeChatInviteLinkParams, SavePreparedInlineMessageParams, SendAnimationParams, SendAudioParams, SendChatActionParams, SendContactParams, SendDiceParams, SendDocumentParams, SendGameParams, SendGiftParams, SendInvoiceParams, SendLocationParams, SendMediaGroupParams, SendMessageParams, SendPaidMediaParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetChatStickerSetParams, SetGameScoreParams, SetMessageReactionParams, SetMyCommandsParams, SetUserEmojiStatusParams, SetWebhookParams, ShippingQuery, StarTransactions, Sticker, StickerSet, TelegramBot, type TelegramBotOptions, TelegramPoller, UnbanChatMemberParams, UnpinChatMessageParams, Update, type UpdateHandler$1 as UpdateHandler, User, UserChatBoosts, UserProfilePhotos, VerifyChatParams, VerifyUserParams, WebhookInfo };