grammy-tools 1.36.2

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 (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +339 -0
  3. package/out/bot.d.ts +314 -0
  4. package/out/bot.js +669 -0
  5. package/out/composer.d.ts +764 -0
  6. package/out/composer.js +704 -0
  7. package/out/context.d.ts +1618 -0
  8. package/out/context.js +1976 -0
  9. package/out/convenience/constants.d.ts +98 -0
  10. package/out/convenience/constants.js +37 -0
  11. package/out/convenience/frameworks.d.ts +216 -0
  12. package/out/convenience/frameworks.js +370 -0
  13. package/out/convenience/inline_query.d.ts +401 -0
  14. package/out/convenience/inline_query.js +461 -0
  15. package/out/convenience/input_media.d.ts +72 -0
  16. package/out/convenience/input_media.js +82 -0
  17. package/out/convenience/keyboard.d.ts +763 -0
  18. package/out/convenience/keyboard.js +935 -0
  19. package/out/convenience/session.d.ts +345 -0
  20. package/out/convenience/session.js +455 -0
  21. package/out/convenience/webhook.d.ts +59 -0
  22. package/out/convenience/webhook.js +80 -0
  23. package/out/core/api.d.ts +1628 -0
  24. package/out/core/api.js +1907 -0
  25. package/out/core/client.d.ts +180 -0
  26. package/out/core/client.js +226 -0
  27. package/out/core/error.d.ts +53 -0
  28. package/out/core/error.js +87 -0
  29. package/out/core/payload.d.ts +39 -0
  30. package/out/core/payload.js +199 -0
  31. package/out/filter.d.ts +959 -0
  32. package/out/filter.js +378 -0
  33. package/out/mod.d.ts +14 -0
  34. package/out/mod.js +43 -0
  35. package/out/platform.node.d.ts +16 -0
  36. package/out/platform.node.js +43 -0
  37. package/out/shim.node.d.ts +2 -0
  38. package/out/shim.node.js +7 -0
  39. package/out/types.d.ts +1 -0
  40. package/out/types.js +17 -0
  41. package/out/types.node.d.ts +78 -0
  42. package/out/types.node.js +107 -0
  43. package/out/web.d.ts +1 -0
  44. package/out/web.mjs +5172 -0
  45. package/package.json +71 -0
@@ -0,0 +1,1618 @@
1
+ import { type Api, type Other as OtherApi } from "./core/api.js";
2
+ import { type Methods, type RawApi } from "./core/client.js";
3
+ import { type Filter, type FilterCore, type FilterQuery } from "./filter.js";
4
+ import { type Chat, type ChatPermissions, type InlineQueryResult, type InputFile, type InputMedia, type InputMediaAudio, type InputMediaDocument, type InputMediaPhoto, type InputMediaVideo, type InputPaidMedia, type InputPollOption, type LabeledPrice, type Message, type MessageEntity, type PassportElementError, type ReactionType, type ReactionTypeEmoji, type Update, type User, type UserFromGetMe } from "./types.js";
5
+ export type MaybeArray<T> = T | T[];
6
+ /** permits `string` but gives hints */
7
+ export type StringWithCommandSuggestions = (string & Record<never, never>) | "start" | "help" | "settings" | "privacy" | "developer_info";
8
+ type Other<M extends Methods<RawApi>, X extends string = never> = OtherApi<RawApi, M, X>;
9
+ type SnakeToCamelCase<S extends string> = S extends `${infer L}_${infer R}` ? `${L}${Capitalize<SnakeToCamelCase<R>>}` : S;
10
+ type AliasProps<U> = {
11
+ [K in string & keyof U as SnakeToCamelCase<K>]: U[K];
12
+ };
13
+ type RenamedUpdate = AliasProps<Omit<Update, "update_id">>;
14
+ interface StaticHas {
15
+ /**
16
+ * Generates a predicate function that can test context objects for matching
17
+ * the given filter query. This uses the same logic as `bot.on`.
18
+ *
19
+ * @param filter The filter query to check
20
+ */
21
+ filterQuery<Q extends FilterQuery>(filter: Q | Q[]): <C extends Context>(ctx: C) => ctx is Filter<C, Q>;
22
+ /**
23
+ * Generates a predicate function that can test context objects for
24
+ * containing the given text, or for the text to match the given regular
25
+ * expression. This uses the same logic as `bot.hears`.
26
+ *
27
+ * @param trigger The string or regex to match
28
+ */
29
+ text(trigger: MaybeArray<string | RegExp>): <C extends Context>(ctx: C) => ctx is HearsContext<C>;
30
+ /**
31
+ * Generates a predicate function that can test context objects for
32
+ * containing a command. This uses the same logic as `bot.command`.
33
+ *
34
+ * @param command The command to match
35
+ */
36
+ command(command: MaybeArray<StringWithCommandSuggestions>): <C extends Context>(ctx: C) => ctx is CommandContext<C>;
37
+ /**
38
+ * Generates a predicate function that can test context objects for
39
+ * containing a message reaction update. This uses the same logic as
40
+ * `bot.reaction`.
41
+ *
42
+ * @param reaction The reaction to test against
43
+ */
44
+ reaction(reaction: MaybeArray<ReactionTypeEmoji["emoji"] | ReactionType>): <C extends Context>(ctx: C) => ctx is ReactionContext<C>;
45
+ /**
46
+ * Generates a predicate function that can test context objects for
47
+ * belonging to a chat with the given chat type. This uses the same logic as
48
+ * `bot.chatType`.
49
+ *
50
+ * @param chatType The chat type to match
51
+ */
52
+ chatType<T extends Chat["type"]>(chatType: MaybeArray<T>): <C extends Context>(ctx: C) => ctx is ChatTypeContext<C, T>;
53
+ /**
54
+ * Generates a predicate function that can test context objects for
55
+ * containing the given callback query, or for the callback query data to
56
+ * match the given regular expression. This uses the same logic as
57
+ * `bot.callbackQuery`.
58
+ *
59
+ * @param trigger The string or regex to match
60
+ */
61
+ callbackQuery(trigger: MaybeArray<string | RegExp>): <C extends Context>(ctx: C) => ctx is CallbackQueryContext<C>;
62
+ /**
63
+ * Generates a predicate function that can test context objects for
64
+ * containing the given game query, or for the game name to match the given
65
+ * regular expression. This uses the same logic as `bot.gameQuery`.
66
+ *
67
+ * @param trigger The string or regex to match
68
+ */
69
+ gameQuery(trigger: MaybeArray<string | RegExp>): <C extends Context>(ctx: C) => ctx is GameQueryContext<C>;
70
+ /**
71
+ * Generates a predicate function that can test context objects for
72
+ * containing the given inline query, or for the inline query to match the
73
+ * given regular expression. This uses the same logic as `bot.inlineQuery`.
74
+ *
75
+ * @param trigger The string or regex to match
76
+ */
77
+ inlineQuery(trigger: MaybeArray<string | RegExp>): <C extends Context>(ctx: C) => ctx is InlineQueryContext<C>;
78
+ /**
79
+ * Generates a predicate function that can test context objects for
80
+ * containing the chosen inline result, or for the chosen inline result to
81
+ * match the given regular expression.
82
+ *
83
+ * @param trigger The string or regex to match
84
+ */
85
+ chosenInlineResult(trigger: MaybeArray<string | RegExp>): <C extends Context>(ctx: C) => ctx is ChosenInlineResultContext<C>;
86
+ /**
87
+ * Generates a predicate function that can test context objects for
88
+ * containing the given pre-checkout query, or for the pre-checkout query
89
+ * payload to match the given regular expression. This uses the same logic
90
+ * as `bot.preCheckoutQuery`.
91
+ *
92
+ * @param trigger The string or regex to match
93
+ */
94
+ preCheckoutQuery(trigger: MaybeArray<string | RegExp>): <C extends Context>(ctx: C) => ctx is PreCheckoutQueryContext<C>;
95
+ /**
96
+ * Generates a predicate function that can test context objects for
97
+ * containing the given shipping query, or for the shipping query to match
98
+ * the given regular expression. This uses the same logic as
99
+ * `bot.shippingQuery`.
100
+ *
101
+ * @param trigger The string or regex to match
102
+ */
103
+ shippingQuery(trigger: MaybeArray<string | RegExp>): <C extends Context>(ctx: C) => ctx is ShippingQueryContext<C>;
104
+ }
105
+ /**
106
+ * When your bot receives a message, Telegram sends an update object to your
107
+ * bot. The update contains information about the chat, the user, and of course
108
+ * the message itself. There are numerous other updates, too:
109
+ * https://core.telegram.org/bots/api#update
110
+ *
111
+ * When grammY receives an update, it wraps this update into a context object
112
+ * for you. Context objects are commonly named `ctx`. A context object does two
113
+ * things:
114
+ * 1. **`ctx.update`** holds the update object that you can use to process the
115
+ * message. This includes providing useful shortcuts for the update, for
116
+ * instance, `ctx.msg` is a shortcut that gives you the message object from
117
+ * the update—no matter whether it is contained in `ctx.update.message`, or
118
+ * `ctx.update.edited_message`, or `ctx.update.channel_post`, or
119
+ * `ctx.update.edited_channel_post`.
120
+ * 2. **`ctx.api`** gives you access to the full Telegram Bot API so that you
121
+ * can directly call any method, such as responding via
122
+ * `ctx.api.sendMessage`. Also here, the context objects has some useful
123
+ * shortcuts for you. For instance, if you want to send a message to the same
124
+ * chat that a message comes from (i.e. just respond to a user) you can call
125
+ * `ctx.reply`. This is nothing but a wrapper for `ctx.api.sendMessage` with
126
+ * the right `chat_id` pre-filled for you. Almost all methods of the Telegram
127
+ * Bot API have their own shortcut directly on the context object, so you
128
+ * probably never really have to use `ctx.api` at all.
129
+ *
130
+ * This context object is then passed to all of the listeners (called
131
+ * middleware) that you register on your bot. Because this is so useful, the
132
+ * context object is often used to hold more information. One example are
133
+ * sessions (a chat-specific data storage that is stored in a database), and
134
+ * another example is `ctx.match` that is used by `bot.command` and other
135
+ * methods to keep information about how a regular expression was matched.
136
+ *
137
+ * Read up about middleware on the
138
+ * [website](https://grammy.dev/guide/context) if you want to know more
139
+ * about the powerful opportunities that lie in context objects, and about how
140
+ * grammY implements them.
141
+ */
142
+ export declare class Context implements RenamedUpdate {
143
+ /**
144
+ * The update object that is contained in the context.
145
+ */
146
+ readonly update: Update;
147
+ /**
148
+ * An API instance that allows you to call any method of the Telegram
149
+ * Bot API.
150
+ */
151
+ readonly api: Api;
152
+ /**
153
+ * Information about the bot itself.
154
+ */
155
+ readonly me: UserFromGetMe;
156
+ /**
157
+ * Used by some middleware to store information about how a certain string
158
+ * or regular expression was matched.
159
+ */
160
+ match: string | RegExpMatchArray | undefined;
161
+ constructor(
162
+ /**
163
+ * The update object that is contained in the context.
164
+ */
165
+ update: Update,
166
+ /**
167
+ * An API instance that allows you to call any method of the Telegram
168
+ * Bot API.
169
+ */
170
+ api: Api,
171
+ /**
172
+ * Information about the bot itself.
173
+ */
174
+ me: UserFromGetMe);
175
+ /** Alias for `ctx.update.message` */
176
+ get message(): (Message & Update.NonChannel) | undefined;
177
+ /** Alias for `ctx.update.edited_message` */
178
+ get editedMessage(): (Message & Update.Edited & Update.NonChannel) | undefined;
179
+ /** Alias for `ctx.update.channel_post` */
180
+ get channelPost(): (Message & Update.Channel) | undefined;
181
+ /** Alias for `ctx.update.edited_channel_post` */
182
+ get editedChannelPost(): (Message & Update.Edited & Update.Channel) | undefined;
183
+ /** Alias for `ctx.update.business_connection` */
184
+ get businessConnection(): import("@grammyjs/types/manage.js").BusinessConnection | undefined;
185
+ /** Alias for `ctx.update.business_message` */
186
+ get businessMessage(): (Message & Update.Private) | undefined;
187
+ /** Alias for `ctx.update.edited_business_message` */
188
+ get editedBusinessMessage(): (Message & Update.Edited & Update.Private) | undefined;
189
+ /** Alias for `ctx.update.deleted_business_messages` */
190
+ get deletedBusinessMessages(): import("@grammyjs/types/manage.js").BusinessMessagesDeleted | undefined;
191
+ /** Alias for `ctx.update.message_reaction` */
192
+ get messageReaction(): import("@grammyjs/types/message.js").MessageReactionUpdated | undefined;
193
+ /** Alias for `ctx.update.message_reaction_count` */
194
+ get messageReactionCount(): import("@grammyjs/types/message.js").MessageReactionCountUpdated | undefined;
195
+ /** Alias for `ctx.update.inline_query` */
196
+ get inlineQuery(): import("@grammyjs/types/inline.js").InlineQuery | undefined;
197
+ /** Alias for `ctx.update.chosen_inline_result` */
198
+ get chosenInlineResult(): import("@grammyjs/types/inline.js").ChosenInlineResult | undefined;
199
+ /** Alias for `ctx.update.callback_query` */
200
+ get callbackQuery(): import("@grammyjs/types/markup.js").CallbackQuery | undefined;
201
+ /** Alias for `ctx.update.shipping_query` */
202
+ get shippingQuery(): import("@grammyjs/types/payment.js").ShippingQuery | undefined;
203
+ /** Alias for `ctx.update.pre_checkout_query` */
204
+ get preCheckoutQuery(): import("@grammyjs/types/payment.js").PreCheckoutQuery | undefined;
205
+ /** Alias for `ctx.update.poll` */
206
+ get poll(): import("@grammyjs/types/message.js").Poll | undefined;
207
+ /** Alias for `ctx.update.poll_answer` */
208
+ get pollAnswer(): import("@grammyjs/types/message.js").PollAnswer | undefined;
209
+ /** Alias for `ctx.update.my_chat_member` */
210
+ get myChatMember(): import("@grammyjs/types/manage.js").ChatMemberUpdated | undefined;
211
+ /** Alias for `ctx.update.chat_member` */
212
+ get chatMember(): import("@grammyjs/types/manage.js").ChatMemberUpdated | undefined;
213
+ /** Alias for `ctx.update.chat_join_request` */
214
+ get chatJoinRequest(): import("@grammyjs/types/manage.js").ChatJoinRequest | undefined;
215
+ /** Alias for `ctx.update.chat_boost` */
216
+ get chatBoost(): import("@grammyjs/types/manage.js").ChatBoostUpdated | undefined;
217
+ /** Alias for `ctx.update.removed_chat_boost` */
218
+ get removedChatBoost(): import("@grammyjs/types/manage.js").ChatBoostRemoved | undefined;
219
+ /** Alias for `ctx.update.purchased_paid_media` */
220
+ get purchasedPaidMedia(): import("@grammyjs/types/payment.js").PaidMediaPurchased | undefined;
221
+ /**
222
+ * Get the message object from wherever possible. Alias for `this.message ??
223
+ * this.editedMessage ?? this.channelPost ?? this.editedChannelPost ??
224
+ * this.businessMessage ?? this.editedBusinessMessage ??
225
+ * this.callbackQuery?.message`.
226
+ */
227
+ get msg(): Message | undefined;
228
+ /**
229
+ * Get the chat object from wherever possible. Alias for `(this.msg ??
230
+ * this.deletedBusinessMessages ?? this.messageReaction ??
231
+ * this.messageReactionCount ?? this.myChatMember ?? this.chatMember ??
232
+ * this.chatJoinRequest ?? this.chatBoost ?? this.removedChatBoost)?.chat`.
233
+ */
234
+ get chat(): Chat | undefined;
235
+ /**
236
+ * Get the sender chat object from wherever possible. Alias for
237
+ * `ctx.msg?.sender_chat`.
238
+ */
239
+ get senderChat(): Chat | undefined;
240
+ /**
241
+ * Get the user object from wherever possible. Alias for
242
+ * `(this.businessConnection ?? this.messageReaction ??
243
+ * (this.chatBoost?.boost ?? this.removedChatBoost)?.source)?.user ??
244
+ * (this.callbackQuery ?? this.msg ?? this.inlineQuery ??
245
+ * this.chosenInlineResult ?? this.shippingQuery ?? this.preCheckoutQuery ??
246
+ * this.myChatMember ?? this.chatMember ?? this.chatJoinRequest ??
247
+ * this.purchasedPaidMedia)?.from`.
248
+ */
249
+ get from(): User | undefined;
250
+ /**
251
+ * Get the message identifier from wherever possible. Alias for
252
+ * `this.msg?.message_id ?? this.messageReaction?.message_id ??
253
+ * this.messageReactionCount?.message_id`.
254
+ */
255
+ get msgId(): number | undefined;
256
+ /**
257
+ * Gets the chat identifier from wherever possible. Alias for `this.chat?.id
258
+ * ?? this.businessConnection?.user_chat_id`.
259
+ */
260
+ get chatId(): number | undefined;
261
+ /**
262
+ * Get the inline message identifier from wherever possible. Alias for
263
+ * `(ctx.callbackQuery ?? ctx.chosenInlineResult)?.inline_message_id`.
264
+ */
265
+ get inlineMessageId(): string | undefined;
266
+ /**
267
+ * Get the business connection identifier from wherever possible. Alias for
268
+ * `this.msg?.business_connection_id ?? this.businessConnection?.id ??
269
+ * this.deletedBusinessMessages?.business_connection_id`.
270
+ */
271
+ get businessConnectionId(): string | undefined;
272
+ /**
273
+ * Get entities and their text. Extracts the text from `ctx.msg.text` or
274
+ * `ctx.msg.caption`. Returns an empty array if one of `ctx.msg`,
275
+ * `ctx.msg.text` or `ctx.msg.entities` is undefined.
276
+ *
277
+ * You can filter specific entity types by passing the `types` parameter.
278
+ * Example:
279
+ *
280
+ * ```ts
281
+ * ctx.entities() // Returns all entity types
282
+ * ctx.entities('url') // Returns only url entities
283
+ * ctx.enttities(['url', 'email']) // Returns url and email entities
284
+ * ```
285
+ *
286
+ * @param types Types of entities to return. Omit to get all entities.
287
+ * @returns Array of entities and their texts, or empty array when there's no text
288
+ */
289
+ entities(): Array<MessageEntity & {
290
+ /** Slice of the message text that contains this entity */
291
+ text: string;
292
+ }>;
293
+ entities<T extends MessageEntity["type"]>(types: MaybeArray<T>): Array<MessageEntity & {
294
+ type: T;
295
+ /** Slice of the message text that contains this entity */
296
+ text: string;
297
+ }>;
298
+ /**
299
+ * Find out which reactions were added and removed in a `message_reaction`
300
+ * update. This method looks at `ctx.messageReaction` and computes the
301
+ * difference between the old reaction and the new reaction. It also groups
302
+ * the reactions by emoji reactions and custom emoji reactions. For example,
303
+ * the resulting object could look like this:
304
+ * ```ts
305
+ * {
306
+ * emoji: ['👍', '🎉']
307
+ * emojiAdded: ['🎉'],
308
+ * emojiKept: ['👍'],
309
+ * emojiRemoved: [],
310
+ * customEmoji: [],
311
+ * customEmojiAdded: [],
312
+ * customEmojiKept: [],
313
+ * customEmojiRemoved: ['id0123'],
314
+ * paid: true,
315
+ * paidAdded: false,
316
+ * paidRemoved: false,
317
+ * }
318
+ * ```
319
+ * In the above example, a tada reaction was added by the user, and a custom
320
+ * emoji reaction with the custom emoji 'id0123' was removed in the same
321
+ * update. The user had already reacted with a thumbs up reaction and a paid
322
+ * star reaction, which they left both unchanged. As a result, the current
323
+ * reaction by the user is thumbs up, tada, and a paid reaction. Note that
324
+ * the current reaction (all emoji reactions regardless of type in one list)
325
+ * can also be obtained from `ctx.messageReaction.new_reaction`.
326
+ *
327
+ * Remember that reaction updates only include information about the
328
+ * reaction of a specific user. The respective message may have many more
329
+ * reactions by other people which will not be included in this update.
330
+ *
331
+ * @returns An object containing information about the reaction update
332
+ */
333
+ reactions(): {
334
+ /** Emoji currently present in this user's reaction */
335
+ emoji: ReactionTypeEmoji["emoji"][];
336
+ /** Emoji newly added to this user's reaction */
337
+ emojiAdded: ReactionTypeEmoji["emoji"][];
338
+ /** Emoji not changed by the update to this user's reaction */
339
+ emojiKept: ReactionTypeEmoji["emoji"][];
340
+ /** Emoji removed from this user's reaction */
341
+ emojiRemoved: ReactionTypeEmoji["emoji"][];
342
+ /** Custom emoji currently present in this user's reaction */
343
+ customEmoji: string[];
344
+ /** Custom emoji newly added to this user's reaction */
345
+ customEmojiAdded: string[];
346
+ /** Custom emoji not changed by the update to this user's reaction */
347
+ customEmojiKept: string[];
348
+ /** Custom emoji removed from this user's reaction */
349
+ customEmojiRemoved: string[];
350
+ /**
351
+ * `true` if a paid reaction is currently present in this user's
352
+ * reaction, and `false` otherwise
353
+ */
354
+ paid: boolean;
355
+ /**
356
+ * `true` if a paid reaction was newly added to this user's reaction,
357
+ * and `false` otherwise
358
+ */
359
+ paidAdded: boolean;
360
+ };
361
+ /**
362
+ * `Context.has` is an object that contains a number of useful functions for
363
+ * probing context objects. Each of these functions can generate a predicate
364
+ * function, to which you can pass context objects in order to check if a
365
+ * condition holds for the respective context object.
366
+ *
367
+ * For example, you can call `Context.has.filterQuery(":text")` to generate
368
+ * a predicate function that tests context objects for containing text:
369
+ * ```ts
370
+ * const hasText = Context.has.filterQuery(":text");
371
+ *
372
+ * if (hasText(ctx0)) {} // `ctx0` matches the filter query `:text`
373
+ * if (hasText(ctx1)) {} // `ctx1` matches the filter query `:text`
374
+ * if (hasText(ctx2)) {} // `ctx2` matches the filter query `:text`
375
+ * ```
376
+ * These predicate functions are used internally by the has-methods that are
377
+ * installed on every context object. This means that calling
378
+ * `ctx.has(":text")` is equivalent to
379
+ * `Context.has.filterQuery(":text")(ctx)`.
380
+ */
381
+ static has: StaticHas;
382
+ /**
383
+ * Returns `true` if this context object matches the given filter query, and
384
+ * `false` otherwise. This uses the same logic as `bot.on`.
385
+ *
386
+ * @param filter The filter query to check
387
+ */
388
+ has<Q extends FilterQuery>(filter: Q | Q[]): this is FilterCore<Q>;
389
+ /**
390
+ * Returns `true` if this context object contains the given text, or if it
391
+ * contains text that matches the given regular expression. It returns
392
+ * `false` otherwise. This uses the same logic as `bot.hears`.
393
+ *
394
+ * @param trigger The string or regex to match
395
+ */
396
+ hasText(trigger: MaybeArray<string | RegExp>): this is HearsContextCore;
397
+ /**
398
+ * Returns `true` if this context object contains the given command, and
399
+ * `false` otherwise. This uses the same logic as `bot.command`.
400
+ *
401
+ * @param command The command to match
402
+ */
403
+ hasCommand(command: MaybeArray<StringWithCommandSuggestions>): this is CommandContextCore;
404
+ hasReaction(reaction: MaybeArray<ReactionTypeEmoji["emoji"] | ReactionType>): this is ReactionContextCore;
405
+ /**
406
+ * Returns `true` if this context object belongs to a chat with the given
407
+ * chat type, and `false` otherwise. This uses the same logic as
408
+ * `bot.chatType`.
409
+ *
410
+ * @param chatType The chat type to match
411
+ */
412
+ hasChatType<T extends Chat["type"]>(chatType: MaybeArray<T>): this is ChatTypeContextCore<T>;
413
+ /**
414
+ * Returns `true` if this context object contains the given callback query,
415
+ * or if the contained callback query data matches the given regular
416
+ * expression. It returns `false` otherwise. This uses the same logic as
417
+ * `bot.callbackQuery`.
418
+ *
419
+ * @param trigger The string or regex to match
420
+ */
421
+ hasCallbackQuery(trigger: MaybeArray<string | RegExp>): this is CallbackQueryContextCore;
422
+ /**
423
+ * Returns `true` if this context object contains the given game query, or
424
+ * if the contained game query matches the given regular expression. It
425
+ * returns `false` otherwise. This uses the same logic as `bot.gameQuery`.
426
+ *
427
+ * @param trigger The string or regex to match
428
+ */
429
+ hasGameQuery(trigger: MaybeArray<string | RegExp>): this is GameQueryContextCore;
430
+ /**
431
+ * Returns `true` if this context object contains the given inline query, or
432
+ * if the contained inline query matches the given regular expression. It
433
+ * returns `false` otherwise. This uses the same logic as `bot.inlineQuery`.
434
+ *
435
+ * @param trigger The string or regex to match
436
+ */
437
+ hasInlineQuery(trigger: MaybeArray<string | RegExp>): this is InlineQueryContextCore;
438
+ /**
439
+ * Returns `true` if this context object contains the chosen inline result,
440
+ * or if the contained chosen inline result matches the given regular
441
+ * expression. It returns `false` otherwise. This uses the same logic as
442
+ * `bot.chosenInlineResult`.
443
+ *
444
+ * @param trigger The string or regex to match
445
+ */
446
+ hasChosenInlineResult(trigger: MaybeArray<string | RegExp>): this is ChosenInlineResultContextCore;
447
+ /**
448
+ * Returns `true` if this context object contains the given pre-checkout
449
+ * query, or if the contained pre-checkout query matches the given regular
450
+ * expression. It returns `false` otherwise. This uses the same logic as
451
+ * `bot.preCheckoutQuery`.
452
+ *
453
+ * @param trigger The string or regex to match
454
+ */
455
+ hasPreCheckoutQuery(trigger: MaybeArray<string | RegExp>): this is PreCheckoutQueryContextCore;
456
+ /**
457
+ * Returns `true` if this context object contains the given shipping query,
458
+ * or if the contained shipping query matches the given regular expression.
459
+ * It returns `false` otherwise. This uses the same logic as
460
+ * `bot.shippingQuery`.
461
+ *
462
+ * @param trigger The string or regex to match
463
+ */
464
+ hasShippingQuery(trigger: MaybeArray<string | RegExp>): this is ShippingQueryContextCore;
465
+ /**
466
+ * Context-aware alias for `api.sendMessage`. Use this method to send text messages. On success, the sent Message is returned.
467
+ *
468
+ * @param text Text of the message to be sent, 1-4096 characters after entities parsing
469
+ * @param other Optional remaining parameters, confer the official reference below
470
+ * @param signal Optional `AbortSignal` to cancel the request
471
+ *
472
+ * **Official reference:** https://core.telegram.org/bots/api#sendmessage
473
+ */
474
+ reply(text: string, other?: Other<"sendMessage", "chat_id" | "text">, signal?: AbortSignal): Promise<Message.TextMessage>;
475
+ /**
476
+ * Context-aware alias for `api.forwardMessage`. Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent Message is returned.
477
+ *
478
+ * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
479
+ * @param other Optional remaining parameters, confer the official reference below
480
+ * @param signal Optional `AbortSignal` to cancel the request
481
+ *
482
+ * **Official reference:** https://core.telegram.org/bots/api#forwardmessage
483
+ */
484
+ forwardMessage(chat_id: number | string, other?: Other<"forwardMessage", "chat_id" | "from_chat_id" | "message_id">, signal?: AbortSignal): Promise<Message>;
485
+ /**
486
+ * Context-aware alias for `api.forwardMessages`. Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of MessageId of the sent messages is returned.
487
+ *
488
+ * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
489
+ * @param message_ids A list of 1-100 identifiers of messages in the current chat to forward. The identifiers must be specified in a strictly increasing order.
490
+ * @param other Optional remaining parameters, confer the official reference below
491
+ * @param signal Optional `AbortSignal` to cancel the request
492
+ *
493
+ * **Official reference:** https://core.telegram.org/bots/api#forwardmessages
494
+ */
495
+ forwardMessages(chat_id: number | string, message_ids: number[], other?: Other<"forwardMessages", "chat_id" | "from_chat_id" | "message_ids">, signal?: AbortSignal): Promise<import("@grammyjs/types/message.js").MessageId[]>;
496
+ /**
497
+ * Context-aware alias for `api.copyMessage`. Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success.
498
+ *
499
+ * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
500
+ * @param other Optional remaining parameters, confer the official reference below
501
+ * @param signal Optional `AbortSignal` to cancel the request
502
+ *
503
+ * **Official reference:** https://core.telegram.org/bots/api#copymessage
504
+ */
505
+ copyMessage(chat_id: number | string, other?: Other<"copyMessage", "chat_id" | "from_chat_id" | "message_id">, signal?: AbortSignal): Promise<import("@grammyjs/types/message.js").MessageId>;
506
+ /**
507
+ * Context-aware alias for `api.copyMessages`. Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of MessageId of the sent messages is returned.
508
+ *
509
+ * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
510
+ * @param message_ids A list of 1-100 identifiers of messages in the current chat to copy. The identifiers must be specified in a strictly increasing order.
511
+ * @param other Optional remaining parameters, confer the official reference below
512
+ * @param signal Optional `AbortSignal` to cancel the request
513
+ *
514
+ * **Official reference:** https://core.telegram.org/bots/api#copymessages
515
+ */
516
+ copyMessages(chat_id: number | string, message_ids: number[], other?: Other<"copyMessages", "chat_id" | "from_chat_id" | "message_id">, signal?: AbortSignal): Promise<import("@grammyjs/types/message.js").MessageId[]>;
517
+ /**
518
+ * Context-aware alias for `api.sendPhoto`. Use this method to send photos. On success, the sent Message is returned.
519
+ *
520
+ * @param photo Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20.
521
+ * @param other Optional remaining parameters, confer the official reference below
522
+ * @param signal Optional `AbortSignal` to cancel the request
523
+ *
524
+ * **Official reference:** https://core.telegram.org/bots/api#sendphoto
525
+ */
526
+ replyWithPhoto(photo: InputFile | string, other?: Other<"sendPhoto", "chat_id" | "photo">, signal?: AbortSignal): Promise<Message.PhotoMessage>;
527
+ /**
528
+ * Context-aware alias for `api.sendAudio`. Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
529
+ *
530
+ * For sending voice messages, use the sendVoice method instead.
531
+ *
532
+ * @param audio Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data.
533
+ * @param other Optional remaining parameters, confer the official reference below
534
+ * @param signal Optional `AbortSignal` to cancel the request
535
+ *
536
+ * **Official reference:** https://core.telegram.org/bots/api#sendaudio
537
+ */
538
+ replyWithAudio(audio: InputFile | string, other?: Other<"sendAudio", "chat_id" | "audio">, signal?: AbortSignal): Promise<Message.AudioMessage>;
539
+ /**
540
+ * Context-aware alias for `api.sendDocument`. Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
541
+ *
542
+ * @param document File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data.
543
+ * @param other Optional remaining parameters, confer the official reference below
544
+ * @param signal Optional `AbortSignal` to cancel the request
545
+ *
546
+ * **Official reference:** https://core.telegram.org/bots/api#senddocument
547
+ */
548
+ replyWithDocument(document: InputFile | string, other?: Other<"sendDocument", "chat_id" | "document">, signal?: AbortSignal): Promise<Message.DocumentMessage>;
549
+ /**
550
+ * Context-aware alias for `api.sendVideo`. Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
551
+ *
552
+ * @param video Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data.
553
+ * @param other Optional remaining parameters, confer the official reference below
554
+ * @param signal Optional `AbortSignal` to cancel the request
555
+ *
556
+ * **Official reference:** https://core.telegram.org/bots/api#sendvideo
557
+ */
558
+ replyWithVideo(video: InputFile | string, other?: Other<"sendVideo", "chat_id" | "video">, signal?: AbortSignal): Promise<Message.VideoMessage>;
559
+ /**
560
+ * Context-aware alias for `api.sendAnimation`. Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
561
+ *
562
+ * @param animation Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data.
563
+ * @param other Optional remaining parameters, confer the official reference below
564
+ * @param signal Optional `AbortSignal` to cancel the request
565
+ *
566
+ * **Official reference:** https://core.telegram.org/bots/api#sendanimation
567
+ */
568
+ replyWithAnimation(animation: InputFile | string, other?: Other<"sendAnimation", "chat_id" | "animation">, signal?: AbortSignal): Promise<Message.AnimationMessage>;
569
+ /**
570
+ * Context-aware alias for `api.sendVoice`. Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
571
+ *
572
+ * @param voice Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data.
573
+ * @param other Optional remaining parameters, confer the official reference below
574
+ * @param signal Optional `AbortSignal` to cancel the request
575
+ *
576
+ * **Official reference:** https://core.telegram.org/bots/api#sendvoice
577
+ */
578
+ replyWithVoice(voice: InputFile | string, other?: Other<"sendVoice", "chat_id" | "voice">, signal?: AbortSignal): Promise<Message.VoiceMessage>;
579
+ /**
580
+ * Context-aware alias for `api.sendVideoNote`. Use this method to send video messages. On success, the sent Message is returned.
581
+ * As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long.
582
+ *
583
+ * @param video_note Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data.. Sending video notes by a URL is currently unsupported
584
+ * @param other Optional remaining parameters, confer the official reference below
585
+ * @param signal Optional `AbortSignal` to cancel the request
586
+ *
587
+ * **Official reference:** https://core.telegram.org/bots/api#sendvideonote
588
+ */
589
+ replyWithVideoNote(video_note: InputFile | string, other?: Other<"sendVideoNote", "chat_id" | "video_note">, signal?: AbortSignal): Promise<Message.VideoNoteMessage>;
590
+ /**
591
+ * Context-aware alias for `api.sendMediaGroup`. Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of Messages that were sent is returned.
592
+ *
593
+ * @param media An array describing messages to be sent, must include 2-10 items
594
+ * @param other Optional remaining parameters, confer the official reference below
595
+ * @param signal Optional `AbortSignal` to cancel the request
596
+ *
597
+ * **Official reference:** https://core.telegram.org/bots/api#sendmediagroup
598
+ */
599
+ replyWithMediaGroup(media: ReadonlyArray<InputMediaAudio | InputMediaDocument | InputMediaPhoto | InputMediaVideo>, other?: Other<"sendMediaGroup", "chat_id" | "media">, signal?: AbortSignal): Promise<(Message.PhotoMessage | Message.AudioMessage | Message.DocumentMessage | Message.VideoMessage)[]>;
600
+ /**
601
+ * Context-aware alias for `api.sendLocation`. Use this method to send point on the map. On success, the sent Message is returned.
602
+ *
603
+ * @param latitude Latitude of the location
604
+ * @param longitude Longitude of the location
605
+ * @param other Optional remaining parameters, confer the official reference below
606
+ * @param signal Optional `AbortSignal` to cancel the request
607
+ *
608
+ * **Official reference:** https://core.telegram.org/bots/api#sendlocation
609
+ */
610
+ replyWithLocation(latitude: number, longitude: number, other?: Other<"sendLocation", "chat_id" | "latitude" | "longitude">, signal?: AbortSignal): Promise<Message.LocationMessage>;
611
+ /**
612
+ * Context-aware alias for `api.editMessageLiveLocation`. Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
613
+ *
614
+ * @param latitude Latitude of new location
615
+ * @param longitude Longitude of new location
616
+ * @param other Optional remaining parameters, confer the official reference below
617
+ * @param signal Optional `AbortSignal` to cancel the request
618
+ *
619
+ * **Official reference:** https://core.telegram.org/bots/api#editmessagelivelocation
620
+ */
621
+ editMessageLiveLocation(latitude: number, longitude: number, other?: Other<"editMessageLiveLocation", "chat_id" | "message_id" | "inline_message_id" | "latitude" | "longitude">, signal?: AbortSignal): Promise<true | (Update.Edited & Message.CommonMessage & {
622
+ location: import("@grammyjs/types/message.js").Location;
623
+ })>;
624
+ /**
625
+ * Context-aware alias for `api.stopMessageLiveLocation`. Use this method to stop updating a live location message before live_period expires. On success, if the message is not an inline message, the edited Message is returned, otherwise True is returned.
626
+ *
627
+ * @param other Optional remaining parameters, confer the official reference below
628
+ * @param signal Optional `AbortSignal` to cancel the request
629
+ *
630
+ * **Official reference:** https://core.telegram.org/bots/api#stopmessagelivelocation
631
+ */
632
+ stopMessageLiveLocation(other?: Other<"stopMessageLiveLocation", "chat_id" | "message_id" | "inline_message_id">, signal?: AbortSignal): Promise<true | (Update.Edited & Message.CommonMessage & {
633
+ location: import("@grammyjs/types/message.js").Location;
634
+ })>;
635
+ /**
636
+ * Context-aware alias for `api.sendPaidMedia`. Use this method to send paid media. On success, the sent Message is returned.
637
+ *
638
+ * @param star_count The number of Telegram Stars that must be paid to buy access to the media
639
+ * @param media An array describing the media to be sent; up to 10 items
640
+ * @param other Optional remaining parameters, confer the official reference below
641
+ * @param signal Optional `AbortSignal` to cancel the request
642
+ *
643
+ * **Official reference:** https://core.telegram.org/bots/api#sendpaidmedia
644
+ */
645
+ sendPaidMedia(star_count: number, media: InputPaidMedia[], other?: Other<"sendPaidMedia", "chat_id" | "star_count" | "media">, signal?: AbortSignal): Promise<Message.PaidMediaMessage>;
646
+ /**
647
+ * Context-aware alias for `api.sendVenue`. Use this method to send information about a venue. On success, the sent Message is returned.
648
+ *
649
+ * @param latitude Latitude of the venue
650
+ * @param longitude Longitude of the venue
651
+ * @param title Name of the venue
652
+ * @param address Address of the venue
653
+ * @param other Optional remaining parameters, confer the official reference below
654
+ * @param signal Optional `AbortSignal` to cancel the request
655
+ *
656
+ * **Official reference:** https://core.telegram.org/bots/api#sendvenue
657
+ */
658
+ replyWithVenue(latitude: number, longitude: number, title: string, address: string, other?: Other<"sendVenue", "chat_id" | "latitude" | "longitude" | "title" | "address">, signal?: AbortSignal): Promise<Message.VenueMessage>;
659
+ /**
660
+ * Context-aware alias for `api.sendContact`. Use this method to send phone contacts. On success, the sent Message is returned.
661
+ *
662
+ * @param phone_number Contact's phone number
663
+ * @param first_name Contact's first name
664
+ * @param other Optional remaining parameters, confer the official reference below
665
+ * @param signal Optional `AbortSignal` to cancel the request
666
+ *
667
+ * **Official reference:** https://core.telegram.org/bots/api#sendcontact
668
+ */
669
+ replyWithContact(phone_number: string, first_name: string, other?: Other<"sendContact", "chat_id" | "phone_number" | "first_name">, signal?: AbortSignal): Promise<Message.ContactMessage>;
670
+ /**
671
+ * Context-aware alias for `api.sendPoll`. Use this method to send a native poll. On success, the sent Message is returned.
672
+ *
673
+ * @param question Poll question, 1-300 characters
674
+ * @param options A list of answer options, 2-10 strings 1-100 characters each
675
+ * @param other Optional remaining parameters, confer the official reference below
676
+ * @param signal Optional `AbortSignal` to cancel the request
677
+ *
678
+ * **Official reference:** https://core.telegram.org/bots/api#sendpoll
679
+ */
680
+ replyWithPoll(question: string, options: InputPollOption[], other?: Other<"sendPoll", "chat_id" | "question" | "options">, signal?: AbortSignal): Promise<Message.PollMessage>;
681
+ /**
682
+ * Context-aware alias for `api.sendDice`. Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.
683
+ *
684
+ * @param emoji Emoji on which the dice throw animation is based. Currently, must be one of “🎲”, “🎯”, “🏀”, “⚽”, “🎳”, or “🎰”. Dice can have values 1-6 for “🎲”, “🎯” and “🎳”, values 1-5 for “🏀” and “⚽”, and values 1-64 for “🎰”. Defaults to “🎲”
685
+ * @param other Optional remaining parameters, confer the official reference below
686
+ * @param signal Optional `AbortSignal` to cancel the request
687
+ *
688
+ * **Official reference:** https://core.telegram.org/bots/api#senddice
689
+ */
690
+ replyWithDice(emoji: (string & Record<never, never>) | "🎲" | "🎯" | "🏀" | "⚽" | "🎳" | "🎰", other?: Other<"sendDice", "chat_id" | "emoji">, signal?: AbortSignal): Promise<Message.DiceMessage>;
691
+ /**
692
+ * Context-aware alias for `api.sendChatAction`. Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success.
693
+ *
694
+ * Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use sendChatAction with action = upload_photo. The user will see a “sending photo” status for the bot.
695
+ *
696
+ * We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.
697
+ *
698
+ * @param action Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes.
699
+ * @param other Optional remaining parameters, confer the official reference below
700
+ * @param signal Optional `AbortSignal` to cancel the request
701
+ *
702
+ * **Official reference:** https://core.telegram.org/bots/api#sendchataction
703
+ */
704
+ replyWithChatAction(action: "typing" | "upload_photo" | "record_video" | "upload_video" | "record_voice" | "upload_voice" | "upload_document" | "choose_sticker" | "find_location" | "record_video_note" | "upload_video_note", other?: Other<"sendChatAction", "chat_id" | "action">, signal?: AbortSignal): Promise<true>;
705
+ /**
706
+ * Context-aware alias for `api.setMessageReaction`. Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success.
707
+ *
708
+ * @param reaction A list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. Paid reactions can't be used by bots.
709
+ * @param other Optional remaining parameters, confer the official reference below
710
+ * @param signal Optional `AbortSignal` to cancel the request
711
+ *
712
+ * **Official reference:** https://core.telegram.org/bots/api#setmessagereaction
713
+ */
714
+ react(reaction: MaybeArray<ReactionTypeEmoji["emoji"] | ReactionType>, other?: Other<"setMessageReaction", "chat_id" | "message_id" | "reaction">, signal?: AbortSignal): Promise<true>;
715
+ /**
716
+ * Context-aware alias for `api.getUserProfilePhotos`. Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.
717
+ *
718
+ * @param user_id Unique identifier of the target user
719
+ * @param other Optional remaining parameters, confer the official reference below
720
+ * @param signal Optional `AbortSignal` to cancel the request
721
+ *
722
+ * **Official reference:** https://core.telegram.org/bots/api#getuserprofilephotos
723
+ */
724
+ getUserProfilePhotos(other?: Other<"getUserProfilePhotos", "user_id">, signal?: AbortSignal): Promise<import("@grammyjs/types/manage.js").UserProfilePhotos>;
725
+ /**
726
+ * Contex-aware alias for `api.serUserEmojiStatus`. Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method requestEmojiStatusAccess. Returns True on success.
727
+ *
728
+ * @param other Optional remaining parameters, confer the official reference below
729
+ * @param signal Optional `AbortSignal` to cancel the request
730
+ *
731
+ * **Official reference:** https://core.telegram.org/bots/api#setuseremojistatus
732
+ */
733
+ setUserEmojiStatus(other?: Other<"setUserEmojiStatus", "user_id">, signal?: AbortSignal): Promise<true>;
734
+ /**
735
+ * Context-aware alias for `api.getUserChatBoosts`. Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a UserChatBoosts object.
736
+ *
737
+ * @param chat_id Unique identifier for the chat or username of the channel (in the format @channelusername)
738
+ * @param signal Optional `AbortSignal` to cancel the request
739
+ *
740
+ * **Official reference:** https://core.telegram.org/bots/api#getuserchatboosts
741
+ */
742
+ getUserChatBoosts(chat_id: number | string, signal?: AbortSignal): Promise<import("@grammyjs/types/manage.js").UserChatBoosts>;
743
+ /**
744
+ * Context-aware alias for `api.getBusinessConnection`. Use this method to get information about the connection of the bot with a business account. Returns a BusinessConnection object on success.
745
+ * @param signal Optional `AbortSignal` to cancel the request
746
+ *
747
+ * **Official reference:** https://core.telegram.org/bots/api#getbusinessconnection
748
+ */
749
+ getBusinessConnection(signal?: AbortSignal): Promise<import("@grammyjs/types/manage.js").BusinessConnection>;
750
+ /**
751
+ * Context-aware alias for `api.getFile`. Use this method to get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a File object is returned. The file can then be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>, where <file_path> is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile again.
752
+ *
753
+ * Note: This function may not preserve the original file name and MIME type. You should save the file's MIME type and name (if available) when the File object is received.
754
+ *
755
+ * @param signal Optional `AbortSignal` to cancel the request
756
+ *
757
+ * **Official reference:** https://core.telegram.org/bots/api#getfile
758
+ */
759
+ getFile(signal?: AbortSignal): Promise<import("@grammyjs/types/message.js").File>;
760
+ /** @deprecated Use `banAuthor` instead. */
761
+ kickAuthor(...args: Parameters<Context["banAuthor"]>): Promise<true>;
762
+ /**
763
+ * Context-aware alias for `api.banChatMember`. Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
764
+ *
765
+ * @param other Optional remaining parameters, confer the official reference below
766
+ * @param signal Optional `AbortSignal` to cancel the request
767
+ *
768
+ * **Official reference:** https://core.telegram.org/bots/api#banchatmember
769
+ */
770
+ banAuthor(other?: Other<"banChatMember", "chat_id" | "user_id">, signal?: AbortSignal): Promise<true>;
771
+ /** @deprecated Use `banChatMember` instead. */
772
+ kickChatMember(...args: Parameters<Context["banChatMember"]>): Promise<true>;
773
+ /**
774
+ * Context-aware alias for `api.banChatMember`. Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
775
+ *
776
+ * @param user_id Unique identifier of the target user
777
+ * @param other Optional remaining parameters, confer the official reference below
778
+ * @param signal Optional `AbortSignal` to cancel the request
779
+ *
780
+ * **Official reference:** https://core.telegram.org/bots/api#banchatmember
781
+ */
782
+ banChatMember(user_id: number, other?: Other<"banChatMember", "chat_id" | "user_id">, signal?: AbortSignal): Promise<true>;
783
+ /**
784
+ * Context-aware alias for `api.unbanChatMember`. Use this method to unban a previously banned user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat. If you don't want this, use the parameter only_if_banned. Returns True on success.
785
+ *
786
+ * @param user_id Unique identifier of the target user
787
+ * @param other Optional remaining parameters, confer the official reference below
788
+ * @param signal Optional `AbortSignal` to cancel the request
789
+ *
790
+ * **Official reference:** https://core.telegram.org/bots/api#unbanchatmember
791
+ */
792
+ unbanChatMember(user_id: number, other?: Other<"unbanChatMember", "chat_id" | "user_id">, signal?: AbortSignal): Promise<true>;
793
+ /**
794
+ * Context-aware alias for `api.restrictChatMember`. Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictions from a user. Returns True on success.
795
+ *
796
+ * @param permissions An object for new user permissions
797
+ * @param other Optional remaining parameters, confer the official reference below
798
+ * @param signal Optional `AbortSignal` to cancel the request
799
+ *
800
+ * **Official reference:** https://core.telegram.org/bots/api#restrictchatmember
801
+ */
802
+ restrictAuthor(permissions: ChatPermissions, other?: Other<"restrictChatMember", "chat_id" | "user_id" | "permissions">, signal?: AbortSignal): Promise<true>;
803
+ /**
804
+ * Context-aware alias for `api.restrictChatMember`. Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictions from a user. Returns True on success.
805
+ *
806
+ * @param user_id Unique identifier of the target user
807
+ * @param permissions An object for new user permissions
808
+ * @param other Optional remaining parameters, confer the official reference below
809
+ * @param signal Optional `AbortSignal` to cancel the request
810
+ *
811
+ * **Official reference:** https://core.telegram.org/bots/api#restrictchatmember
812
+ */
813
+ restrictChatMember(user_id: number, permissions: ChatPermissions, other?: Other<"restrictChatMember", "chat_id" | "user_id" | "permissions">, signal?: AbortSignal): Promise<true>;
814
+ /**
815
+ * Context-aware alias for `api.promoteChatMember`. Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass False for all boolean parameters to demote a user. Returns True on success.
816
+ *
817
+ * @param other Optional remaining parameters, confer the official reference below
818
+ * @param signal Optional `AbortSignal` to cancel the request
819
+ *
820
+ * **Official reference:** https://core.telegram.org/bots/api#promotechatmember
821
+ */
822
+ promoteAuthor(other?: Other<"promoteChatMember", "chat_id" | "user_id">, signal?: AbortSignal): Promise<true>;
823
+ /**
824
+ * Context-aware alias for `api.promoteChatMember`. Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass False for all boolean parameters to demote a user. Returns True on success.
825
+ *
826
+ * @param user_id Unique identifier of the target user
827
+ * @param other Optional remaining parameters, confer the official reference below
828
+ * @param signal Optional `AbortSignal` to cancel the request
829
+ *
830
+ * **Official reference:** https://core.telegram.org/bots/api#promotechatmember
831
+ */
832
+ promoteChatMember(user_id: number, other?: Other<"promoteChatMember", "chat_id" | "user_id">, signal?: AbortSignal): Promise<true>;
833
+ /**
834
+ * Context-aware alias for `api.setChatAdministratorCustomTitle`. Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.
835
+ *
836
+ * @param custom_title New custom title for the administrator; 0-16 characters, emoji are not allowed
837
+ * @param signal Optional `AbortSignal` to cancel the request
838
+ *
839
+ * **Official reference:** https://core.telegram.org/bots/api#setchatadministratorcustomtitle
840
+ */
841
+ setChatAdministratorAuthorCustomTitle(custom_title: string, signal?: AbortSignal): Promise<true>;
842
+ /**
843
+ * Context-aware alias for `api.setChatAdministratorCustomTitle`. Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.
844
+ *
845
+ * @param user_id Unique identifier of the target user
846
+ * @param custom_title New custom title for the administrator; 0-16 characters, emoji are not allowed
847
+ * @param signal Optional `AbortSignal` to cancel the request
848
+ *
849
+ * **Official reference:** https://core.telegram.org/bots/api#setchatadministratorcustomtitle
850
+ */
851
+ setChatAdministratorCustomTitle(user_id: number, custom_title: string, signal?: AbortSignal): Promise<true>;
852
+ /**
853
+ * Context-aware alias for `api.banChatSenderChat`. Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won't be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on success.
854
+ *
855
+ * @param sender_chat_id Unique identifier of the target sender chat
856
+ * @param signal Optional `AbortSignal` to cancel the request
857
+ *
858
+ * **Official reference:** https://core.telegram.org/bots/api#banchatsenderchat
859
+ */
860
+ banChatSenderChat(sender_chat_id: number, signal?: AbortSignal): Promise<true>;
861
+ /**
862
+ * Context-aware alias for `api.unbanChatSenderChat`. Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns True on success.
863
+ *
864
+ * @param sender_chat_id Unique identifier of the target sender chat
865
+ * @param signal Optional `AbortSignal` to cancel the request
866
+ *
867
+ * **Official reference:** https://core.telegram.org/bots/api#unbanchatsenderchat
868
+ */
869
+ unbanChatSenderChat(sender_chat_id: number, signal?: AbortSignal): Promise<true>;
870
+ /**
871
+ * Context-aware alias for `api.setChatPermissions`. Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success.
872
+ *
873
+ * @param permissions New default chat permissions
874
+ * @param other Optional remaining parameters, confer the official reference below
875
+ * @param signal Optional `AbortSignal` to cancel the request
876
+ *
877
+ * **Official reference:** https://core.telegram.org/bots/api#setchatpermissions
878
+ */
879
+ setChatPermissions(permissions: ChatPermissions, other?: Other<"setChatPermissions", "chat_id" | "permissions">, signal?: AbortSignal): Promise<true>;
880
+ /**
881
+ * Context-aware alias for `api.exportChatInviteLink`. Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as String on success.
882
+ *
883
+ * Note: Each administrator in a chat generates their own invite links. Bots can't use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using exportChatInviteLink or by calling the getChat method. If your bot needs to generate a new primary invite link replacing its previous one, use exportChatInviteLink again.
884
+ *
885
+ * @param signal Optional `AbortSignal` to cancel the request
886
+ *
887
+ * **Official reference:** https://core.telegram.org/bots/api#exportchatinvitelink
888
+ */
889
+ exportChatInviteLink(signal?: AbortSignal): Promise<string>;
890
+ /**
891
+ * Context-aware alias for `api.createChatInviteLink`. Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method revokeChatInviteLink. Returns the new invite link as ChatInviteLink object.
892
+ *
893
+ * @param other Optional remaining parameters, confer the official reference below
894
+ * @param signal Optional `AbortSignal` to cancel the request
895
+ *
896
+ * **Official reference:** https://core.telegram.org/bots/api#createchatinvitelink
897
+ */
898
+ createChatInviteLink(other?: Other<"createChatInviteLink", "chat_id">, signal?: AbortSignal): Promise<import("@grammyjs/types/manage.js").ChatInviteLink>;
899
+ /**
900
+ * Context-aware alias for `api.editChatInviteLink`. Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a ChatInviteLink object.
901
+ *
902
+ * @param invite_link The invite link to edit
903
+ * @param other Optional remaining parameters, confer the official reference below
904
+ * @param signal Optional `AbortSignal` to cancel the request
905
+ *
906
+ * **Official reference:** https://core.telegram.org/bots/api#editchatinvitelink
907
+ */
908
+ editChatInviteLink(invite_link: string, other?: Other<"editChatInviteLink", "chat_id" | "invite_link">, signal?: AbortSignal): Promise<import("@grammyjs/types/manage.js").ChatInviteLink>;
909
+ /**
910
+ * Context-aware alias for `api.createChatSubscriptionInviteLink`. Use this method to create a subscription invite link for a channel chat. The bot must have the can_invite_users administrator rights. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object.
911
+ *
912
+ * @param subscription_period The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days).
913
+ * @param subscription_price The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500
914
+ * @param other Optional remaining parameters, confer the official reference below
915
+ * @param signal Optional `AbortSignal` to cancel the request
916
+ *
917
+ * **Official reference:** https://core.telegram.org/bots/api#createchatsubscriptioninvitelink
918
+ */
919
+ createChatSubscriptionInviteLink(subscription_period: number, subscription_price: number, other?: Other<"createChatSubscriptionInviteLink", "chat_id" | "subscription_period" | "subscription_price">, signal?: AbortSignal): Promise<import("@grammyjs/types/manage.js").ChatInviteLink>;
920
+ /**
921
+ * Context-aware alias for `api.editChatSubscriptionInviteLink`. Use this method to edit a subscription invite link created by the bot. The bot must have the can_invite_users administrator rights. Returns the edited invite link as a ChatInviteLink object.
922
+ *
923
+ * @param invite_link The invite link to edit
924
+ * @param other Optional remaining parameters, confer the official reference below
925
+ * @param signal Optional `AbortSignal` to cancel the request
926
+ *
927
+ * **Official reference:** https://core.telegram.org/bots/api#editchatsubscriptioninvitelink
928
+ */
929
+ editChatSubscriptionInviteLink(invite_link: string, other?: Other<"editChatSubscriptionInviteLink", "chat_id" | "invite_link">, signal?: AbortSignal): Promise<import("@grammyjs/types/manage.js").ChatInviteLink>;
930
+ /**
931
+ * Context-aware alias for `api.revokeChatInviteLink`. Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as ChatInviteLink object.
932
+ *
933
+ * @param invite_link The invite link to revoke
934
+ * @param signal Optional `AbortSignal` to cancel the request
935
+ *
936
+ * **Official reference:** https://core.telegram.org/bots/api#revokechatinvitelink
937
+ */
938
+ revokeChatInviteLink(invite_link: string, signal?: AbortSignal): Promise<import("@grammyjs/types/manage.js").ChatInviteLink>;
939
+ /**
940
+ * Context-aware alias for `api.approveChatJoinRequest`. Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success.
941
+ *
942
+ * @param user_id Unique identifier of the target user
943
+ * @param signal Optional `AbortSignal` to cancel the request
944
+ *
945
+ * **Official reference:** https://core.telegram.org/bots/api#approvechatjoinrequest
946
+ */
947
+ approveChatJoinRequest(user_id: number, signal?: AbortSignal): Promise<true>;
948
+ /**
949
+ * Context-aware alias for `api.declineChatJoinRequest`. Use this method to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success.
950
+ *
951
+ * @param user_id Unique identifier of the target user
952
+ * @param signal Optional `AbortSignal` to cancel the request
953
+ *
954
+ * **Official reference:** https://core.telegram.org/bots/api#declinechatjoinrequest
955
+ */
956
+ declineChatJoinRequest(user_id: number, signal?: AbortSignal): Promise<true>;
957
+ /**
958
+ * Context-aware alias for `api.setChatPhoto`. Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
959
+ *
960
+ * @param photo New chat photo, uploaded using multipart/form-data
961
+ * @param signal Optional `AbortSignal` to cancel the request
962
+ *
963
+ * **Official reference:** https://core.telegram.org/bots/api#setchatphoto
964
+ */
965
+ setChatPhoto(photo: InputFile, signal?: AbortSignal): Promise<true>;
966
+ /**
967
+ * Context-aware alias for `api.deleteChatPhoto`. Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
968
+ *
969
+ * @param signal Optional `AbortSignal` to cancel the request
970
+ *
971
+ * **Official reference:** https://core.telegram.org/bots/api#deletechatphoto
972
+ */
973
+ deleteChatPhoto(signal?: AbortSignal): Promise<true>;
974
+ /**
975
+ * Context-aware alias for `api.setChatTitle`. Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
976
+ *
977
+ * @param title New chat title, 1-255 characters
978
+ * @param signal Optional `AbortSignal` to cancel the request
979
+ *
980
+ * **Official reference:** https://core.telegram.org/bots/api#setchattitle
981
+ */
982
+ setChatTitle(title: string, signal?: AbortSignal): Promise<true>;
983
+ /**
984
+ * Context-aware alias for `api.setChatDescription`. Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
985
+ *
986
+ * @param description New chat description, 0-255 characters
987
+ * @param signal Optional `AbortSignal` to cancel the request
988
+ *
989
+ * **Official reference:** https://core.telegram.org/bots/api#setchatdescription
990
+ */
991
+ setChatDescription(description: string | undefined, signal?: AbortSignal): Promise<true>;
992
+ /**
993
+ * Context-aware alias for `api.pinChatMessage`. Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
994
+ *
995
+ * @param message_id Identifier of a message to pin
996
+ * @param other Optional remaining parameters, confer the official reference below
997
+ * @param signal Optional `AbortSignal` to cancel the request
998
+ *
999
+ * **Official reference:** https://core.telegram.org/bots/api#pinchatmessage
1000
+ */
1001
+ pinChatMessage(message_id: number, other?: Other<"pinChatMessage", "chat_id" | "message_id">, signal?: AbortSignal): Promise<true>;
1002
+ /**
1003
+ * Context-aware alias for `api.unpinChatMessage`. Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
1004
+ *
1005
+ * @param message_id Identifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned.
1006
+ * @param signal Optional `AbortSignal` to cancel the request
1007
+ *
1008
+ * **Official reference:** https://core.telegram.org/bots/api#unpinchatmessage
1009
+ */
1010
+ unpinChatMessage(message_id?: number, other?: Other<"unpinChatMessage", "chat_id" | "message_id">, signal?: AbortSignal): Promise<true>;
1011
+ /**
1012
+ * Context-aware alias for `api.unpinAllChatMessages`. Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
1013
+ *
1014
+ * @param signal Optional `AbortSignal` to cancel the request
1015
+ *
1016
+ * **Official reference:** https://core.telegram.org/bots/api#unpinallchatmessages
1017
+ */
1018
+ unpinAllChatMessages(signal?: AbortSignal): Promise<true>;
1019
+ /**
1020
+ * Context-aware alias for `api.leaveChat`. Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
1021
+ *
1022
+ * @param signal Optional `AbortSignal` to cancel the request
1023
+ *
1024
+ * **Official reference:** https://core.telegram.org/bots/api#leavechat
1025
+ */
1026
+ leaveChat(signal?: AbortSignal): Promise<true>;
1027
+ /**
1028
+ * Context-aware alias for `api.getChat`. Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.
1029
+ *
1030
+ * @param signal Optional `AbortSignal` to cancel the request
1031
+ *
1032
+ * **Official reference:** https://core.telegram.org/bots/api#getchat
1033
+ */
1034
+ getChat(signal?: AbortSignal): Promise<import("@grammyjs/types/manage.js").ChatFullInfo>;
1035
+ /**
1036
+ * Context-aware alias for `api.getChatAdministrators`. Use this method to get a list of administrators in a chat, which aren't bots. Returns an Array of ChatMember objects.
1037
+ *
1038
+ * @param signal Optional `AbortSignal` to cancel the request
1039
+ *
1040
+ * **Official reference:** https://core.telegram.org/bots/api#getchatadministrators
1041
+ */
1042
+ getChatAdministrators(signal?: AbortSignal): Promise<(import("@grammyjs/types/manage.js").ChatMemberOwner | import("@grammyjs/types/manage.js").ChatMemberAdministrator)[]>;
1043
+ /** @deprecated Use `getChatMembersCount` instead. */
1044
+ getChatMembersCount(...args: Parameters<Context["getChatMemberCount"]>): Promise<number>;
1045
+ /**
1046
+ * Context-aware alias for `api.getChatMemberCount`. Use this method to get the number of members in a chat. Returns Int on success.
1047
+ *
1048
+ * @param signal Optional `AbortSignal` to cancel the request
1049
+ *
1050
+ * **Official reference:** https://core.telegram.org/bots/api#getchatmembercount
1051
+ */
1052
+ getChatMemberCount(signal?: AbortSignal): Promise<number>;
1053
+ /**
1054
+ * Context-aware alias for `api.getChatMember`. Use this method to get information about a member of a chat. The method is guaranteed to work only if the bot is an administrator in the chat. Returns a ChatMember object on success.
1055
+ *
1056
+ * @param signal Optional `AbortSignal` to cancel the request
1057
+ *
1058
+ * **Official reference:** https://core.telegram.org/bots/api#getchatmember
1059
+ */
1060
+ getAuthor(signal?: AbortSignal): Promise<import("@grammyjs/types/manage.js").ChatMember>;
1061
+ /**
1062
+ * Context-aware alias for `api.getChatMember`. Use this method to get information about a member of a chat. The method is guaranteed to work only if the bot is an administrator in the chat. Returns a ChatMember object on success.
1063
+ *
1064
+ * @param user_id Unique identifier of the target user
1065
+ * @param signal Optional `AbortSignal` to cancel the request
1066
+ *
1067
+ * **Official reference:** https://core.telegram.org/bots/api#getchatmember
1068
+ */
1069
+ getChatMember(user_id: number, signal?: AbortSignal): Promise<import("@grammyjs/types/manage.js").ChatMember>;
1070
+ /**
1071
+ * Context-aware alias for `api.setChatStickerSet`. Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set ly returned in getChat requests to check if the bot can use this method. Returns True on success.
1072
+ *
1073
+ * @param sticker_set_name Name of the sticker set to be set as the group sticker set
1074
+ * @param signal Optional `AbortSignal` to cancel the request
1075
+ *
1076
+ * **Official reference:** https://core.telegram.org/bots/api#setchatstickerset
1077
+ */
1078
+ setChatStickerSet(sticker_set_name: string, signal?: AbortSignal): Promise<true>;
1079
+ /**
1080
+ * Context-aware alias for `api.deleteChatStickerSet`. Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set ly returned in getChat requests to check if the bot can use this method. Returns True on success.
1081
+ *
1082
+ * @param signal Optional `AbortSignal` to cancel the request
1083
+ *
1084
+ * **Official reference:** https://core.telegram.org/bots/api#deletechatstickerset
1085
+ */
1086
+ deleteChatStickerSet(signal?: AbortSignal): Promise<true>;
1087
+ /**
1088
+ * Context-aware alias for `api.createForumTopic`. Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns information about the created topic as a ForumTopic object.
1089
+ *
1090
+ * @param name Topic name, 1-128 characters
1091
+ * @param other Optional remaining parameters, confer the official reference below
1092
+ * @param signal Optional `AbortSignal` to cancel the request
1093
+ *
1094
+ * **Official reference:** https://core.telegram.org/bots/api#createforumtopic
1095
+ */
1096
+ createForumTopic(name: string, other?: Other<"createForumTopic", "chat_id" | "name">, signal?: AbortSignal): Promise<import("@grammyjs/types/manage.js").ForumTopic>;
1097
+ /**
1098
+ * Context-aware alias for `api.editForumTopic`. Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
1099
+ *
1100
+ * @param other Optional remaining parameters, confer the official reference below
1101
+ * @param signal Optional `AbortSignal` to cancel the request
1102
+ *
1103
+ * **Official reference:** https://core.telegram.org/bots/api#editforumtopic
1104
+ */
1105
+ editForumTopic(other?: Other<"editForumTopic", "chat_id" | "message_thread_id">, signal?: AbortSignal): Promise<true>;
1106
+ /**
1107
+ * Context-aware alias for `api.closeForumTopic`. Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
1108
+ *
1109
+ * @param signal Optional `AbortSignal` to cancel the request
1110
+ *
1111
+ * **Official reference:** https://core.telegram.org/bots/api#closeforumtopic
1112
+ */
1113
+ closeForumTopic(signal?: AbortSignal): Promise<true>;
1114
+ /**
1115
+ * Context-aware alias for `api.reopenForumTopic`. Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
1116
+ *
1117
+ * @param signal Optional `AbortSignal` to cancel the request
1118
+ *
1119
+ * **Official reference:** https://core.telegram.org/bots/api#reopenforumtopic
1120
+ */
1121
+ reopenForumTopic(signal?: AbortSignal): Promise<true>;
1122
+ /**
1123
+ * Context-aware alias for `api.deleteForumTopic`. Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success.
1124
+ *
1125
+ * @param signal Optional `AbortSignal` to cancel the request
1126
+ *
1127
+ * **Official reference:** https://core.telegram.org/bots/api#deleteforumtopic
1128
+ */
1129
+ deleteForumTopic(signal?: AbortSignal): Promise<true>;
1130
+ /**
1131
+ * Context-aware alias for `api.unpinAllForumTopicMessages`. Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.
1132
+ *
1133
+ * @param signal Optional `AbortSignal` to cancel the request
1134
+ *
1135
+ * **Official reference:** https://core.telegram.org/bots/api#unpinallforumtopicmessages
1136
+ */
1137
+ unpinAllForumTopicMessages(signal?: AbortSignal): Promise<true>;
1138
+ /**
1139
+ * Context-aware alias for `api.editGeneralForumTopic`. Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
1140
+ *
1141
+ * @param name New topic name, 1-128 characters
1142
+ * @param signal Optional `AbortSignal` to cancel the request
1143
+ *
1144
+ * **Official reference:** https://core.telegram.org/bots/api#editgeneralforumtopic
1145
+ */
1146
+ editGeneralForumTopic(name: string, signal?: AbortSignal): Promise<true>;
1147
+ /**
1148
+ * Context-aware alias for `api.closeGeneralForumTopic`. Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
1149
+ *
1150
+ * @param signal Optional `AbortSignal` to cancel the request
1151
+ *
1152
+ * **Official reference:** https://core.telegram.org/bots/api#closegeneralforumtopic
1153
+ */
1154
+ closeGeneralForumTopic(signal?: AbortSignal): Promise<true>;
1155
+ /**
1156
+ * Context-aware alias for `api.reopenGeneralForumTopic`. Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically unhidden if it was hidden. Returns True on success. *
1157
+ *
1158
+ * @param signal Optional `AbortSignal` to cancel the request
1159
+ *
1160
+ * **Official reference:** https://core.telegram.org/bots/api#reopengeneralforumtopic
1161
+ */
1162
+ reopenGeneralForumTopic(signal?: AbortSignal): Promise<true>;
1163
+ /**
1164
+ * Context-aware alias for `api.hideGeneralForumTopic`. Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically closed if it was open. Returns True on success.
1165
+ *
1166
+ * @param signal Optional `AbortSignal` to cancel the request
1167
+ *
1168
+ * **Official reference:** https://core.telegram.org/bots/api#hidegeneralforumtopic
1169
+ */
1170
+ hideGeneralForumTopic(signal?: AbortSignal): Promise<true>;
1171
+ /**
1172
+ * Context-aware alias for `api.unhideGeneralForumTopic`. Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
1173
+ *
1174
+ * @param signal Optional `AbortSignal` to cancel the request
1175
+ *
1176
+ * **Official reference:** https://core.telegram.org/bots/api#unhidegeneralforumtopic
1177
+ */
1178
+ unhideGeneralForumTopic(signal?: AbortSignal): Promise<true>;
1179
+ /**
1180
+ * Context-aware alias for `api.unpinAllGeneralForumTopicMessages`. Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.
1181
+ *
1182
+ * @param signal Optional `AbortSignal` to cancel the request
1183
+ *
1184
+ * **Official reference:** https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages
1185
+ */
1186
+ unpinAllGeneralForumTopicMessages(signal?: AbortSignal): Promise<true>;
1187
+ /**
1188
+ * Context-aware alias for `api.answerCallbackQuery`. Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.
1189
+ *
1190
+ * Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via @BotFather and accept the terms. Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.
1191
+ *
1192
+ * @param other Optional remaining parameters, confer the official reference below
1193
+ * @param signal Optional `AbortSignal` to cancel the request
1194
+ *
1195
+ * **Official reference:** https://core.telegram.org/bots/api#answercallbackquery
1196
+ */
1197
+ answerCallbackQuery(other?: string | Other<"answerCallbackQuery", "callback_query_id">, signal?: AbortSignal): Promise<true>;
1198
+ /**
1199
+ * Context-aware alias for `api.setChatMenuButton`. Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success.
1200
+ *
1201
+ * @param other Optional remaining parameters, confer the official reference below
1202
+ * @param signal Optional `AbortSignal` to cancel the request
1203
+ *
1204
+ * **Official reference:** https://core.telegram.org/bots/api#setchatmenubutton
1205
+ */
1206
+ setChatMenuButton(other?: Other<"setChatMenuButton">, signal?: AbortSignal): Promise<true>;
1207
+ /**
1208
+ * Context-aware alias for `api.getChatMenuButton`. Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns MenuButton on success.
1209
+ *
1210
+ * @param other Optional remaining parameters, confer the official reference below
1211
+ * @param signal Optional `AbortSignal` to cancel the request
1212
+ *
1213
+ * **Official reference:** https://core.telegram.org/bots/api#getchatmenubutton
1214
+ */
1215
+ getChatMenuButton(other?: Other<"getChatMenuButton">, signal?: AbortSignal): Promise<import("@grammyjs/types/settings.js").MenuButton>;
1216
+ /**
1217
+ * Context-aware alias for `api.setMyDefaultAdministratorRights`. Use this method to the change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are are free to modify the list before adding the bot. Returns True on success.
1218
+ *
1219
+ * @param other Optional remaining parameters, confer the official reference below
1220
+ * @param signal Optional `AbortSignal` to cancel the request
1221
+ *
1222
+ * **Official reference:** https://core.telegram.org/bots/api#setmydefaultadministratorrights
1223
+ */
1224
+ setMyDefaultAdministratorRights(other?: Other<"setMyDefaultAdministratorRights">, signal?: AbortSignal): Promise<true>;
1225
+ /**
1226
+ * Context-aware alias for `api.getMyDefaultAdministratorRights`. Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.
1227
+ *
1228
+ * @param other Optional remaining parameters, confer the official reference below
1229
+ * @param signal Optional `AbortSignal` to cancel the request
1230
+ */
1231
+ getMyDefaultAdministratorRights(other?: Other<"getMyDefaultAdministratorRights">, signal?: AbortSignal): Promise<import("@grammyjs/types/manage.js").ChatAdministratorRights>;
1232
+ /**
1233
+ * Context-aware alias for `api.editMessageText`. Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1234
+ *
1235
+ * @param text New text of the message, 1-4096 characters after entities parsing
1236
+ * @param other Optional remaining parameters, confer the official reference below
1237
+ * @param signal Optional `AbortSignal` to cancel the request
1238
+ *
1239
+ * **Official reference:** https://core.telegram.org/bots/api#editmessagetext
1240
+ */
1241
+ editMessageText(text: string, other?: Other<"editMessageText", "chat_id" | "message_id" | "inline_message_id" | "text">, signal?: AbortSignal): Promise<true | (Update.Edited & Message.CommonMessage & {
1242
+ text: string;
1243
+ })>;
1244
+ /**
1245
+ * Context-aware alias for `api.editMessageCaption`. Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1246
+ *
1247
+ * @param other Optional remaining parameters, confer the official reference below
1248
+ * @param signal Optional `AbortSignal` to cancel the request
1249
+ *
1250
+ * **Official reference:** https://core.telegram.org/bots/api#editmessagecaption
1251
+ */
1252
+ editMessageCaption(other?: Other<"editMessageCaption", "chat_id" | "message_id" | "inline_message_id">, signal?: AbortSignal): Promise<true | (Update.Edited & Message.CaptionableMessage)>;
1253
+ /**
1254
+ * Context-aware alias for `api.editMessageMedia`. Use this method to edit animation, audio, document, photo, or video messages, or to add media to text messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1255
+ *
1256
+ * @param media An object for a new media content of the message
1257
+ * @param other Optional remaining parameters, confer the official reference below
1258
+ * @param signal Optional `AbortSignal` to cancel the request
1259
+ *
1260
+ * **Official reference:** https://core.telegram.org/bots/api#editmessagemedia
1261
+ */
1262
+ editMessageMedia(media: InputMedia, other?: Other<"editMessageMedia", "chat_id" | "message_id" | "inline_message_id" | "media">, signal?: AbortSignal): Promise<true | (Update.Edited & Message)>;
1263
+ /**
1264
+ * Context-aware alias for `api.editMessageReplyMarkup`. Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1265
+ *
1266
+ * @param other Optional remaining parameters, confer the official reference below
1267
+ * @param signal Optional `AbortSignal` to cancel the request
1268
+ *
1269
+ * **Official reference:** https://core.telegram.org/bots/api#editmessagereplymarkup
1270
+ */
1271
+ editMessageReplyMarkup(other?: Other<"editMessageReplyMarkup", "chat_id" | "message_id" | "inline_message_id">, signal?: AbortSignal): Promise<true | (Update.Edited & Message)>;
1272
+ /**
1273
+ * Context-aware alias for `api.stopPoll`. Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.
1274
+ *
1275
+ * @param other Optional remaining parameters, confer the official reference below
1276
+ * @param signal Optional `AbortSignal` to cancel the request
1277
+ *
1278
+ * **Official reference:** https://core.telegram.org/bots/api#stoppoll
1279
+ */
1280
+ stopPoll(other?: Other<"stopPoll", "chat_id" | "message_id">, signal?: AbortSignal): Promise<import("@grammyjs/types/message.js").Poll>;
1281
+ /**
1282
+ * Context-aware alias for `api.deleteMessage`. Use this method to delete a message, including service messages, with the following limitations:
1283
+ * - A message can only be deleted if it was sent less than 48 hours ago.
1284
+ * - A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.
1285
+ * - Bots can delete outgoing messages in private chats, groups, and supergroups.
1286
+ * - Bots can delete incoming messages in private chats.
1287
+ * - Bots granted can_post_messages permissions can delete outgoing messages in channels.
1288
+ * - If the bot is an administrator of a group, it can delete any message there.
1289
+ * - If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
1290
+ * Returns True on success.
1291
+ *
1292
+ * @param signal Optional `AbortSignal` to cancel the request
1293
+ *
1294
+ * **Official reference:** https://core.telegram.org/bots/api#deletemessage
1295
+ */
1296
+ deleteMessage(signal?: AbortSignal): Promise<true>;
1297
+ /**
1298
+ * Context-aware alias for `api.deleteMessages`. Use this method to delete multiple messages simultaneously. Returns True on success.
1299
+ *
1300
+ * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1301
+ * @param message_ids A list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted
1302
+ * @param signal Optional `AbortSignal` to cancel the request
1303
+ *
1304
+ * **Official reference:** https://core.telegram.org/bots/api#deletemessages
1305
+ */
1306
+ deleteMessages(message_ids: number[], signal?: AbortSignal): Promise<true>;
1307
+ /**
1308
+ * Context-aware alias for `api.sendSticker`. Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned.
1309
+ *
1310
+ * @param sticker Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. Video and animated stickers can't be sent via an HTTP URL.
1311
+ * @param other Optional remaining parameters, confer the official reference below
1312
+ * @param signal Optional `AbortSignal` to cancel the request
1313
+ *
1314
+ * **Official reference:** https://core.telegram.org/bots/api#sendsticker
1315
+ */
1316
+ replyWithSticker(sticker: InputFile | string, other?: Other<"sendSticker", "chat_id" | "sticker">, signal?: AbortSignal): Promise<Message.StickerMessage>;
1317
+ /**
1318
+ * Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of Sticker objects.
1319
+ *
1320
+ * @param custom_emoji_ids A list of custom emoji identifiers
1321
+ * @param signal Optional `AbortSignal` to cancel the request
1322
+ *
1323
+ * **Official reference:** https://core.telegram.org/bots/api#getcustomemojistickers
1324
+ */
1325
+ getCustomEmojiStickers(signal?: AbortSignal): Promise<import("@grammyjs/types/message.js").Sticker[]>;
1326
+ /**
1327
+ * Context-aware alias for `api.sendGift`. Sends a gift to the given user. The gift can't be converted to Telegram Stars by the receiver. Returns True on success.
1328
+ *
1329
+ * @param gift_id Identifier of the gift
1330
+ * @param other Optional remaining parameters, confer the official reference below
1331
+ * @param signal Optional `AbortSignal` to cancel the request
1332
+ *
1333
+ * **Official reference:** https://core.telegram.org/bots/api#sendgift
1334
+ */
1335
+ replyWithGift(gift_id: string, other?: Other<"sendGift", "user_id" | "chat_id" | "gift_id">, signal?: AbortSignal): Promise<import("@grammyjs/types/payment.js").Gifts>;
1336
+ /**
1337
+ * Context-aware alias for `api.sendGift`. Sends a gift to the given channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success.
1338
+ *
1339
+ * @param gift_id Identifier of the gift
1340
+ * @param other Optional remaining parameters, confer the official reference below
1341
+ * @param signal Optional `AbortSignal` to cancel the request
1342
+ *
1343
+ * **Official reference:** https://core.telegram.org/bots/api#sendgift
1344
+ */
1345
+ replyWithGiftToChannel(gift_id: string, other?: Other<"sendGift", "user_id" | "chat_id" | "gift_id">, signal?: AbortSignal): Promise<import("@grammyjs/types/payment.js").Gifts>;
1346
+ /**
1347
+ * Context-aware alias for `api.answerInlineQuery`. Use this method to send answers to an inline query. On success, True is returned.
1348
+ * No more than 50 results per query are allowed.
1349
+ *
1350
+ * Example: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a 'Connect your YouTube account' button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an OAuth link. Once done, the bot can offer a switch_inline button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities.
1351
+ *
1352
+ * @param results An array of results for the inline query
1353
+ * @param other Optional remaining parameters, confer the official reference below
1354
+ * @param signal Optional `AbortSignal` to cancel the request
1355
+ *
1356
+ * **Official reference:** https://core.telegram.org/bots/api#answerinlinequery
1357
+ */
1358
+ answerInlineQuery(results: readonly InlineQueryResult[], other?: Other<"answerInlineQuery", "inline_query_id" | "results">, signal?: AbortSignal): Promise<true>;
1359
+ /**
1360
+ * Context-aware alias for `api.savePreparedInlineMessage`. Stores a message that can be sent by a user of a Mini App. Returns a PreparedInlineMessage object.
1361
+ *
1362
+ * @param result An object describing the message to be sent
1363
+ * @param other Optional remaining parameters, confer the official reference below
1364
+ * @param signal Optional `AbortSignal` to cancel the request
1365
+ *
1366
+ * **Official reference:** https://core.telegram.org/bots/api#savepreparedinlinemessage
1367
+ */
1368
+ savePreparedInlineMessage(result: InlineQueryResult, other?: Other<"savePreparedInlineMessage", "user_id" | "result">, signal?: AbortSignal): Promise<import("@grammyjs/types/message.js").PreparedInlineMessage>;
1369
+ /**
1370
+ * Context-aware alias for `api.sendInvoice`. Use this method to send invoices. On success, the sent Message is returned.
1371
+ *
1372
+ * @param title Product name, 1-32 characters
1373
+ * @param description Product description, 1-255 characters
1374
+ * @param payload Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
1375
+ * @param currency Three-letter ISO 4217 currency code, see more on currencies
1376
+ * @param prices Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
1377
+ * @param other Optional remaining parameters, confer the official reference below
1378
+ * @param signal Optional `AbortSignal` to cancel the request
1379
+ *
1380
+ * **Official reference:** https://core.telegram.org/bots/api#sendinvoice
1381
+ */
1382
+ replyWithInvoice(title: string, description: string, payload: string, currency: string, prices: readonly LabeledPrice[], other?: Other<"sendInvoice", "chat_id" | "title" | "description" | "payload" | "currency" | "prices">, signal?: AbortSignal): Promise<Message.InvoiceMessage>;
1383
+ /**
1384
+ * Context-aware alias for `api.answerShippingQuery`. If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned.
1385
+ *
1386
+ * @param shipping_query_id Unique identifier for the query to be answered
1387
+ * @param ok Pass True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible)
1388
+ * @param other Optional remaining parameters, confer the official reference below
1389
+ * @param signal Optional `AbortSignal` to cancel the request
1390
+ *
1391
+ * **Official reference:** https://core.telegram.org/bots/api#answershippingquery
1392
+ */
1393
+ answerShippingQuery(ok: boolean, other?: Other<"answerShippingQuery", "shipping_query_id" | "ok">, signal?: AbortSignal): Promise<true>;
1394
+ /**
1395
+ * Context-aware alias for `api.answerPreCheckoutQuery`. Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
1396
+ *
1397
+ * @param ok Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems.
1398
+ * @param other Optional remaining parameters, confer the official reference below
1399
+ * @param signal Optional `AbortSignal` to cancel the request
1400
+ *
1401
+ * **Official reference:** https://core.telegram.org/bots/api#answerprecheckoutquery
1402
+ */
1403
+ answerPreCheckoutQuery(ok: boolean, other?: string | Other<"answerPreCheckoutQuery", "pre_checkout_query_id" | "ok">, signal?: AbortSignal): Promise<true>;
1404
+ /**
1405
+ * Context-aware alias for `api.refundStarPayment`. Refunds a successful payment in Telegram Stars.
1406
+ *
1407
+ * @param signal Optional `AbortSignal` to cancel the request
1408
+ *
1409
+ * **Official reference:** https://core.telegram.org/bots/api#refundstarpayment
1410
+ */
1411
+ refundStarPayment(signal?: AbortSignal): Promise<true>;
1412
+ /**
1413
+ * Context-aware alias for `api.editUserStarSubscription`. Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns True on success.
1414
+ *
1415
+ * @param telegram_payment_charge_id Telegram payment identifier for the subscription
1416
+ * @param is_canceled Pass True to cancel extension of the user subscription; the subscription must be active up to the end of the current subscription period. Pass False to allow the user to re-enable a subscription that was previously canceled by the bot.
1417
+ * @param signal Optional `AbortSignal` to cancel the request
1418
+ *
1419
+ * **Official reference:** https://core.telegram.org/bots/api#edituserstarsubscription
1420
+ */
1421
+ editUserStarSubscription(telegram_payment_charge_id: string, is_canceled: boolean, signal?: AbortSignal): Promise<true>;
1422
+ /**
1423
+ * Context-aware alias for `api.verifyUser`. Verifies a user on behalf of the organization which is represented by the bot. Returns True on success.
1424
+ *
1425
+ * @param other Optional remaining parameters, confer the official reference below
1426
+ * @param signal Optional `AbortSignal` to cancel the request
1427
+ *
1428
+ * **Official reference:** https://core.telegram.org/bots/api#verifyuser
1429
+ */
1430
+ verifyUser(other?: Other<"verifyUser">, signal?: AbortSignal): Promise<true>;
1431
+ /**
1432
+ * Context-aware alias for `api.verifyChat`. Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.
1433
+ *
1434
+ * @param other Optional remaining parameters, confer the official reference below
1435
+ * @param signal Optional `AbortSignal` to cancel the request
1436
+ *
1437
+ * **Official reference:** https://core.telegram.org/bots/api#verifychat
1438
+ */
1439
+ verifyChat(other?: Other<"verifyChat">, signal?: AbortSignal): Promise<true>;
1440
+ /**
1441
+ * Context-aware alias for `api.removeUserVerification`. Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.
1442
+ *
1443
+ * @param signal Optional `AbortSignal` to cancel the request
1444
+ *
1445
+ * **Official reference:** https://core.telegram.org/bots/api#removeuserverification
1446
+ */
1447
+ removeUserVerification(signal?: AbortSignal): Promise<true>;
1448
+ /**
1449
+ * Context-aware alias for `api.removeChatVerification`. Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.
1450
+ *
1451
+ * @param signal Optional `AbortSignal` to cancel the request
1452
+ *
1453
+ * **Official reference:** https://core.telegram.org/bots/api#removechatverification
1454
+ */
1455
+ removeChatVerification(signal?: AbortSignal): Promise<true>;
1456
+ /**
1457
+ * Context-aware alias for `api.setPassportDataErrors`. Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.
1458
+ *
1459
+ * Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.
1460
+ *
1461
+ * @param errors An array describing the errors
1462
+ * @param signal Optional `AbortSignal` to cancel the request
1463
+ *
1464
+ * **Official reference:** https://core.telegram.org/bots/api#setpassportdataerrors
1465
+ */
1466
+ setPassportDataErrors(errors: readonly PassportElementError[], signal?: AbortSignal): Promise<true>;
1467
+ /**
1468
+ * Context-aware alias for `api.sendGame`. Use this method to send a game. On success, the sent Message is returned.
1469
+ *
1470
+ * @param game_short_name Short name of the game, serves as the unique identifier for the game. Set up your games via BotFather.
1471
+ * @param other Optional remaining parameters, confer the official reference below
1472
+ * @param signal Optional `AbortSignal` to cancel the request
1473
+ *
1474
+ * **Official reference:** https://core.telegram.org/bots/api#sendgame
1475
+ */
1476
+ replyWithGame(game_short_name: string, other?: Other<"sendGame", "chat_id" | "game_short_name">, signal?: AbortSignal): Promise<Message.GameMessage>;
1477
+ }
1478
+ type HearsContextCore = FilterCore<":text" | ":caption"> & NarrowMatchCore<string | RegExpMatchArray>;
1479
+ /**
1480
+ * Type of the context object that is available inside the handlers for
1481
+ * `bot.hears`.
1482
+ *
1483
+ * This helper type can be used to narrow down context objects the same way how
1484
+ * `bot.hears` does it. This allows you to annotate context objects in
1485
+ * middleware that is not directly passed to `bot.hears`, hence not inferring
1486
+ * the correct type automatically. That way, handlers can be defined in separate
1487
+ * files and still have the correct types.
1488
+ */
1489
+ export type HearsContext<C extends Context> = Filter<NarrowMatch<C, string | RegExpMatchArray>, ":text" | ":caption">;
1490
+ type CommandContextCore = FilterCore<":entities:bot_command"> & NarrowMatchCore<string>;
1491
+ /**
1492
+ * Type of the context object that is available inside the handlers for
1493
+ * `bot.command`.
1494
+ *
1495
+ * This helper type can be used to narrow down context objects the same way how
1496
+ * `bot.command` does it. This allows you to annotate context objects in
1497
+ * middleware that is not directly passed to `bot.command`, hence not inferring
1498
+ * the correct type automatically. That way, handlers can be defined in separate
1499
+ * files and still have the correct types.
1500
+ */
1501
+ export type CommandContext<C extends Context> = Filter<NarrowMatch<C, string>, ":entities:bot_command">;
1502
+ type NarrowMatchCore<T extends Context["match"]> = {
1503
+ match: T;
1504
+ };
1505
+ type NarrowMatch<C extends Context, T extends C["match"]> = {
1506
+ [K in keyof C]: K extends "match" ? (T extends C[K] ? T : never) : C[K];
1507
+ };
1508
+ type CallbackQueryContextCore = FilterCore<"callback_query:data">;
1509
+ /**
1510
+ * Type of the context object that is available inside the handlers for
1511
+ * `bot.callbackQuery`.
1512
+ *
1513
+ * This helper type can be used to annotate narrow down context objects the same
1514
+ * way `bot.callbackQuery` does it. This allows you to how context objects in
1515
+ * middleware that is not directly passed to `bot.callbackQuery`, hence not
1516
+ * inferring the correct type automatically. That way, handlers can be defined
1517
+ * in separate files and still have the correct types.
1518
+ */
1519
+ export type CallbackQueryContext<C extends Context> = Filter<NarrowMatch<C, string | RegExpMatchArray>, "callback_query:data">;
1520
+ type GameQueryContextCore = FilterCore<"callback_query:game_short_name">;
1521
+ /**
1522
+ * Type of the context object that is available inside the handlers for
1523
+ * `bot.gameQuery`.
1524
+ *
1525
+ * This helper type can be used to narrow down context objects the same way how
1526
+ * `bot.gameQuery` does it. This allows you to annotate context objects in
1527
+ * middleware that is not directly passed to `bot.gameQuery`, hence not
1528
+ * inferring the correct type automatically. That way, handlers can be defined
1529
+ * in separate files and still have the correct types.
1530
+ */
1531
+ export type GameQueryContext<C extends Context> = Filter<NarrowMatch<C, string | RegExpMatchArray>, "callback_query:game_short_name">;
1532
+ type InlineQueryContextCore = FilterCore<"inline_query">;
1533
+ /**
1534
+ * Type of the context object that is available inside the handlers for
1535
+ * `bot.inlineQuery`.
1536
+ *
1537
+ * This helper type can be used to narrow down context objects the same way how
1538
+ * annotate `bot.inlineQuery` does it. This allows you to context objects in
1539
+ * middleware that is not directly passed to `bot.inlineQuery`, hence not
1540
+ * inferring the correct type automatically. That way, handlers can be defined
1541
+ * in separate files and still have the correct types.
1542
+ */
1543
+ export type InlineQueryContext<C extends Context> = Filter<NarrowMatch<C, string | RegExpMatchArray>, "inline_query">;
1544
+ type ReactionContextCore = FilterCore<"message_reaction">;
1545
+ /**
1546
+ * Type of the context object that is available inside the handlers for
1547
+ * `bot.reaction`.
1548
+ *
1549
+ * This helper type can be used to narrow down context objects the same way how
1550
+ * annotate `bot.reaction` does it. This allows you to context objects in
1551
+ * middleware that is not directly passed to `bot.reaction`, hence not inferring
1552
+ * the correct type automatically. That way, handlers can be defined in separate
1553
+ * files and still have the correct types.
1554
+ */
1555
+ export type ReactionContext<C extends Context> = Filter<C, "message_reaction">;
1556
+ type ChosenInlineResultContextCore = FilterCore<"chosen_inline_result">;
1557
+ /**
1558
+ * Type of the context object that is available inside the handlers for
1559
+ * `bot.chosenInlineResult`.
1560
+ *
1561
+ * This helper type can be used to narrow down context objects the same way how
1562
+ * annotate `bot.chosenInlineResult` does it. This allows you to context objects in
1563
+ * middleware that is not directly passed to `bot.chosenInlineResult`, hence not
1564
+ * inferring the correct type automatically. That way, handlers can be defined
1565
+ * in separate files and still have the correct types.
1566
+ */
1567
+ export type ChosenInlineResultContext<C extends Context> = Filter<NarrowMatch<C, string | RegExpMatchArray>, "chosen_inline_result">;
1568
+ type PreCheckoutQueryContextCore = FilterCore<"pre_checkout_query">;
1569
+ /**
1570
+ * Type of the context object that is available inside the handlers for
1571
+ * `bot.preCheckoutQuery`.
1572
+ *
1573
+ * This helper type can be used to narrow down context objects the same way how
1574
+ * annotate `bot.preCheckoutQuery` does it. This allows you to context objects in
1575
+ * middleware that is not directly passed to `bot.preCheckoutQuery`, hence not
1576
+ * inferring the correct type automatically. That way, handlers can be defined
1577
+ * in separate files and still have the correct types.
1578
+ */
1579
+ export type PreCheckoutQueryContext<C extends Context> = Filter<NarrowMatch<C, string | RegExpMatchArray>, "pre_checkout_query">;
1580
+ type ShippingQueryContextCore = FilterCore<"shipping_query">;
1581
+ /**
1582
+ * Type of the context object that is available inside the handlers for
1583
+ * `bot.shippingQuery`.
1584
+ *
1585
+ * This helper type can be used to narrow down context objects the same way how
1586
+ * annotate `bot.shippingQuery` does it. This allows you to context objects in
1587
+ * middleware that is not directly passed to `bot.shippingQuery`, hence not
1588
+ * inferring the correct type automatically. That way, handlers can be defined
1589
+ * in separate files and still have the correct types.
1590
+ */
1591
+ export type ShippingQueryContext<C extends Context> = Filter<NarrowMatch<C, string | RegExpMatchArray>, "shipping_query">;
1592
+ type ChatTypeContextCore<T extends Chat["type"]> = T extends unknown ? Record<"update", ChatTypeUpdate<T>> & ChatType<T> & Record<"chatId", number> & ChatFrom<T> & ChatTypeRecord<"msg", T> & AliasProps<ChatTypeUpdate<T>> : never;
1593
+ /**
1594
+ * Type of the context object that is available inside the handlers for
1595
+ * `bot.chatType`.
1596
+ *
1597
+ * This helper type can be used to narrow down context objects the same way how
1598
+ * `bot.chatType` does it. This allows you to annotate context objects in
1599
+ * middleware that is not directly passed to `bot.chatType`, hence not inferring
1600
+ * the correct type automatically. That way, handlers can be defined in separate
1601
+ * files and still have the correct types.
1602
+ */
1603
+ export type ChatTypeContext<C extends Context, T extends Chat["type"]> = T extends unknown ? C & ChatTypeContextCore<T> : never;
1604
+ type ChatTypeUpdate<T extends Chat["type"]> = ChatTypeRecord<"message" | "edited_message" | "channel_post" | "edited_channel_post" | "my_chat_member" | "chat_member" | "chat_join_request", T> & Partial<Record<"callback_query", ChatTypeRecord<"message", T>>> & ConstrainUpdatesByChatType<T>;
1605
+ type ConstrainUpdatesByChatType<T extends Chat["type"]> = Record<[
1606
+ T
1607
+ ] extends ["channel"] ? "message" | "edited_message" : "channel_post" | "edited_channel_post", undefined>;
1608
+ type ChatTypeRecord<K extends string, T extends Chat["type"]> = Partial<Record<K, ChatType<T>>>;
1609
+ interface ChatType<T extends Chat["type"]> {
1610
+ chat: {
1611
+ type: T;
1612
+ };
1613
+ }
1614
+ interface ChatFrom<T extends Chat["type"]> {
1615
+ from: [T] extends ["private"] ? {} : unknown;
1616
+ }
1617
+ import { AbortSignal } from "./shim.node.js";
1618
+ export {};