grammy 1.7.3 → 1.8.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.
package/README.md CHANGED
@@ -10,7 +10,7 @@ _<h2 align="center"> [:mag: Documentation](https://grammy.dev) | [:page_with_cur
10
10
 
11
11
  <!-- deno-fmt-ignore-start -->
12
12
 
13
- [![Bot API](https://img.shields.io/badge/Bot%20API-5.7-blue?logo=telegram&style=flat-square)](https://core.telegram.org/bots/api)
13
+ [![Bot API](https://img.shields.io/badge/Bot%20API-6.0-blue?logo=telegram&style=flat-square)](https://core.telegram.org/bots/api)
14
14
  [![npm](https://img.shields.io/npm/v/grammy?logo=npm&style=flat-square)](https://www.npmjs.org/package/grammy) <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
15
15
  [![All Contributors](https://img.shields.io/badge/all_contributors-54-orange.svg?style=flat-square)](#contributors-)
16
16
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
@@ -110,7 +110,7 @@ You may also be interested in [why we support Deno](https://grammy.dev/resources
110
110
 
111
111
  ## Browser Support
112
112
 
113
- The grammY core package in this repository is avaiable as a JavaScript bundle from the CDN at `get.grammy.dev`.
113
+ The grammY core package in this repository is available as a JavaScript bundle from the CDN at `get.grammy.dev`.
114
114
  Currently, we transpile all stable versions (all releases since v1.0) as well as the current `main` branch to ES6 and ESNext.
115
115
 
116
116
  You can download them from the URL `https://get.grammy.dev/[ES version lowercased]@[grammY version including v-prefix].js`.
package/out/bot.js CHANGED
@@ -129,7 +129,7 @@ class Bot extends composer_js_1.Composer {
129
129
  if (this.me === undefined)
130
130
  this.me = me;
131
131
  else
132
- debug("Bot info was set manually by now, will not overwrite");
132
+ debug("Bot info was set by now, will not overwrite");
133
133
  }
134
134
  debug(`I am ${this.me.username}!`);
135
135
  }
package/out/context.d.ts CHANGED
@@ -90,7 +90,7 @@ export declare class Context implements RenamedUpdate {
90
90
  /** Alias for `ctx.update.chosen_inline_result` */
91
91
  get chosenInlineResult(): import("@grammyjs/types/inline").ChosenInlineResult | undefined;
92
92
  /** Alias for `ctx.update.callback_query` */
93
- get callbackQuery(): import("@grammyjs/types/callback").CallbackQuery | undefined;
93
+ get callbackQuery(): import("@grammyjs/types/markup").CallbackQuery | undefined;
94
94
  /** Alias for `ctx.update.shipping_query` */
95
95
  get shippingQuery(): import("@grammyjs/types/payment").ShippingQuery | undefined;
96
96
  /** Alias for `ctx.update.pre_checkout_query` */
@@ -142,7 +142,7 @@ export declare class Context implements RenamedUpdate {
142
142
  *
143
143
  * **Official reference:** https://core.telegram.org/bots/api#sendmessage
144
144
  */
145
- reply(text: string, other?: Other<"sendMessage", "text">, signal?: AbortSignal): Promise<Message.TextMessage>;
145
+ reply(text: string, other?: Other<"sendMessage", "chat_id" | "text">, signal?: AbortSignal): Promise<Message.TextMessage>;
146
146
  /**
147
147
  * Context-aware alias for `api.forwardMessage`. Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent Message is returned.
148
148
  *
@@ -152,7 +152,7 @@ export declare class Context implements RenamedUpdate {
152
152
  *
153
153
  * **Official reference:** https://core.telegram.org/bots/api#forwardmessage
154
154
  */
155
- forwardMessage(chat_id: number | string, other?: Other<"forwardMessage", "from_chat_id" | "message_id">, signal?: AbortSignal): Promise<Message>;
155
+ forwardMessage(chat_id: number | string, other?: Other<"forwardMessage", "chat_id" | "from_chat_id" | "message_id">, signal?: AbortSignal): Promise<Message>;
156
156
  /**
157
157
  * Context-aware alias for `api.copyMessage`. Use this method to copy messages of any kind. Service messages and invoice messages can't be copied. 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.
158
158
  *
@@ -162,7 +162,7 @@ export declare class Context implements RenamedUpdate {
162
162
  *
163
163
  * **Official reference:** https://core.telegram.org/bots/api#copymessage
164
164
  */
165
- copyMessage(chat_id: number | string, other?: Other<"copyMessage", "from_chat_id" | "message_id">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").MessageId>;
165
+ copyMessage(chat_id: number | string, other?: Other<"copyMessage", "chat_id" | "from_chat_id" | "message_id">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").MessageId>;
166
166
  /**
167
167
  * Context-aware alias for `api.sendPhoto`. Use this method to send photos. On success, the sent Message is returned.
168
168
  *
@@ -172,7 +172,7 @@ export declare class Context implements RenamedUpdate {
172
172
  *
173
173
  * **Official reference:** https://core.telegram.org/bots/api#sendphoto
174
174
  */
175
- replyWithPhoto(photo: InputFile | string, other?: Other<"sendPhoto", "photo">, signal?: AbortSignal): Promise<Message.PhotoMessage>;
175
+ replyWithPhoto(photo: InputFile | string, other?: Other<"sendPhoto", "chat_id" | "photo">, signal?: AbortSignal): Promise<Message.PhotoMessage>;
176
176
  /**
177
177
  * 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.
178
178
  *
@@ -184,7 +184,7 @@ export declare class Context implements RenamedUpdate {
184
184
  *
185
185
  * **Official reference:** https://core.telegram.org/bots/api#sendaudio
186
186
  */
187
- replyWithAudio(audio: InputFile | string, other?: Other<"sendAudio", "audio">, signal?: AbortSignal): Promise<Message.AudioMessage>;
187
+ replyWithAudio(audio: InputFile | string, other?: Other<"sendAudio", "chat_id" | "audio">, signal?: AbortSignal): Promise<Message.AudioMessage>;
188
188
  /**
189
189
  * 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.
190
190
  *
@@ -194,7 +194,7 @@ export declare class Context implements RenamedUpdate {
194
194
  *
195
195
  * **Official reference:** https://core.telegram.org/bots/api#senddocument
196
196
  */
197
- replyWithDocument(document: InputFile | string, other?: Other<"sendDocument", "document">, signal?: AbortSignal): Promise<Message.DocumentMessage>;
197
+ replyWithDocument(document: InputFile | string, other?: Other<"sendDocument", "chat_id" | "document">, signal?: AbortSignal): Promise<Message.DocumentMessage>;
198
198
  /**
199
199
  * 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.
200
200
  *
@@ -204,7 +204,7 @@ export declare class Context implements RenamedUpdate {
204
204
  *
205
205
  * **Official reference:** https://core.telegram.org/bots/api#sendvideo
206
206
  */
207
- replyWithVideo(video: InputFile | string, other?: Other<"sendVideo", "video">, signal?: AbortSignal): Promise<Message.VideoMessage>;
207
+ replyWithVideo(video: InputFile | string, other?: Other<"sendVideo", "chat_id" | "video">, signal?: AbortSignal): Promise<Message.VideoMessage>;
208
208
  /**
209
209
  * 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.
210
210
  *
@@ -214,7 +214,7 @@ export declare class Context implements RenamedUpdate {
214
214
  *
215
215
  * **Official reference:** https://core.telegram.org/bots/api#sendanimation
216
216
  */
217
- replyWithAnimation(animation: InputFile | string, other?: Other<"sendAnimation", "animation">, signal?: AbortSignal): Promise<Message.AnimationMessage>;
217
+ replyWithAnimation(animation: InputFile | string, other?: Other<"sendAnimation", "chat_id" | "animation">, signal?: AbortSignal): Promise<Message.AnimationMessage>;
218
218
  /**
219
219
  * 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.
220
220
  *
@@ -224,7 +224,7 @@ export declare class Context implements RenamedUpdate {
224
224
  *
225
225
  * **Official reference:** https://core.telegram.org/bots/api#sendvoice
226
226
  */
227
- replyWithVoice(voice: InputFile | string, other?: Other<"sendVoice", "voice">, signal?: AbortSignal): Promise<Message.VoiceMessage>;
227
+ replyWithVoice(voice: InputFile | string, other?: Other<"sendVoice", "chat_id" | "voice">, signal?: AbortSignal): Promise<Message.VoiceMessage>;
228
228
  /**
229
229
  * Context-aware alias for `api.sendVideoNote`. Use this method to send video messages. On success, the sent Message is returned.
230
230
  * As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long.
@@ -235,7 +235,7 @@ export declare class Context implements RenamedUpdate {
235
235
  *
236
236
  * **Official reference:** https://core.telegram.org/bots/api#sendvideonote
237
237
  */
238
- replyWithVideoNote(video_note: InputFile | string, other?: Other<"sendVideoNote", "video_note">, signal?: AbortSignal): Promise<Message.VideoNoteMessage>;
238
+ replyWithVideoNote(video_note: InputFile | string, other?: Other<"sendVideoNote", "chat_id" | "video_note">, signal?: AbortSignal): Promise<Message.VideoNoteMessage>;
239
239
  /**
240
240
  * 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.
241
241
  *
@@ -245,7 +245,7 @@ export declare class Context implements RenamedUpdate {
245
245
  *
246
246
  * **Official reference:** https://core.telegram.org/bots/api#sendmediagroup
247
247
  */
248
- replyWithMediaGroup(media: ReadonlyArray<InputMediaAudio | InputMediaDocument | InputMediaPhoto | InputMediaVideo>, other?: Other<"sendMediaGroup", "media">, signal?: AbortSignal): Promise<(Message.PhotoMessage | Message.AudioMessage | Message.DocumentMessage | Message.VideoMessage)[]>;
248
+ replyWithMediaGroup(media: ReadonlyArray<InputMediaAudio | InputMediaDocument | InputMediaPhoto | InputMediaVideo>, other?: Other<"sendMediaGroup", "chat_id" | "media">, signal?: AbortSignal): Promise<(Message.PhotoMessage | Message.AudioMessage | Message.DocumentMessage | Message.VideoMessage)[]>;
249
249
  /**
250
250
  * Context-aware alias for `api.sendLocation`. Use this method to send point on the map. On success, the sent Message is returned.
251
251
  *
@@ -256,7 +256,7 @@ export declare class Context implements RenamedUpdate {
256
256
  *
257
257
  * **Official reference:** https://core.telegram.org/bots/api#sendlocation
258
258
  */
259
- replyWithLocation(latitude: number, longitude: number, other?: Other<"sendLocation", "latitude" | "longitude">, signal?: AbortSignal): Promise<Message.LocationMessage>;
259
+ replyWithLocation(latitude: number, longitude: number, other?: Other<"sendLocation", "chat_id" | "latitude" | "longitude">, signal?: AbortSignal): Promise<Message.LocationMessage>;
260
260
  /**
261
261
  * 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.
262
262
  *
@@ -267,7 +267,7 @@ export declare class Context implements RenamedUpdate {
267
267
  *
268
268
  * **Official reference:** https://core.telegram.org/bots/api#editmessagelivelocation
269
269
  */
270
- editMessageLiveLocation(latitude: number, longitude: number, other?: Other<"editMessageLiveLocation", "message_id" | "inline_message_id" | "latitude" | "longitude">, signal?: AbortSignal): Promise<true | (Update.Edited & Message.CommonMessage & import("@grammyjs/types/message").MsgWith<"location">)>;
270
+ 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 & import("@grammyjs/types/message").MsgWith<"location">)>;
271
271
  /**
272
272
  * 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.
273
273
  *
@@ -276,7 +276,7 @@ export declare class Context implements RenamedUpdate {
276
276
  *
277
277
  * **Official reference:** https://core.telegram.org/bots/api#stopmessagelivelocation
278
278
  */
279
- stopMessageLiveLocation(other?: Other<"stopMessageLiveLocation", "message_id" | "inline_message_id">, signal?: AbortSignal): Promise<true | (Update.Edited & Message.CommonMessage & import("@grammyjs/types/message").MsgWith<"location">)>;
279
+ stopMessageLiveLocation(other?: Other<"stopMessageLiveLocation", "chat_id" | "message_id" | "inline_message_id">, signal?: AbortSignal): Promise<true | (Update.Edited & Message.CommonMessage & import("@grammyjs/types/message").MsgWith<"location">)>;
280
280
  /**
281
281
  * Context-aware alias for `api.sendVenue`. Use this method to send information about a venue. On success, the sent Message is returned.
282
282
  *
@@ -289,7 +289,7 @@ export declare class Context implements RenamedUpdate {
289
289
  *
290
290
  * **Official reference:** https://core.telegram.org/bots/api#sendvenue
291
291
  */
292
- replyWithVenue(latitude: number, longitude: number, title: string, address: string, other?: Other<"sendVenue", "latitude" | "longitude" | "title" | "address">, signal?: AbortSignal): Promise<Message.VenueMessage>;
292
+ replyWithVenue(latitude: number, longitude: number, title: string, address: string, other?: Other<"sendVenue", "chat_id" | "latitude" | "longitude" | "title" | "address">, signal?: AbortSignal): Promise<Message.VenueMessage>;
293
293
  /**
294
294
  * Context-aware alias for `api.sendContact`. Use this method to send phone contacts. On success, the sent Message is returned.
295
295
  *
@@ -300,7 +300,7 @@ export declare class Context implements RenamedUpdate {
300
300
  *
301
301
  * **Official reference:** https://core.telegram.org/bots/api#sendcontact
302
302
  */
303
- replyWithContact(phone_number: string, first_name: string, other?: Other<"sendContact", "phone_number" | "first_name">, signal?: AbortSignal): Promise<Message.ContactMessage>;
303
+ replyWithContact(phone_number: string, first_name: string, other?: Other<"sendContact", "chat_id" | "phone_number" | "first_name">, signal?: AbortSignal): Promise<Message.ContactMessage>;
304
304
  /**
305
305
  * Context-aware alias for `api.sendPoll`. Use this method to send a native poll. On success, the sent Message is returned.
306
306
  *
@@ -311,7 +311,7 @@ export declare class Context implements RenamedUpdate {
311
311
  *
312
312
  * **Official reference:** https://core.telegram.org/bots/api#sendpoll
313
313
  */
314
- replyWithPoll(question: string, options: readonly string[], other?: Other<"sendPoll", "question" | "options">, signal?: AbortSignal): Promise<Message.PollMessage>;
314
+ replyWithPoll(question: string, options: readonly string[], other?: Other<"sendPoll", "chat_id" | "question" | "options">, signal?: AbortSignal): Promise<Message.PollMessage>;
315
315
  /**
316
316
  * 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.
317
317
  *
@@ -321,7 +321,7 @@ export declare class Context implements RenamedUpdate {
321
321
  *
322
322
  * **Official reference:** https://core.telegram.org/bots/api#senddice
323
323
  */
324
- replyWithDice(emoji: string, other?: Other<"sendDice", "emoji">, signal?: AbortSignal): Promise<Message.DiceMessage>;
324
+ replyWithDice(emoji: string, other?: Other<"sendDice", "chat_id" | "emoji">, signal?: AbortSignal): Promise<Message.DiceMessage>;
325
325
  /**
326
326
  * 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.
327
327
  *
@@ -364,8 +364,7 @@ export declare class Context implements RenamedUpdate {
364
364
  * @param signal Optional `AbortSignal` to cancel the request
365
365
  *
366
366
  * **Official reference:** https://core.telegram.org/bots/api#banchatmember
367
- */
368
- banAuthor(other?: Other<"banChatMember", "user_id">, signal?: AbortSignal): Promise<true>;
367
+ */ banAuthor(other?: Other<"banChatMember", "chat_id" | "user_id">, signal?: AbortSignal): Promise<true>;
369
368
  /** @deprecated Use `banChatMember` instead. */
370
369
  kickChatMember(...args: Parameters<Context["banChatMember"]>): Promise<true>;
371
370
  /**
@@ -377,7 +376,7 @@ export declare class Context implements RenamedUpdate {
377
376
  *
378
377
  * **Official reference:** https://core.telegram.org/bots/api#banchatmember
379
378
  */
380
- banChatMember(user_id: number, other?: Other<"banChatMember", "user_id">, signal?: AbortSignal): Promise<true>;
379
+ banChatMember(user_id: number, other?: Other<"banChatMember", "chat_id" | "user_id">, signal?: AbortSignal): Promise<true>;
381
380
  /**
382
381
  * 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.
383
382
  *
@@ -387,7 +386,7 @@ export declare class Context implements RenamedUpdate {
387
386
  *
388
387
  * **Official reference:** https://core.telegram.org/bots/api#unbanchatmember
389
388
  */
390
- unbanChatMember(user_id: number, other?: Other<"unbanChatMember", "user_id">, signal?: AbortSignal): Promise<true>;
389
+ unbanChatMember(user_id: number, other?: Other<"unbanChatMember", "chat_id" | "user_id">, signal?: AbortSignal): Promise<true>;
391
390
  /**
392
391
  * 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.
393
392
  *
@@ -397,7 +396,7 @@ export declare class Context implements RenamedUpdate {
397
396
  *
398
397
  * **Official reference:** https://core.telegram.org/bots/api#restrictchatmember
399
398
  */
400
- restrictAuthor(permissions: ChatPermissions, other?: Other<"restrictChatMember", "user_id" | "permissions">, signal?: AbortSignal): Promise<true>;
399
+ restrictAuthor(permissions: ChatPermissions, other?: Other<"restrictChatMember", "chat_id" | "user_id" | "permissions">, signal?: AbortSignal): Promise<true>;
401
400
  /**
402
401
  * 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.
403
402
  *
@@ -408,7 +407,7 @@ export declare class Context implements RenamedUpdate {
408
407
  *
409
408
  * **Official reference:** https://core.telegram.org/bots/api#restrictchatmember
410
409
  */
411
- restrictChatMember(user_id: number, permissions: ChatPermissions, other?: Other<"restrictChatMember", "user_id" | "permissions">, signal?: AbortSignal): Promise<true>;
410
+ restrictChatMember(user_id: number, permissions: ChatPermissions, other?: Other<"restrictChatMember", "chat_id" | "user_id" | "permissions">, signal?: AbortSignal): Promise<true>;
412
411
  /**
413
412
  * 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.
414
413
  *
@@ -417,7 +416,7 @@ export declare class Context implements RenamedUpdate {
417
416
  *
418
417
  * **Official reference:** https://core.telegram.org/bots/api#promotechatmember
419
418
  */
420
- promoteAuthor(other?: Other<"promoteChatMember", "user_id">, signal?: AbortSignal): Promise<true>;
419
+ promoteAuthor(other?: Other<"promoteChatMember", "chat_id" | "user_id">, signal?: AbortSignal): Promise<true>;
421
420
  /**
422
421
  * 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.
423
422
  *
@@ -427,7 +426,7 @@ export declare class Context implements RenamedUpdate {
427
426
  *
428
427
  * **Official reference:** https://core.telegram.org/bots/api#promotechatmember
429
428
  */
430
- promoteChatMember(user_id: number, other?: Other<"promoteChatMember", "user_id">, signal?: AbortSignal): Promise<true>;
429
+ promoteChatMember(user_id: number, other?: Other<"promoteChatMember", "chat_id" | "user_id">, signal?: AbortSignal): Promise<true>;
431
430
  /**
432
431
  * 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.
433
432
  *
@@ -492,7 +491,7 @@ export declare class Context implements RenamedUpdate {
492
491
  *
493
492
  * **Official reference:** https://core.telegram.org/bots/api#createchatinvitelink
494
493
  */
495
- createChatInviteLink(other?: Other<"createChatInviteLink">, signal?: AbortSignal): Promise<import("@grammyjs/types/manage").ChatInviteLink>;
494
+ createChatInviteLink(other?: Other<"createChatInviteLink", "chat_id">, signal?: AbortSignal): Promise<import("@grammyjs/types/manage").ChatInviteLink>;
496
495
  /**
497
496
  * 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.
498
497
  *
@@ -502,7 +501,7 @@ export declare class Context implements RenamedUpdate {
502
501
  *
503
502
  * **Official reference:** https://core.telegram.org/bots/api#editchatinvitelink
504
503
  */
505
- editChatInviteLink(invite_link: string, other?: Other<"editChatInviteLink", "invite_link">, signal?: AbortSignal): Promise<import("@grammyjs/types/manage").ChatInviteLink>;
504
+ editChatInviteLink(invite_link: string, other?: Other<"editChatInviteLink", "chat_id" | "invite_link">, signal?: AbortSignal): Promise<import("@grammyjs/types/manage").ChatInviteLink>;
506
505
  /**
507
506
  * 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.
508
507
  *
@@ -574,7 +573,7 @@ export declare class Context implements RenamedUpdate {
574
573
  *
575
574
  * **Official reference:** https://core.telegram.org/bots/api#pinchatmessage
576
575
  */
577
- pinChatMessage(message_id: number, other?: Other<"pinChatMessage", "message_id">, signal?: AbortSignal): Promise<true>;
576
+ pinChatMessage(message_id: number, other?: Other<"pinChatMessage", "chat_id" | "message_id">, signal?: AbortSignal): Promise<true>;
578
577
  /**
579
578
  * 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.
580
579
  *
@@ -671,6 +670,40 @@ export declare class Context implements RenamedUpdate {
671
670
  * **Official reference:** https://core.telegram.org/bots/api#answercallbackquery
672
671
  */
673
672
  answerCallbackQuery(other?: string | Other<"answerCallbackQuery", "callback_query_id">, signal?: AbortSignal): Promise<true>;
673
+ /**
674
+ * 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.
675
+ *
676
+ * @param other Optional remaining parameters, confer the official reference below
677
+ * @param signal Optional `AbortSignal` to cancel the request
678
+ *
679
+ * **Official reference:** https://core.telegram.org/bots/api#setchatmenubutton
680
+ */
681
+ setChatMenuButton(other?: Other<"setChatMenuButton">, signal?: AbortSignal): Promise<true>;
682
+ /**
683
+ * 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.
684
+ *
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#setchatmenubutton
689
+ */
690
+ getChatMenuButton(other?: Other<"getChatMenuButton">, signal?: AbortSignal): Promise<import("@grammyjs/types/menu-button").MenuButton>;
691
+ /**
692
+ * 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.
693
+ *
694
+ * @param other Optional remaining parameters, confer the official reference below
695
+ * @param signal Optional `AbortSignal` to cancel the request
696
+ *
697
+ * **Official reference:** https://core.telegram.org/bots/api#setmydefaultadministratorrights
698
+ */
699
+ setMyDefaultAdministratorRights(other?: Other<"setMyDefaultAdministratorRights">, signal?: AbortSignal): Promise<true>;
700
+ /**
701
+ * Context-aware alias for `api.getMyDefaultAdministratorRights`. Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.
702
+ *
703
+ * @param other Optional remaining parameters, confer the official reference below
704
+ * @param signal Optional `AbortSignal` to cancel the request
705
+ */
706
+ getMyDefaultAdministratorRights(other?: Other<"getMyDefaultAdministratorRights">, signal?: AbortSignal): Promise<import("@grammyjs/types/manage").ChatAdministratorRights>;
674
707
  /**
675
708
  * 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.
676
709
  *
@@ -680,7 +713,7 @@ export declare class Context implements RenamedUpdate {
680
713
  *
681
714
  * **Official reference:** https://core.telegram.org/bots/api#editmessagetext
682
715
  */
683
- editMessageText(text: string, other?: Other<"editMessageText", "message_id" | "inline_message_id" | "text">, signal?: AbortSignal): Promise<true | (Update.Edited & Message.CommonMessage & import("@grammyjs/types/message").MsgWith<"text">)>;
716
+ editMessageText(text: string, other?: Other<"editMessageText", "chat_id" | "message_id" | "inline_message_id" | "text">, signal?: AbortSignal): Promise<true | (Update.Edited & Message.CommonMessage & import("@grammyjs/types/message").MsgWith<"text">)>;
684
717
  /**
685
718
  * 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.
686
719
  *
@@ -689,7 +722,7 @@ export declare class Context implements RenamedUpdate {
689
722
  *
690
723
  * **Official reference:** https://core.telegram.org/bots/api#editmessagecaption
691
724
  */
692
- editMessageCaption(other?: Other<"editMessageCaption", "message_id" | "inline_message_id">, signal?: AbortSignal): Promise<true | (Update.Edited & Message.CaptionableMessage)>;
725
+ editMessageCaption(other?: Other<"editMessageCaption", "chat_id" | "message_id" | "inline_message_id">, signal?: AbortSignal): Promise<true | (Update.Edited & Message.CaptionableMessage)>;
693
726
  /**
694
727
  * Context-aware alias for `api.editMessageMedia`. Use this method to edit animation, audio, document, photo, or video 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.
695
728
  *
@@ -699,7 +732,7 @@ export declare class Context implements RenamedUpdate {
699
732
  *
700
733
  * **Official reference:** https://core.telegram.org/bots/api#editmessagemedia
701
734
  */
702
- editMessageMedia(media: InputMedia, other?: Other<"editMessageMedia", "message_id" | "inline_message_id" | "media">, signal?: AbortSignal): Promise<true | (Update.Edited & Message.CaptionableMessage & import("@grammyjs/types/message").MsgWith<"document"> & import("@grammyjs/types/message").MsgWith<"animation">) | (Update.Edited & Message.CaptionableMessage & import("@grammyjs/types/message").MsgWith<"audio">) | (Update.Edited & Message.CaptionableMessage & import("@grammyjs/types/message").MsgWith<"document">) | (Update.Edited & Message.MediaMessage & import("@grammyjs/types/message").MsgWith<"photo">) | (Update.Edited & Message.MediaMessage & import("@grammyjs/types/message").MsgWith<"video">)>;
735
+ editMessageMedia(media: InputMedia, other?: Other<"editMessageMedia", "chat_id" | "message_id" | "inline_message_id" | "media">, signal?: AbortSignal): Promise<true | (Update.Edited & Message.CaptionableMessage & import("@grammyjs/types/message").MsgWith<"document"> & import("@grammyjs/types/message").MsgWith<"animation">) | (Update.Edited & Message.CaptionableMessage & import("@grammyjs/types/message").MsgWith<"audio">) | (Update.Edited & Message.CaptionableMessage & import("@grammyjs/types/message").MsgWith<"document">) | (Update.Edited & Message.MediaMessage & import("@grammyjs/types/message").MsgWith<"photo">) | (Update.Edited & Message.MediaMessage & import("@grammyjs/types/message").MsgWith<"video">)>;
703
736
  /**
704
737
  * 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.
705
738
  *
@@ -708,7 +741,7 @@ export declare class Context implements RenamedUpdate {
708
741
  *
709
742
  * **Official reference:** https://core.telegram.org/bots/api#editmessagereplymarkup
710
743
  */
711
- editMessageReplyMarkup(other?: Other<"editMessageReplyMarkup", "message_id" | "inline_message_id">, signal?: AbortSignal): Promise<true | (Update.Edited & Message)>;
744
+ editMessageReplyMarkup(other?: Other<"editMessageReplyMarkup", "chat_id" | "message_id" | "inline_message_id">, signal?: AbortSignal): Promise<true | (Update.Edited & Message)>;
712
745
  /**
713
746
  * 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.
714
747
  *
@@ -717,7 +750,7 @@ export declare class Context implements RenamedUpdate {
717
750
  *
718
751
  * **Official reference:** https://core.telegram.org/bots/api#stoppoll
719
752
  */
720
- stopPoll(other?: Other<"stopPoll", "message_id">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Poll>;
753
+ stopPoll(other?: Other<"stopPoll", "chat_id" | "message_id">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Poll>;
721
754
  /**
722
755
  * Context-aware alias for `api.deleteMessage`. Use this method to delete a message, including service messages, with the following limitations:
723
756
  * - A message can only be deleted if it was sent less than 48 hours ago.
@@ -743,7 +776,7 @@ export declare class Context implements RenamedUpdate {
743
776
  *
744
777
  * **Official reference:** https://core.telegram.org/bots/api#sendsticker
745
778
  */
746
- replyWithSticker(sticker: InputFile | string, other?: Other<"sendSticker", "sticker">, signal?: AbortSignal): Promise<Message.StickerMessage>;
779
+ replyWithSticker(sticker: InputFile | string, other?: Other<"sendSticker", "chat_id" | "sticker">, signal?: AbortSignal): Promise<Message.StickerMessage>;
747
780
  /**
748
781
  * Context-aware alias for `api.answerInlineQuery`. Use this method to send answers to an inline query. On success, True is returned.
749
782
  * No more than 50 results per query are allowed.
@@ -771,7 +804,7 @@ export declare class Context implements RenamedUpdate {
771
804
  *
772
805
  * **Official reference:** https://core.telegram.org/bots/api#sendinvoice
773
806
  */
774
- replyWithInvoice(title: string, description: string, payload: string, provider_token: string, currency: string, prices: readonly LabeledPrice[], other?: Other<"sendInvoice", "title" | "description" | "payload" | "provider_token" | "currency" | "prices">, signal?: AbortSignal): Promise<Message.InvoiceMessage>;
807
+ replyWithInvoice(title: string, description: string, payload: string, provider_token: string, currency: string, prices: readonly LabeledPrice[], other?: Other<"sendInvoice", "chat_id" | "title" | "description" | "payload" | "provider_token" | "currency" | "prices">, signal?: AbortSignal): Promise<Message.InvoiceMessage>;
775
808
  /**
776
809
  * 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.
777
810
  *
@@ -813,7 +846,7 @@ export declare class Context implements RenamedUpdate {
813
846
  *
814
847
  * **Official reference:** https://core.telegram.org/bots/api#sendgame
815
848
  */
816
- replyWithGame(game_short_name: string, other?: Other<"sendGame", "game_short_name">, signal?: AbortSignal): Promise<Message.GameMessage>;
849
+ replyWithGame(game_short_name: string, other?: Other<"sendGame", "chat_id" | "game_short_name">, signal?: AbortSignal): Promise<Message.GameMessage>;
817
850
  }
818
851
  import { AbortSignal } from "./shim.node.js";
819
852
  export {};
package/out/context.js CHANGED
@@ -448,8 +448,7 @@ class Context {
448
448
  * @param signal Optional `AbortSignal` to cancel the request
449
449
  *
450
450
  * **Official reference:** https://core.telegram.org/bots/api#banchatmember
451
- */
452
- banAuthor(other, signal) {
451
+ */ banAuthor(other, signal) {
453
452
  return this.api.banChatMember(orThrow(this.chat, "banAuthor").id, orThrow(this.from, "banAuthor").id, other, signal);
454
453
  }
455
454
  /** @deprecated Use `banChatMember` instead. */
@@ -827,6 +826,48 @@ class Context {
827
826
  answerCallbackQuery(other, signal) {
828
827
  return this.api.answerCallbackQuery(orThrow(this.callbackQuery, "answerCallbackQuery").id, typeof other === "string" ? { text: other } : other, signal);
829
828
  }
829
+ /**
830
+ * 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.
831
+ *
832
+ * @param other Optional remaining parameters, confer the official reference below
833
+ * @param signal Optional `AbortSignal` to cancel the request
834
+ *
835
+ * **Official reference:** https://core.telegram.org/bots/api#setchatmenubutton
836
+ */
837
+ setChatMenuButton(other, signal) {
838
+ return this.api.setChatMenuButton(other, signal);
839
+ }
840
+ /**
841
+ * 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.
842
+ *
843
+ * @param other Optional remaining parameters, confer the official reference below
844
+ * @param signal Optional `AbortSignal` to cancel the request
845
+ *
846
+ * **Official reference:** https://core.telegram.org/bots/api#setchatmenubutton
847
+ */
848
+ getChatMenuButton(other, signal) {
849
+ return this.api.getChatMenuButton(other, signal);
850
+ }
851
+ /**
852
+ * 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.
853
+ *
854
+ * @param other Optional remaining parameters, confer the official reference below
855
+ * @param signal Optional `AbortSignal` to cancel the request
856
+ *
857
+ * **Official reference:** https://core.telegram.org/bots/api#setmydefaultadministratorrights
858
+ */
859
+ setMyDefaultAdministratorRights(other, signal) {
860
+ return this.api.setMyDefaultAdministratorRights(other, signal);
861
+ }
862
+ /**
863
+ * Context-aware alias for `api.getMyDefaultAdministratorRights`. Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.
864
+ *
865
+ * @param other Optional remaining parameters, confer the official reference below
866
+ * @param signal Optional `AbortSignal` to cancel the request
867
+ */
868
+ getMyDefaultAdministratorRights(other, signal) {
869
+ return this.api.getMyDefaultAdministratorRights(other, signal);
870
+ }
830
871
  /**
831
872
  * 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.
832
873
  *
@@ -28,8 +28,8 @@ import { type InlineKeyboardButton, type KeyboardButton, type LoginUrl } from ".
28
28
  */
29
29
  export declare class Keyboard {
30
30
  /**
31
- * The nested array that holds the custom keyboard. It will be extended every time
32
- * you call one of the provided methods.
31
+ * The nested array that holds the custom keyboard. It will be extended
32
+ * every time you call one of the provided methods.
33
33
  */
34
34
  readonly keyboard: KeyboardButton[][];
35
35
  /**
@@ -81,6 +81,15 @@ export declare class Keyboard {
81
81
  * @param type The type of permitted polls to create, omit if the user may send a poll of any type
82
82
  */
83
83
  requestPoll(text: string, type?: "quiz" | "regular"): this;
84
+ /**
85
+ * Adds a new web app button. The Web App that will be launched when the
86
+ * user presses the button. The Web App will be able to send a
87
+ * “web_app_data” service message. Available in private chats only.
88
+ *
89
+ * @param text Text text to display
90
+ * @param url An HTTPS URL of a Web App to be opened with additional data
91
+ */
92
+ webApp(text: string, url: string): this;
84
93
  /**
85
94
  * Return the resulting custom keyboard that was built. May be called in the
86
95
  * end if necessary so you can specify more options in `reply_markup`.
@@ -141,15 +150,6 @@ export declare class InlineKeyboard {
141
150
  * @param url HTTP or tg:// url to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings.
142
151
  */
143
152
  url(text: string, url: string): this;
144
- /**
145
- * Adds a new login button. This can be used as a replacement for the
146
- * Telegram Login Widget. You must specify an HTTP URL used to automatically
147
- * authorize the user.
148
- *
149
- * @param text The text to display
150
- * @param loginUrl The login URL as string or `LoginUrl` object
151
- */
152
- login(text: string, loginUrl: string | LoginUrl): this;
153
153
  /**
154
154
  * Adds a new callback query button. The button contains a text and a custom
155
155
  * payload. This payload will be sent back to your bot when the button is
@@ -169,6 +169,22 @@ export declare class InlineKeyboard {
169
169
  * @param data The callback data to send back to your bot (default = text)
170
170
  */
171
171
  text(text: string, data?: string): this;
172
+ /**
173
+ * Adds a new web app button, confer https://core.telegram.org/bots/webapps
174
+ *
175
+ * @param text The text to display
176
+ * @param url An HTTPS URL of a Web App to be opened with additional data
177
+ */
178
+ webApp(text: string, url: string): this;
179
+ /**
180
+ * Adds a new login button. This can be used as a replacement for the
181
+ * Telegram Login Widget. You must specify an HTTP URL used to automatically
182
+ * authorize the user.
183
+ *
184
+ * @param text The text to display
185
+ * @param loginUrl The login URL as string or `LoginUrl` object
186
+ */
187
+ login(text: string, loginUrl: string | LoginUrl): this;
172
188
  /**
173
189
  * Adds a new inline query button. Telegram clients will let the user pick a
174
190
  * chat when this button is pressed. This will start an inline query. The
@@ -201,7 +217,8 @@ export declare class InlineKeyboard {
201
217
  */
202
218
  switchInlineCurrent(text: string, query?: string): this;
203
219
  /**
204
- * Adds a new game query button, confer https://core.telegram.org/bots/api#games
220
+ * Adds a new game query button, confer
221
+ * https://core.telegram.org/bots/api#games
205
222
  *
206
223
  * This type of button must always be the first button in the first row.
207
224
  *
@@ -209,9 +226,11 @@ export declare class InlineKeyboard {
209
226
  */
210
227
  game(text: string): this;
211
228
  /**
212
- * Adds a new payment button, confer https://core.telegram.org/bots/api#payments
229
+ * Adds a new payment button, confer
230
+ * https://core.telegram.org/bots/api#payments
213
231
  *
214
- * This type of button must always be the first button in the first row and can only be used in invoice messages.
232
+ * This type of button must always be the first button in the first row and
233
+ * can only be used in invoice messages.
215
234
  *
216
235
  * @param text The text to display
217
236
  */