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/out/core/api.d.ts CHANGED
@@ -1,11 +1,10 @@
1
1
  import { type BotCommand, type ChatPermissions, type InlineQueryResult, type InputFile, type InputMedia, type InputMediaAudio, type InputMediaDocument, type InputMediaPhoto, type InputMediaVideo, type LabeledPrice, type PassportElementError } from "../platform.node.js";
2
2
  import { type ApiClientOptions, type Methods, type Payload, type RawApi, type Transformer, type TransformerConsumer, type WebhookReplyEnvelope } from "./client.js";
3
- declare type AlwaysOmittedInOther = "chat_id";
4
3
  /**
5
4
  * Helper type to derive remaining properties of a given API method call M,
6
5
  * given that some properties X have already been specified.
7
6
  */
8
- export declare type Other<R extends RawApi, M extends Methods<R>, X extends string = never> = Omit<Payload<M, R>, X | AlwaysOmittedInOther>;
7
+ export declare type Other<R extends RawApi, M extends Methods<R>, X extends string = never> = Omit<Payload<M, R>, X>;
9
8
  /**
10
9
  * This class provides access to the full Telegram Bot API. All methods of the
11
10
  * API have an equivalent on this class, with the most important parameters
@@ -143,7 +142,7 @@ export declare class Api<R extends RawApi = RawApi> {
143
142
  *
144
143
  * **Official reference:** https://core.telegram.org/bots/api#sendmessage
145
144
  */
146
- sendMessage(chat_id: number | string, text: string, other?: Other<R, "sendMessage", "text">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.TextMessage>;
145
+ sendMessage(chat_id: number | string, text: string, other?: Other<R, "sendMessage", "chat_id" | "text">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.TextMessage>;
147
146
  /**
148
147
  * Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent Message is returned.
149
148
  *
@@ -155,7 +154,7 @@ export declare class Api<R extends RawApi = RawApi> {
155
154
  *
156
155
  * **Official reference:** https://core.telegram.org/bots/api#forwardmessage
157
156
  */
158
- forwardMessage(chat_id: number | string, from_chat_id: number | string, message_id: number, other?: Other<R, "forwardMessage", "from_chat_id" | "message_id">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message>;
157
+ forwardMessage(chat_id: number | string, from_chat_id: number | string, message_id: number, other?: Other<R, "forwardMessage", "chat_id" | "from_chat_id" | "message_id">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message>;
159
158
  /**
160
159
  * 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.
161
160
  *
@@ -167,7 +166,7 @@ export declare class Api<R extends RawApi = RawApi> {
167
166
  *
168
167
  * **Official reference:** https://core.telegram.org/bots/api#copymessage
169
168
  */
170
- copyMessage(chat_id: number | string, from_chat_id: number | string, message_id: number, other?: Other<R, "copyMessage", "from_chat_id" | "message_id">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").MessageId>;
169
+ copyMessage(chat_id: number | string, from_chat_id: number | string, message_id: number, other?: Other<R, "copyMessage", "chat_id" | "from_chat_id" | "message_id">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").MessageId>;
171
170
  /**
172
171
  * Use this method to send photos. On success, the sent Message is returned.
173
172
  *
@@ -178,7 +177,7 @@ export declare class Api<R extends RawApi = RawApi> {
178
177
  *
179
178
  * **Official reference:** https://core.telegram.org/bots/api#sendphoto
180
179
  */
181
- sendPhoto(chat_id: number | string, photo: InputFile | string, other?: Other<R, "sendPhoto", "photo">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.PhotoMessage>;
180
+ sendPhoto(chat_id: number | string, photo: InputFile | string, other?: Other<R, "sendPhoto", "chat_id" | "photo">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.PhotoMessage>;
182
181
  /**
183
182
  * 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.
184
183
  *
@@ -191,7 +190,7 @@ export declare class Api<R extends RawApi = RawApi> {
191
190
  *
192
191
  * **Official reference:** https://core.telegram.org/bots/api#sendaudio
193
192
  */
194
- sendAudio(chat_id: number | string, audio: InputFile | string, other?: Other<R, "sendAudio", "audio">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.AudioMessage>;
193
+ sendAudio(chat_id: number | string, audio: InputFile | string, other?: Other<R, "sendAudio", "chat_id" | "audio">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.AudioMessage>;
195
194
  /**
196
195
  * 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.
197
196
  *
@@ -202,7 +201,7 @@ export declare class Api<R extends RawApi = RawApi> {
202
201
  *
203
202
  * **Official reference:** https://core.telegram.org/bots/api#senddocument
204
203
  */
205
- sendDocument(chat_id: number | string, document: InputFile | string, other?: Other<R, "sendDocument", "document">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.DocumentMessage>;
204
+ sendDocument(chat_id: number | string, document: InputFile | string, other?: Other<R, "sendDocument", "chat_id" | "document">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.DocumentMessage>;
206
205
  /**
207
206
  * 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.
208
207
  *
@@ -213,7 +212,7 @@ export declare class Api<R extends RawApi = RawApi> {
213
212
  *
214
213
  * **Official reference:** https://core.telegram.org/bots/api#sendvideo
215
214
  */
216
- sendVideo(chat_id: number | string, video: InputFile | string, other?: Other<R, "sendVideo", "video">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.VideoMessage>;
215
+ sendVideo(chat_id: number | string, video: InputFile | string, other?: Other<R, "sendVideo", "chat_id" | "video">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.VideoMessage>;
217
216
  /**
218
217
  * 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.
219
218
  *
@@ -224,7 +223,7 @@ export declare class Api<R extends RawApi = RawApi> {
224
223
  *
225
224
  * **Official reference:** https://core.telegram.org/bots/api#sendanimation
226
225
  */
227
- sendAnimation(chat_id: number | string, animation: InputFile | string, other?: Other<R, "sendAnimation", "animation">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.AnimationMessage>;
226
+ sendAnimation(chat_id: number | string, animation: InputFile | string, other?: Other<R, "sendAnimation", "chat_id" | "animation">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.AnimationMessage>;
228
227
  /**
229
228
  * 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.
230
229
  *
@@ -235,7 +234,7 @@ export declare class Api<R extends RawApi = RawApi> {
235
234
  *
236
235
  * **Official reference:** https://core.telegram.org/bots/api#sendvoice
237
236
  */
238
- sendVoice(chat_id: number | string, voice: InputFile | string, other?: Other<R, "sendVoice", "voice">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.VoiceMessage>;
237
+ sendVoice(chat_id: number | string, voice: InputFile | string, other?: Other<R, "sendVoice", "chat_id" | "voice">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.VoiceMessage>;
239
238
  /**
240
239
  * Use this method to send video messages. On success, the sent Message is returned.
241
240
  * As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long.
@@ -247,7 +246,7 @@ export declare class Api<R extends RawApi = RawApi> {
247
246
  *
248
247
  * **Official reference:** https://core.telegram.org/bots/api#sendvideonote
249
248
  */
250
- sendVideoNote(chat_id: number | string, video_note: InputFile | string, other?: Other<R, "sendVideoNote", "video_note">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.VideoNoteMessage>;
249
+ sendVideoNote(chat_id: number | string, video_note: InputFile | string, other?: Other<R, "sendVideoNote", "chat_id" | "video_note">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.VideoNoteMessage>;
251
250
  /**
252
251
  * 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.
253
252
  *
@@ -258,7 +257,7 @@ export declare class Api<R extends RawApi = RawApi> {
258
257
  *
259
258
  * **Official reference:** https://core.telegram.org/bots/api#sendmediagroup
260
259
  */
261
- sendMediaGroup(chat_id: number | string, media: ReadonlyArray<InputMediaAudio | InputMediaDocument | InputMediaPhoto | InputMediaVideo>, other?: Other<R, "sendMediaGroup", "media">, signal?: AbortSignal): Promise<(import("@grammyjs/types/message").Message.PhotoMessage | import("@grammyjs/types/message").Message.AudioMessage | import("@grammyjs/types/message").Message.DocumentMessage | import("@grammyjs/types/message").Message.VideoMessage)[]>;
260
+ sendMediaGroup(chat_id: number | string, media: ReadonlyArray<InputMediaAudio | InputMediaDocument | InputMediaPhoto | InputMediaVideo>, other?: Other<R, "sendMediaGroup", "chat_id" | "media">, signal?: AbortSignal): Promise<(import("@grammyjs/types/message").Message.PhotoMessage | import("@grammyjs/types/message").Message.AudioMessage | import("@grammyjs/types/message").Message.DocumentMessage | import("@grammyjs/types/message").Message.VideoMessage)[]>;
262
261
  /**
263
262
  * Use this method to send point on the map. On success, the sent Message is returned.
264
263
  *
@@ -270,7 +269,7 @@ export declare class Api<R extends RawApi = RawApi> {
270
269
  *
271
270
  * **Official reference:** https://core.telegram.org/bots/api#sendlocation
272
271
  */
273
- sendLocation(chat_id: number | string, latitude: number, longitude: number, other?: Other<R, "sendLocation", "latitude" | "longitude">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.LocationMessage>;
272
+ sendLocation(chat_id: number | string, latitude: number, longitude: number, other?: Other<R, "sendLocation", "chat_id" | "latitude" | "longitude">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.LocationMessage>;
274
273
  /**
275
274
  * 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.
276
275
  *
@@ -283,7 +282,7 @@ export declare class Api<R extends RawApi = RawApi> {
283
282
  *
284
283
  * **Official reference:** https://core.telegram.org/bots/api#editmessagelivelocation
285
284
  */
286
- editMessageLiveLocation(chat_id: number | string, message_id: number, latitude: number, longitude: number, other?: Other<R, "editMessageLiveLocation", "message_id" | "inline_message_id" | "latitude" | "longitude">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CommonMessage & import("@grammyjs/types/message").MsgWith<"location">)>;
285
+ editMessageLiveLocation(chat_id: number | string, message_id: number, latitude: number, longitude: number, other?: Other<R, "editMessageLiveLocation", "chat_id" | "message_id" | "inline_message_id" | "latitude" | "longitude">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CommonMessage & import("@grammyjs/types/message").MsgWith<"location">)>;
287
286
  /**
288
287
  * Use this method to edit live location inline 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.
289
288
  *
@@ -295,7 +294,7 @@ export declare class Api<R extends RawApi = RawApi> {
295
294
  *
296
295
  * **Official reference:** https://core.telegram.org/bots/api#editmessagelivelocation
297
296
  */
298
- editMessageLiveLocationInline(inline_message_id: string, latitude: number, longitude: number, other?: Other<R, "editMessageLiveLocation", "message_id" | "inline_message_id" | "latitude" | "longitude">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CommonMessage & import("@grammyjs/types/message").MsgWith<"location">)>;
297
+ editMessageLiveLocationInline(inline_message_id: string, latitude: number, longitude: number, other?: Other<R, "editMessageLiveLocation", "chat_id" | "message_id" | "inline_message_id" | "latitude" | "longitude">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CommonMessage & import("@grammyjs/types/message").MsgWith<"location">)>;
299
298
  /**
300
299
  * 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.
301
300
  *
@@ -306,7 +305,7 @@ export declare class Api<R extends RawApi = RawApi> {
306
305
  *
307
306
  * **Official reference:** https://core.telegram.org/bots/api#stopmessagelivelocation
308
307
  */
309
- stopMessageLiveLocation(chat_id: number | string, message_id: number, other?: Other<R, "stopMessageLiveLocation", "message_id" | "inline_message_id">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CommonMessage & import("@grammyjs/types/message").MsgWith<"location">)>;
308
+ stopMessageLiveLocation(chat_id: number | string, message_id: number, other?: Other<R, "stopMessageLiveLocation", "chat_id" | "message_id" | "inline_message_id">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CommonMessage & import("@grammyjs/types/message").MsgWith<"location">)>;
310
309
  /**
311
310
  * 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.
312
311
  *
@@ -316,7 +315,7 @@ export declare class Api<R extends RawApi = RawApi> {
316
315
  *
317
316
  * **Official reference:** https://core.telegram.org/bots/api#stopmessagelivelocation
318
317
  */
319
- stopMessageLiveLocationInline(inline_message_id: string, other?: Other<R, "stopMessageLiveLocation", "message_id" | "inline_message_id">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CommonMessage & import("@grammyjs/types/message").MsgWith<"location">)>;
318
+ stopMessageLiveLocationInline(inline_message_id: string, other?: Other<R, "stopMessageLiveLocation", "chat_id" | "message_id" | "inline_message_id">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CommonMessage & import("@grammyjs/types/message").MsgWith<"location">)>;
320
319
  /**
321
320
  * Use this method to send information about a venue. On success, the sent Message is returned.
322
321
  *
@@ -330,7 +329,7 @@ export declare class Api<R extends RawApi = RawApi> {
330
329
  *
331
330
  * **Official reference:** https://core.telegram.org/bots/api#sendvenue
332
331
  */
333
- sendVenue(chat_id: number | string, latitude: number, longitude: number, title: string, address: string, other?: Other<R, "sendVenue", "latitude" | "longitude" | "title" | "address">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.VenueMessage>;
332
+ sendVenue(chat_id: number | string, latitude: number, longitude: number, title: string, address: string, other?: Other<R, "sendVenue", "chat_id" | "latitude" | "longitude" | "title" | "address">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.VenueMessage>;
334
333
  /**
335
334
  * Use this method to send phone contacts. On success, the sent Message is returned.
336
335
  *
@@ -342,7 +341,7 @@ export declare class Api<R extends RawApi = RawApi> {
342
341
  *
343
342
  * **Official reference:** https://core.telegram.org/bots/api#sendcontact
344
343
  */
345
- sendContact(chat_id: number | string, phone_number: string, first_name: string, other?: Other<R, "sendContact", "phone_number" | "first_name">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.ContactMessage>;
344
+ sendContact(chat_id: number | string, phone_number: string, first_name: string, other?: Other<R, "sendContact", "chat_id" | "phone_number" | "first_name">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.ContactMessage>;
346
345
  /**
347
346
  * Use this method to send a native poll. On success, the sent Message is returned.
348
347
  *
@@ -354,7 +353,7 @@ export declare class Api<R extends RawApi = RawApi> {
354
353
  *
355
354
  * **Official reference:** https://core.telegram.org/bots/api#sendpoll
356
355
  */
357
- sendPoll(chat_id: number | string, question: string, options: readonly string[], other?: Other<R, "sendPoll", "question" | "options">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.PollMessage>;
356
+ sendPoll(chat_id: number | string, question: string, options: readonly string[], other?: Other<R, "sendPoll", "chat_id" | "question" | "options">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.PollMessage>;
358
357
  /**
359
358
  * Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.
360
359
  *
@@ -365,7 +364,7 @@ export declare class Api<R extends RawApi = RawApi> {
365
364
  *
366
365
  * **Official reference:** https://core.telegram.org/bots/api#senddice
367
366
  */
368
- sendDice(chat_id: number | string, emoji: string, other?: Other<R, "sendDice", "emoji">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.DiceMessage>;
367
+ sendDice(chat_id: number | string, emoji: string, other?: Other<R, "sendDice", "chat_id" | "emoji">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.DiceMessage>;
369
368
  /**
370
369
  * 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.
371
370
  *
@@ -413,7 +412,7 @@ export declare class Api<R extends RawApi = RawApi> {
413
412
  *
414
413
  * **Official reference:** https://core.telegram.org/bots/api#banchatmember
415
414
  */
416
- banChatMember(chat_id: number | string, user_id: number, other?: Other<R, "banChatMember", "user_id">, signal?: AbortSignal): Promise<true>;
415
+ banChatMember(chat_id: number | string, user_id: number, other?: Other<R, "banChatMember", "chat_id" | "user_id">, signal?: AbortSignal): Promise<true>;
417
416
  /**
418
417
  * 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.
419
418
  *
@@ -424,7 +423,7 @@ export declare class Api<R extends RawApi = RawApi> {
424
423
  *
425
424
  * **Official reference:** https://core.telegram.org/bots/api#unbanchatmember
426
425
  */
427
- unbanChatMember(chat_id: number | string, user_id: number, other?: Other<R, "unbanChatMember", "user_id">, signal?: AbortSignal): Promise<true>;
426
+ unbanChatMember(chat_id: number | string, user_id: number, other?: Other<R, "unbanChatMember", "chat_id" | "user_id">, signal?: AbortSignal): Promise<true>;
428
427
  /**
429
428
  * 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.
430
429
  *
@@ -436,7 +435,7 @@ export declare class Api<R extends RawApi = RawApi> {
436
435
  *
437
436
  * **Official reference:** https://core.telegram.org/bots/api#restrictchatmember
438
437
  */
439
- restrictChatMember(chat_id: number | string, user_id: number, permissions: ChatPermissions, other?: Other<R, "restrictChatMember", "user_id" | "permissions">, signal?: AbortSignal): Promise<true>;
438
+ restrictChatMember(chat_id: number | string, user_id: number, permissions: ChatPermissions, other?: Other<R, "restrictChatMember", "chat_id" | "user_id" | "permissions">, signal?: AbortSignal): Promise<true>;
440
439
  /**
441
440
  * 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.
442
441
  *
@@ -447,7 +446,7 @@ export declare class Api<R extends RawApi = RawApi> {
447
446
  *
448
447
  * **Official reference:** https://core.telegram.org/bots/api#promotechatmember
449
448
  */
450
- promoteChatMember(chat_id: number | string, user_id: number, other?: Other<R, "promoteChatMember", "user_id">, signal?: AbortSignal): Promise<true>;
449
+ promoteChatMember(chat_id: number | string, user_id: number, other?: Other<R, "promoteChatMember", "chat_id" | "user_id">, signal?: AbortSignal): Promise<true>;
451
450
  /**
452
451
  * Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.
453
452
  *
@@ -509,7 +508,7 @@ export declare class Api<R extends RawApi = RawApi> {
509
508
  *
510
509
  * **Official reference:** https://core.telegram.org/bots/api#createchatinvitelink
511
510
  */
512
- createChatInviteLink(chat_id: number | string, other?: Other<R, "createChatInviteLink">, signal?: AbortSignal): Promise<import("@grammyjs/types/manage").ChatInviteLink>;
511
+ createChatInviteLink(chat_id: number | string, other?: Other<R, "createChatInviteLink", "chat_id">, signal?: AbortSignal): Promise<import("@grammyjs/types/manage").ChatInviteLink>;
513
512
  /**
514
513
  * 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.
515
514
  *
@@ -520,7 +519,7 @@ export declare class Api<R extends RawApi = RawApi> {
520
519
  *
521
520
  * **Official reference:** https://core.telegram.org/bots/api#editchatinvitelink
522
521
  */
523
- editChatInviteLink(chat_id: number | string, invite_link: string, other?: Other<R, "editChatInviteLink", "invite_link">, signal?: AbortSignal): Promise<import("@grammyjs/types/manage").ChatInviteLink>;
522
+ editChatInviteLink(chat_id: number | string, invite_link: string, other?: Other<R, "editChatInviteLink", "chat_id" | "invite_link">, signal?: AbortSignal): Promise<import("@grammyjs/types/manage").ChatInviteLink>;
524
523
  /**
525
524
  * 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.
526
525
  *
@@ -600,7 +599,7 @@ export declare class Api<R extends RawApi = RawApi> {
600
599
  *
601
600
  * **Official reference:** https://core.telegram.org/bots/api#pinchatmessage
602
601
  */
603
- pinChatMessage(chat_id: number | string, message_id: number, other?: Other<R, "pinChatMessage", "message_id">, signal?: AbortSignal): Promise<true>;
602
+ pinChatMessage(chat_id: number | string, message_id: number, other?: Other<R, "pinChatMessage", "chat_id" | "message_id">, signal?: AbortSignal): Promise<true>;
604
603
  /**
605
604
  * 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.
606
605
  *
@@ -700,6 +699,42 @@ export declare class Api<R extends RawApi = RawApi> {
700
699
  * **Official reference:** https://core.telegram.org/bots/api#answercallbackquery
701
700
  */
702
701
  answerCallbackQuery(callback_query_id: string, other?: Other<R, "answerCallbackQuery", "callback_query_id">, signal?: AbortSignal): Promise<true>;
702
+ /**
703
+ * Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success.
704
+ *
705
+ * @param other Optional remaining parameters, confer the official reference below
706
+ * @param signal Optional `AbortSignal` to cancel the request
707
+ *
708
+ * **Official reference:** https://core.telegram.org/bots/api#setchatmenubutton
709
+ */
710
+ setChatMenuButton(other?: Other<R, "setChatMenuButton">, signal?: AbortSignal): Promise<true>;
711
+ /**
712
+ * 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.
713
+ *
714
+ * @param other Optional remaining parameters, confer the official reference below
715
+ * @param signal Optional `AbortSignal` to cancel the request
716
+ *
717
+ * **Official reference:** https://core.telegram.org/bots/api#getchatmenubutton
718
+ */
719
+ getChatMenuButton(other?: Other<R, "getChatMenuButton">, signal?: AbortSignal): Promise<import("@grammyjs/types/menu-button").MenuButton>;
720
+ /**
721
+ * 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.
722
+ *
723
+ * @param other Optional remaining parameters, confer the official reference below
724
+ * @param signal Optional `AbortSignal` to cancel the request
725
+ *
726
+ * **Official reference:** https://core.telegram.org/bots/api#setmydefaultadministratorrights
727
+ */
728
+ setMyDefaultAdministratorRights(other?: Other<R, "setMyDefaultAdministratorRights">, signal?: AbortSignal): Promise<true>;
729
+ /**
730
+ * Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.
731
+ *
732
+ * @param other Optional remaining parameters, confer the official reference below
733
+ * @param signal Optional `AbortSignal` to cancel the request
734
+ *
735
+ * **Official reference:** https://core.telegram.org/bots/api#getmydefaultadministratorrights
736
+ */
737
+ getMyDefaultAdministratorRights(other?: Other<R, "setMyDefaultAdministratorRights">, signal?: AbortSignal): Promise<import("@grammyjs/types/manage").ChatAdministratorRights>;
703
738
  /**
704
739
  * Use this method to change the list of the bot's commands. See https://core.telegram.org/bots#commands for more details about bot commands. Returns True on success.
705
740
  *
@@ -739,7 +774,7 @@ export declare class Api<R extends RawApi = RawApi> {
739
774
  *
740
775
  * **Official reference:** https://core.telegram.org/bots/api#editmessagetext
741
776
  */
742
- editMessageText(chat_id: number | string, message_id: number, text: string, other?: Other<R, "editMessageText", "message_id" | "text">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CommonMessage & import("@grammyjs/types/message").MsgWith<"text">)>;
777
+ editMessageText(chat_id: number | string, message_id: number, text: string, other?: Other<R, "editMessageText", "chat_id" | "message_id" | "inline_message_id" | "text">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CommonMessage & import("@grammyjs/types/message").MsgWith<"text">)>;
743
778
  /**
744
779
  * Use this method to edit text and game inline messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
745
780
  *
@@ -749,7 +784,7 @@ export declare class Api<R extends RawApi = RawApi> {
749
784
  *
750
785
  * **Official reference:** https://core.telegram.org/bots/api#editmessagetext
751
786
  */
752
- editMessageTextInline(inline_message_id: string, text: string, other?: Other<R, "editMessageText", "inline_message_id" | "text">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CommonMessage & import("@grammyjs/types/message").MsgWith<"text">)>;
787
+ editMessageTextInline(inline_message_id: string, text: string, other?: Other<R, "editMessageText", "chat_id" | "message_id" | "inline_message_id" | "text">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CommonMessage & import("@grammyjs/types/message").MsgWith<"text">)>;
753
788
  /**
754
789
  * 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.
755
790
  *
@@ -760,7 +795,7 @@ export declare class Api<R extends RawApi = RawApi> {
760
795
  *
761
796
  * **Official reference:** https://core.telegram.org/bots/api#editmessagecaption
762
797
  */
763
- editMessageCaption(chat_id: number | string, message_id: number, other?: Other<R, "editMessageCaption", "message_id">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CaptionableMessage)>;
798
+ editMessageCaption(chat_id: number | string, message_id: number, other?: Other<R, "editMessageCaption", "chat_id" | "message_id" | "inline_message_id">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CaptionableMessage)>;
764
799
  /**
765
800
  * Use this method to edit captions of inline messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
766
801
  *
@@ -770,7 +805,7 @@ export declare class Api<R extends RawApi = RawApi> {
770
805
  *
771
806
  * **Official reference:** https://core.telegram.org/bots/api#editmessagecaption
772
807
  */
773
- editMessageCaptionInline(inline_message_id: string, other?: Other<R, "editMessageCaption", "inline_message_id">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CaptionableMessage)>;
808
+ editMessageCaptionInline(inline_message_id: string, other?: Other<R, "editMessageCaption", "chat_id" | "message_id" | "inline_message_id">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CaptionableMessage)>;
774
809
  /**
775
810
  * 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.
776
811
  *
@@ -782,7 +817,7 @@ export declare class Api<R extends RawApi = RawApi> {
782
817
  *
783
818
  * **Official reference:** https://core.telegram.org/bots/api#editmessagemedia
784
819
  */
785
- editMessageMedia(chat_id: number | string, message_id: number, media: InputMedia, other?: Other<R, "editMessageMedia", "message_id" | "media">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CaptionableMessage & import("@grammyjs/types/message").MsgWith<"document"> & import("@grammyjs/types/message").MsgWith<"animation">) | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CaptionableMessage & import("@grammyjs/types/message").MsgWith<"audio">) | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CaptionableMessage & import("@grammyjs/types/message").MsgWith<"document">) | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.MediaMessage & import("@grammyjs/types/message").MsgWith<"photo">) | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.MediaMessage & import("@grammyjs/types/message").MsgWith<"video">)>;
820
+ editMessageMedia(chat_id: number | string, message_id: number, media: InputMedia, other?: Other<R, "editMessageMedia", "chat_id" | "message_id" | "inline_message_id" | "media">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CaptionableMessage & import("@grammyjs/types/message").MsgWith<"document"> & import("@grammyjs/types/message").MsgWith<"animation">) | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CaptionableMessage & import("@grammyjs/types/message").MsgWith<"audio">) | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CaptionableMessage & import("@grammyjs/types/message").MsgWith<"document">) | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.MediaMessage & import("@grammyjs/types/message").MsgWith<"photo">) | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.MediaMessage & import("@grammyjs/types/message").MsgWith<"video">)>;
786
821
  /**
787
822
  * 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.
788
823
  *
@@ -793,7 +828,7 @@ export declare class Api<R extends RawApi = RawApi> {
793
828
  *
794
829
  * **Official reference:** https://core.telegram.org/bots/api#editmessagemedia
795
830
  */
796
- editMessageMediaInline(inline_message_id: string, media: InputMedia, other?: Other<R, "editMessageMedia", "inline_message_id" | "media">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CaptionableMessage & import("@grammyjs/types/message").MsgWith<"document"> & import("@grammyjs/types/message").MsgWith<"animation">) | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CaptionableMessage & import("@grammyjs/types/message").MsgWith<"audio">) | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CaptionableMessage & import("@grammyjs/types/message").MsgWith<"document">) | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.MediaMessage & import("@grammyjs/types/message").MsgWith<"photo">) | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.MediaMessage & import("@grammyjs/types/message").MsgWith<"video">)>;
831
+ editMessageMediaInline(inline_message_id: string, media: InputMedia, other?: Other<R, "editMessageMedia", "chat_id" | "message_id" | "inline_message_id" | "media">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CaptionableMessage & import("@grammyjs/types/message").MsgWith<"document"> & import("@grammyjs/types/message").MsgWith<"animation">) | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CaptionableMessage & import("@grammyjs/types/message").MsgWith<"audio">) | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CaptionableMessage & import("@grammyjs/types/message").MsgWith<"document">) | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.MediaMessage & import("@grammyjs/types/message").MsgWith<"photo">) | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.MediaMessage & import("@grammyjs/types/message").MsgWith<"video">)>;
797
832
  /**
798
833
  * 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.
799
834
  *
@@ -804,7 +839,7 @@ export declare class Api<R extends RawApi = RawApi> {
804
839
  *
805
840
  * **Official reference:** https://core.telegram.org/bots/api#editmessagereplymarkup
806
841
  */
807
- editMessageReplyMarkup(chat_id: number | string, message_id: number, other?: Other<R, "editMessageReplyMarkup", "message_id">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message)>;
842
+ editMessageReplyMarkup(chat_id: number | string, message_id: number, other?: Other<R, "editMessageReplyMarkup", "chat_id" | "message_id" | "inline_message_id">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message)>;
808
843
  /**
809
844
  * Use this method to edit only the reply markup of inline messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
810
845
  *
@@ -814,7 +849,7 @@ export declare class Api<R extends RawApi = RawApi> {
814
849
  *
815
850
  * **Official reference:** https://core.telegram.org/bots/api#editmessagereplymarkup
816
851
  */
817
- editMessageReplyMarkupInline(inline_message_id: string, other?: Other<R, "editMessageReplyMarkup", "inline_message_id">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message)>;
852
+ editMessageReplyMarkupInline(inline_message_id: string, other?: Other<R, "editMessageReplyMarkup", "chat_id" | "message_id" | "inline_message_id">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message)>;
818
853
  /**
819
854
  * Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.
820
855
  *
@@ -825,7 +860,7 @@ export declare class Api<R extends RawApi = RawApi> {
825
860
  *
826
861
  * **Official reference:** https://core.telegram.org/bots/api#stoppoll
827
862
  */
828
- stopPoll(chat_id: number | string, message_id: number, other?: Other<R, "stopPoll", "message_id">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Poll>;
863
+ stopPoll(chat_id: number | string, message_id: number, other?: Other<R, "stopPoll", "chat_id" | "message_id">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Poll>;
829
864
  /**
830
865
  * Use this method to delete a message, including service messages, with the following limitations:
831
866
  * - A message can only be deleted if it was sent less than 48 hours ago.
@@ -854,7 +889,7 @@ export declare class Api<R extends RawApi = RawApi> {
854
889
  *
855
890
  * **Official reference:** https://core.telegram.org/bots/api#sendsticker
856
891
  */
857
- sendSticker(chat_id: number | string, sticker: InputFile | string, other?: Other<R, "sendSticker", "sticker">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.StickerMessage>;
892
+ sendSticker(chat_id: number | string, sticker: InputFile | string, other?: Other<R, "sendSticker", "chat_id" | "sticker">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.StickerMessage>;
858
893
  /**
859
894
  * Use this method to get a sticker set. On success, a StickerSet object is returned.
860
895
  *
@@ -943,6 +978,16 @@ export declare class Api<R extends RawApi = RawApi> {
943
978
  * **Official reference:** https://core.telegram.org/bots/api#answerinlinequery
944
979
  */
945
980
  answerInlineQuery(inline_query_id: string, results: readonly InlineQueryResult[], other?: Other<R, "answerInlineQuery", "inline_query_id" | "results">, signal?: AbortSignal): Promise<true>;
981
+ /**
982
+ * Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated. On success, a SentWebAppMessage object is returned.
983
+ *
984
+ * @param web_app_query_id Unique identifier for the query to be answered
985
+ * @param result An object describing the message to be sent
986
+ * @param signal Optional `AbortSignal` to cancel the request
987
+ *
988
+ * **Official reference:** https://core.telegram.org/bots/api#answerinlinequery
989
+ */
990
+ answerWebAppQuery(web_app_query_id: string, result: InlineQueryResult, signal?: AbortSignal): Promise<import("@grammyjs/types/message").SentWebAppMessage>;
946
991
  /**
947
992
  * Use this method to send invoices. On success, the sent Message is returned.
948
993
  *
@@ -958,7 +1003,7 @@ export declare class Api<R extends RawApi = RawApi> {
958
1003
  *
959
1004
  * **Official reference:** https://core.telegram.org/bots/api#sendinvoice
960
1005
  */
961
- sendInvoice(chat_id: number | string, title: string, description: string, payload: string, provider_token: string, currency: string, prices: readonly LabeledPrice[], other?: Other<R, "sendInvoice", "title" | "description" | "payload" | "provider_token" | "currency" | "prices">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.InvoiceMessage>;
1006
+ sendInvoice(chat_id: number | string, title: string, description: string, payload: string, provider_token: string, currency: string, prices: readonly LabeledPrice[], other?: Other<R, "sendInvoice", "chat_id" | "title" | "description" | "payload" | "provider_token" | "currency" | "prices">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.InvoiceMessage>;
962
1007
  /**
963
1008
  * 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.
964
1009
  *
@@ -1003,7 +1048,7 @@ export declare class Api<R extends RawApi = RawApi> {
1003
1048
  *
1004
1049
  * **Official reference:** https://core.telegram.org/bots/api#sendgame
1005
1050
  */
1006
- sendGame(chat_id: number, game_short_name: string, other?: Other<R, "sendGame", "game_short_name">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.GameMessage>;
1051
+ sendGame(chat_id: number, game_short_name: string, other?: Other<R, "sendGame", "chat_id" | "game_short_name">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.GameMessage>;
1007
1052
  /**
1008
1053
  * Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the Message is returned, otherwise True is returned. Returns an error, if the new score is not greater than the user's current score in the chat and force is False.
1009
1054
  *
@@ -1016,7 +1061,7 @@ export declare class Api<R extends RawApi = RawApi> {
1016
1061
  *
1017
1062
  * **Official reference:** https://core.telegram.org/bots/api#setgamescore
1018
1063
  */
1019
- setGameScore(chat_id: number, message_id: number, user_id: number, score: number, other?: Other<R, "setGameScore", "message_id" | "user_id" | "score">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CommonMessage & import("@grammyjs/types/message").MsgWith<"game">)>;
1064
+ setGameScore(chat_id: number, message_id: number, user_id: number, score: number, other?: Other<R, "setGameScore", "chat_id" | "message_id" | "inline_message_id" | "user_id" | "score">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CommonMessage & import("@grammyjs/types/message").MsgWith<"game">)>;
1020
1065
  /**
1021
1066
  * Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the Message is returned, otherwise True is returned. Returns an error, if the new score is not greater than the user's current score in the chat and force is False.
1022
1067
  *
@@ -1028,7 +1073,7 @@ export declare class Api<R extends RawApi = RawApi> {
1028
1073
  *
1029
1074
  * **Official reference:** https://core.telegram.org/bots/api#setgamescore
1030
1075
  */
1031
- setGameScoreInline(inline_message_id: string, user_id: number, score: number, other?: Other<R, "setGameScore", "inline_message_id" | "user_id" | "score">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CommonMessage & import("@grammyjs/types/message").MsgWith<"game">)>;
1076
+ setGameScoreInline(inline_message_id: string, user_id: number, score: number, other?: Other<R, "setGameScore", "chat_id" | "message_id" | "inline_message_id" | "user_id" | "score">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update").Update.Edited & import("@grammyjs/types/message").Message.CommonMessage & import("@grammyjs/types/message").MsgWith<"game">)>;
1032
1077
  /**
1033
1078
  * Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an Array of GameHighScore objects.
1034
1079
  *
@@ -1056,4 +1101,3 @@ export declare class Api<R extends RawApi = RawApi> {
1056
1101
  getGameHighScoresInline(inline_message_id: string, user_id: number, signal?: AbortSignal): Promise<import("@grammyjs/types/message").GameHighScore[]>;
1057
1102
  }
1058
1103
  import { AbortSignal } from "../shim.node.js";
1059
- export {};
package/out/core/api.js CHANGED
@@ -790,6 +790,50 @@ class Api {
790
790
  answerCallbackQuery(callback_query_id, other, signal) {
791
791
  return this.raw.answerCallbackQuery({ callback_query_id, ...other }, signal);
792
792
  }
793
+ /**
794
+ * Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success.
795
+ *
796
+ * @param other Optional remaining parameters, confer the official reference below
797
+ * @param signal Optional `AbortSignal` to cancel the request
798
+ *
799
+ * **Official reference:** https://core.telegram.org/bots/api#setchatmenubutton
800
+ */
801
+ setChatMenuButton(other, signal) {
802
+ return this.raw.setChatMenuButton({ ...other }, signal);
803
+ }
804
+ /**
805
+ * 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.
806
+ *
807
+ * @param other Optional remaining parameters, confer the official reference below
808
+ * @param signal Optional `AbortSignal` to cancel the request
809
+ *
810
+ * **Official reference:** https://core.telegram.org/bots/api#getchatmenubutton
811
+ */
812
+ getChatMenuButton(other, signal) {
813
+ return this.raw.getChatMenuButton({ ...other }, signal);
814
+ }
815
+ /**
816
+ * 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.
817
+ *
818
+ * @param other Optional remaining parameters, confer the official reference below
819
+ * @param signal Optional `AbortSignal` to cancel the request
820
+ *
821
+ * **Official reference:** https://core.telegram.org/bots/api#setmydefaultadministratorrights
822
+ */
823
+ setMyDefaultAdministratorRights(other, signal) {
824
+ return this.raw.setMyDefaultAdministratorRights({ ...other }, signal);
825
+ }
826
+ /**
827
+ * Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.
828
+ *
829
+ * @param other Optional remaining parameters, confer the official reference below
830
+ * @param signal Optional `AbortSignal` to cancel the request
831
+ *
832
+ * **Official reference:** https://core.telegram.org/bots/api#getmydefaultadministratorrights
833
+ */
834
+ getMyDefaultAdministratorRights(other, signal) {
835
+ return this.raw.getMyDefaultAdministratorRights({ ...other }, signal);
836
+ }
793
837
  /**
794
838
  * Use this method to change the list of the bot's commands. See https://core.telegram.org/bots#commands for more details about bot commands. Returns True on success.
795
839
  *
@@ -1077,6 +1121,18 @@ class Api {
1077
1121
  answerInlineQuery(inline_query_id, results, other, signal) {
1078
1122
  return this.raw.answerInlineQuery({ inline_query_id, results, ...other }, signal);
1079
1123
  }
1124
+ /**
1125
+ * Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated. On success, a SentWebAppMessage object is returned.
1126
+ *
1127
+ * @param web_app_query_id Unique identifier for the query to be answered
1128
+ * @param result An object describing the message to be sent
1129
+ * @param signal Optional `AbortSignal` to cancel the request
1130
+ *
1131
+ * **Official reference:** https://core.telegram.org/bots/api#answerinlinequery
1132
+ */
1133
+ answerWebAppQuery(web_app_query_id, result, signal) {
1134
+ return this.raw.answerWebAppQuery({ web_app_query_id, result }, signal);
1135
+ }
1080
1136
  /**
1081
1137
  * Use this method to send invoices. On success, the sent Message is returned.
1082
1138
  *
@@ -18,7 +18,7 @@ class ApiClient {
18
18
  this.installedTransformers = [];
19
19
  this.call = async (method, p, signal) => {
20
20
  const payload = p !== null && p !== void 0 ? p : {};
21
- debug("Calling", method);
21
+ debug(`Calling ${method}`);
22
22
  // General config
23
23
  const opts = this.options;
24
24
  const formDataRequired = (0, payload_js_1.requiresFormDataUpload)(payload);
@@ -44,8 +44,7 @@ class ApiClient {
44
44
  const sig = controller.signal;
45
45
  const options = { ...opts.baseFetchConfig, signal: sig, ...config };
46
46
  // Perform fetch call, and handle networking errors
47
- const successPromise = (0, shim_node_js_1.fetch)(url instanceof URL ? url.href : url, options)
48
- .catch((0, error_js_1.toHttpError)(method, opts.sensitiveLogs));
47
+ const successPromise = (0, shim_node_js_1.fetch)(url instanceof URL ? url.href : url, options).catch((0, error_js_1.toHttpError)(method, opts.sensitiveLogs));
49
48
  // Those are the three possible outcomes of the fetch call:
50
49
  const operations = [successPromise, streamErr.promise, timeout.promise];
51
50
  // Wait for result
@@ -119,7 +119,7 @@ async function* payloadToMultipartItr(payload, boundary) {
119
119
  first = false;
120
120
  }
121
121
  // End multipart/form-data protocol
122
- yield enc.encode(`\r\n--${boundary}--`);
122
+ yield enc.encode(`\r\n--${boundary}--\r\n`);
123
123
  }
124
124
  /**
125
125
  * Replaces all instances of `InputFile` in a given payload by attach://
@@ -164,7 +164,7 @@ or newline (\\n) characters! Filename for property '${origin}' was:
164
164
  ${filename}
165
165
  """`);
166
166
  }
167
- yield enc.encode(`content-disposition:form-data;name="${id}";filename=${filename}\r\n\r\n`);
167
+ yield enc.encode(`content-disposition:form-data;name="${id}";filename=${filename}\r\ncontent-type:application/octet-stream\r\n\r\n`);
168
168
  const data = await input[platform_node_js_1.toRaw]();
169
169
  if (data instanceof Uint8Array)
170
170
  yield data;