grammy 1.42.0 → 1.43.0
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 +3 -2
- package/out/bot.d.ts +1 -1
- package/out/bot.js +1 -0
- package/out/context.d.ts +157 -47
- package/out/context.js +236 -74
- package/out/convenience/constants.d.ts +2 -1
- package/out/convenience/constants.js +1 -0
- package/out/convenience/frameworks.d.ts +1 -0
- package/out/convenience/frameworks.js +21 -17
- package/out/core/api.d.ts +236 -137
- package/out/core/api.js +280 -141
- package/out/filter.d.ts +200 -4
- package/out/filter.js +5 -1
- package/out/types.node.d.ts +44 -10
- package/out/web.mjs +191 -61
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
<!-- deno-fmt-ignore-start -->
|
|
12
12
|
|
|
13
|
-
[](https://core.telegram.org/bots/api)
|
|
14
14
|
[](https://deno.land/x/grammy)
|
|
15
15
|
[](https://www.npmjs.org/package/grammy)
|
|
16
16
|
[](#contributors-)
|
|
@@ -332,7 +332,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
332
332
|
<td align="center" valign="top" width="11.11%"><a href="https://agou.im/"><img src="https://avatars.githubusercontent.com/u/55237525?v=4?s=100" width="100px;" alt="agoudbg"/><br /><sub><b>agoudbg</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Aagoudbg" title="Bug reports">🐛</a> <a href="https://github.com/grammyjs/grammY/commits?author=agoudbg" title="Code">💻</a></td>
|
|
333
333
|
<td align="center" valign="top" width="11.11%"><a href="https://github.com/crwnd"><img src="https://avatars.githubusercontent.com/u/97118277?v=4?s=100" width="100px;" alt="A"/><br /><sub><b>A</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Acrwnd" title="Bug reports">🐛</a> <a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3Acrwnd" title="Reviewed Pull Requests">👀</a></td>
|
|
334
334
|
<td align="center" valign="top" width="11.11%"><a href="http://www.linkedin.com/in/huntharo/"><img src="https://avatars.githubusercontent.com/u/5617868?v=4?s=100" width="100px;" alt="Harold Hunt"/><br /><sub><b>Harold Hunt</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Ahuntharo" title="Bug reports">🐛</a> <a href="https://github.com/grammyjs/grammY/commits?author=huntharo" title="Code">💻</a> <a href="https://github.com/grammyjs/grammY/commits?author=huntharo" title="Tests">⚠️</a></td>
|
|
335
|
-
<td align="center" valign="top" width="11.11%"><a href="https://glacierphonk.com"><img src="https://avatars.githubusercontent.com/u/260244336?v=4?s=100" width="100px;" alt="GlacierPhonk™"/><br /><sub><b>GlacierPhonk™</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Aglacierphonk" title="Bug reports">🐛</a> <a href="https://github.com/grammyjs/grammY/commits?author=glacierphonk" title="Code">💻</a> <a href="#maintenance-glacierphonk" title="Maintenance">🚧</a></td>
|
|
335
|
+
<td align="center" valign="top" width="11.11%"><a href="https://glacierphonk.com"><img src="https://avatars.githubusercontent.com/u/260244336?v=4?s=100" width="100px;" alt="GlacierPhonk™"/><br /><sub><b>GlacierPhonk™</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Aglacierphonk" title="Bug reports">🐛</a> <a href="https://github.com/grammyjs/grammY/commits?author=glacierphonk" title="Code">💻</a> <a href="#maintenance-glacierphonk" title="Maintenance">🚧</a> <a href="#ideas-glacierphonk" title="Ideas, Planning, & Feedback">🤔</a></td>
|
|
336
|
+
<td align="center" valign="top" width="11.11%"><a href="https://ea.sa"><img src="https://avatars.githubusercontent.com/u/14023814?v=4?s=100" width="100px;" alt="Dramex"/><br /><sub><b>Dramex</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3ADramex" title="Bug reports">🐛</a> <a href="https://github.com/grammyjs/grammY/commits?author=Dramex" title="Code">💻</a></td>
|
|
336
337
|
</tr>
|
|
337
338
|
</tbody>
|
|
338
339
|
</table>
|
package/out/bot.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { Api } from "./core/api.js";
|
|
|
4
4
|
import { type ApiClientOptions, type WebhookReplyEnvelope } from "./core/client.js";
|
|
5
5
|
import { type Filter, type FilterQuery } from "./filter.js";
|
|
6
6
|
import { type ReactionType, type ReactionTypeEmoji, type Update, type UserFromGetMe } from "./types.js";
|
|
7
|
-
export declare const DEFAULT_UPDATE_TYPES: readonly ["message", "edited_message", "channel_post", "edited_channel_post", "business_connection", "business_message", "edited_business_message", "deleted_business_messages", "inline_query", "chosen_inline_result", "callback_query", "shipping_query", "pre_checkout_query", "purchased_paid_media", "poll", "poll_answer", "my_chat_member", "managed_bot", "chat_join_request", "chat_boost", "removed_chat_boost"];
|
|
7
|
+
export declare const DEFAULT_UPDATE_TYPES: readonly ["message", "edited_message", "channel_post", "edited_channel_post", "business_connection", "business_message", "edited_business_message", "deleted_business_messages", "guest_message", "inline_query", "chosen_inline_result", "callback_query", "shipping_query", "pre_checkout_query", "purchased_paid_media", "poll", "poll_answer", "my_chat_member", "managed_bot", "chat_join_request", "chat_boost", "removed_chat_boost"];
|
|
8
8
|
/**
|
|
9
9
|
* Options that can be specified when running the bot via simple long polling.
|
|
10
10
|
*/
|
package/out/bot.js
CHANGED
package/out/context.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Api, type Other as OtherApi } from "./core/api.js";
|
|
2
2
|
import { type Methods, type RawApi } from "./core/client.js";
|
|
3
3
|
import { type Filter, type FilterCore, type FilterQuery } from "./filter.js";
|
|
4
|
-
import { type AcceptedGiftTypes, type Chat, type ChatPermissions, type InlineQueryResult, type InputChecklist, type InputFile, type InputMedia, type InputMediaAudio, type InputMediaDocument, type InputMediaPhoto, type InputMediaVideo, type InputPaidMedia, type InputPollOption, type InputProfilePhoto, type InputStoryContent, type KeyboardButton, type LabeledPrice, type Message, type MessageEntity, type PassportElementError, type ReactionType, type ReactionTypeEmoji, type Update, type User, type UserFromGetMe } from "./types.js";
|
|
4
|
+
import { type AcceptedGiftTypes, type Chat, type ChatPermissions, type InlineQueryResult, type InputChecklist, type InputFile, type InputMedia, type InputMediaAudio, type InputMediaDocument, type InputMediaLivePhoto, type InputMediaPhoto, type InputMediaVideo, type InputPaidMedia, type InputPollOption, type InputProfilePhoto, type InputStoryContent, type KeyboardButton, type LabeledPrice, type Message, type MessageEntity, type PassportElementError, type ReactionType, type ReactionTypeEmoji, type Update, type User, type UserFromGetMe } from "./types.js";
|
|
5
5
|
export type MaybeArray<T> = T | T[];
|
|
6
6
|
/** permits `string` but gives hints */
|
|
7
7
|
export type StringWithCommandSuggestions = (string & Record<never, never>) | "start" | "help" | "settings" | "privacy" | "developer_info";
|
|
@@ -188,6 +188,8 @@ export declare class Context implements RenamedUpdate {
|
|
|
188
188
|
get editedBusinessMessage(): (Message & Update.Edited & Update.Private) | undefined;
|
|
189
189
|
/** Alias for `ctx.update.deleted_business_messages` */
|
|
190
190
|
get deletedBusinessMessages(): import("@grammyjs/types/manage.js").BusinessMessagesDeleted | undefined;
|
|
191
|
+
/** Alias for `ctx.update.guest_message` */
|
|
192
|
+
get guestMessage(): (Message & Update.NonChannel) | undefined;
|
|
191
193
|
/** Alias for `ctx.update.message_reaction` */
|
|
192
194
|
get messageReaction(): import("@grammyjs/types/message.js").MessageReactionUpdated | undefined;
|
|
193
195
|
/** Alias for `ctx.update.message_reaction_count` */
|
|
@@ -241,7 +243,7 @@ export declare class Context implements RenamedUpdate {
|
|
|
241
243
|
get senderChat(): Chat | undefined;
|
|
242
244
|
/**
|
|
243
245
|
* Get the user object from wherever possible. Alias for
|
|
244
|
-
* `(this.businessConnection ?? this.messageReaction ??
|
|
246
|
+
* `(this.businessConnection ?? this.messageReaction ?? this.managedBot ??
|
|
245
247
|
* (this.chatBoost?.boost ?? this.removedChatBoost)?.source)?.user ??
|
|
246
248
|
* (this.callbackQuery ?? this.msg ?? this.inlineQuery ??
|
|
247
249
|
* this.chosenInlineResult ?? this.shippingQuery ?? this.preCheckoutQuery ??
|
|
@@ -474,20 +476,10 @@ export declare class Context implements RenamedUpdate {
|
|
|
474
476
|
* **Official reference:** https://core.telegram.org/bots/api#sendmessage
|
|
475
477
|
*/
|
|
476
478
|
reply(text: string, other?: Other<"sendMessage", "chat_id" | "text">, signal?: AbortSignal): Promise<Message.TextMessage>;
|
|
477
|
-
/**
|
|
478
|
-
* Context-aware alias for `api.sendMessageDraft`. Use this method to stream a partial message to a user while the message is being generated. Returns True on success.
|
|
479
|
-
*
|
|
480
|
-
* @param text Text of the message to be sent, 1-4096 characters after entities parsing
|
|
481
|
-
* @param other Optional remaining parameters, confer the official reference below
|
|
482
|
-
* @param signal Optional `AbortSignal` to cancel the request
|
|
483
|
-
*
|
|
484
|
-
* **Official reference:** https://core.telegram.org/bots/api#sendmessagedraft
|
|
485
|
-
*/
|
|
486
|
-
replyWithDraft(text: string, other?: Other<"sendMessageDraft", "chat_id" | "text">, signal?: AbortSignal): Promise<true>;
|
|
487
479
|
/**
|
|
488
480
|
* Context-aware alias for `api.forwardMessage`. Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent Message is returned.
|
|
489
481
|
*
|
|
490
|
-
* @param chat_id Unique identifier for the target chat or username of the target channel
|
|
482
|
+
* @param chat_id Unique identifier for the target chat or username of the target bot, supergroup or channel in the format `@username`
|
|
491
483
|
* @param other Optional remaining parameters, confer the official reference below
|
|
492
484
|
* @param signal Optional `AbortSignal` to cancel the request
|
|
493
485
|
*
|
|
@@ -497,7 +489,7 @@ export declare class Context implements RenamedUpdate {
|
|
|
497
489
|
/**
|
|
498
490
|
* Context-aware alias for `api.forwardMessages`. Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of MessageId of the sent messages is returned.
|
|
499
491
|
*
|
|
500
|
-
* @param chat_id Unique identifier for the target chat or username of the target channel
|
|
492
|
+
* @param chat_id Unique identifier for the target chat or username of the target bot, supergroup or channel in the format `@username`
|
|
501
493
|
* @param message_ids A list of 1-100 identifiers of messages in the current chat to forward. The identifiers must be specified in a strictly increasing order.
|
|
502
494
|
* @param other Optional remaining parameters, confer the official reference below
|
|
503
495
|
* @param signal Optional `AbortSignal` to cancel the request
|
|
@@ -508,7 +500,7 @@ export declare class Context implements RenamedUpdate {
|
|
|
508
500
|
/**
|
|
509
501
|
* Context-aware alias for `api.copyMessage`. Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success.
|
|
510
502
|
*
|
|
511
|
-
* @param chat_id Unique identifier for the target chat or username of the target channel
|
|
503
|
+
* @param chat_id Unique identifier for the target chat or username of the target bot, supergroup or channel in the format `@username`
|
|
512
504
|
* @param other Optional remaining parameters, confer the official reference below
|
|
513
505
|
* @param signal Optional `AbortSignal` to cancel the request
|
|
514
506
|
*
|
|
@@ -518,7 +510,7 @@ export declare class Context implements RenamedUpdate {
|
|
|
518
510
|
/**
|
|
519
511
|
* Context-aware alias for `api.copyMessages`. Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of MessageId of the sent messages is returned.
|
|
520
512
|
*
|
|
521
|
-
* @param chat_id Unique identifier for the target chat or username of the target channel
|
|
513
|
+
* @param chat_id Unique identifier for the target chat or username of the target bot, supergroup or channel in the format `@username`
|
|
522
514
|
* @param message_ids A list of 1-100 identifiers of messages in the current chat to copy. The identifiers must be specified in a strictly increasing order.
|
|
523
515
|
* @param other Optional remaining parameters, confer the official reference below
|
|
524
516
|
* @param signal Optional `AbortSignal` to cancel the request
|
|
@@ -536,6 +528,17 @@ export declare class Context implements RenamedUpdate {
|
|
|
536
528
|
* **Official reference:** https://core.telegram.org/bots/api#sendphoto
|
|
537
529
|
*/
|
|
538
530
|
replyWithPhoto(photo: InputFile | string, other?: Other<"sendPhoto", "chat_id" | "photo">, signal?: AbortSignal): Promise<Message.PhotoMessage>;
|
|
531
|
+
/**
|
|
532
|
+
* Context-aware alias for `api.sendLivePhoto`. Use this method to send live photos. On success, the sent Message is returned.
|
|
533
|
+
*
|
|
534
|
+
* @param live_photo Live photo video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. Sending live photos by a URL is currently unsupported.
|
|
535
|
+
* @param photo The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. Sending live photos by a URL is currently unsupported.
|
|
536
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
537
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
538
|
+
*
|
|
539
|
+
* **Official reference:** https://core.telegram.org/bots/api#sendlivephoto
|
|
540
|
+
*/
|
|
541
|
+
replyWithLivePhoto(live_photo: InputFile | string, photo: InputFile | string, other?: Other<"sendLivePhoto", "chat_id" | "live_photo" | "photo">, signal?: AbortSignal): Promise<Message.LivePhotoMessage>;
|
|
539
542
|
/**
|
|
540
543
|
* 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.
|
|
541
544
|
*
|
|
@@ -599,6 +602,19 @@ export declare class Context implements RenamedUpdate {
|
|
|
599
602
|
* **Official reference:** https://core.telegram.org/bots/api#sendvideonote
|
|
600
603
|
*/
|
|
601
604
|
replyWithVideoNote(video_note: InputFile | string, other?: Other<"sendVideoNote", "chat_id" | "video_note">, signal?: AbortSignal): Promise<Message.VideoNoteMessage>;
|
|
605
|
+
/** @deprecated Use `replyWithPaidMedia` instead. */
|
|
606
|
+
sendPaidMedia(...args: Parameters<Context["replyWithPaidMedia"]>): Promise<Message.PaidMediaMessage>;
|
|
607
|
+
/**
|
|
608
|
+
* Context-aware alias for `api.sendPaidMedia`. Use this method to send paid media. On success, the sent Message is returned.
|
|
609
|
+
*
|
|
610
|
+
* @param star_count The number of Telegram Stars that must be paid to buy access to the media
|
|
611
|
+
* @param media An array describing the media to be sent; up to 10 items
|
|
612
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
613
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
614
|
+
*
|
|
615
|
+
* **Official reference:** https://core.telegram.org/bots/api#sendpaidmedia
|
|
616
|
+
*/
|
|
617
|
+
replyWithPaidMedia(star_count: number, media: InputPaidMedia[], other?: Other<"sendPaidMedia", "chat_id" | "star_count" | "media">, signal?: AbortSignal): Promise<Message.PaidMediaMessage>;
|
|
602
618
|
/**
|
|
603
619
|
* 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.
|
|
604
620
|
*
|
|
@@ -608,7 +624,7 @@ export declare class Context implements RenamedUpdate {
|
|
|
608
624
|
*
|
|
609
625
|
* **Official reference:** https://core.telegram.org/bots/api#sendmediagroup
|
|
610
626
|
*/
|
|
611
|
-
replyWithMediaGroup(media: ReadonlyArray<InputMediaAudio | InputMediaDocument | InputMediaPhoto | InputMediaVideo>, other?: Other<"sendMediaGroup", "chat_id" | "media">, signal?: AbortSignal): Promise<(Message.PhotoMessage | Message.AudioMessage | Message.DocumentMessage | Message.VideoMessage)[]>;
|
|
627
|
+
replyWithMediaGroup(media: ReadonlyArray<InputMediaAudio | InputMediaDocument | InputMediaLivePhoto | InputMediaPhoto | InputMediaVideo>, other?: Other<"sendMediaGroup", "chat_id" | "media">, signal?: AbortSignal): Promise<(Message.PhotoMessage | Message.LivePhotoMessage | Message.AudioMessage | Message.DocumentMessage | Message.VideoMessage)[]>;
|
|
612
628
|
/**
|
|
613
629
|
* Context-aware alias for `api.sendLocation`. Use this method to send point on the map. On success, the sent Message is returned.
|
|
614
630
|
*
|
|
@@ -644,17 +660,6 @@ export declare class Context implements RenamedUpdate {
|
|
|
644
660
|
stopMessageLiveLocation(other?: Other<"stopMessageLiveLocation", "chat_id" | "message_id" | "inline_message_id">, signal?: AbortSignal): Promise<true | (Update.Edited & Message.CommonMessage & {
|
|
645
661
|
location: import("@grammyjs/types/message.js").Location;
|
|
646
662
|
})>;
|
|
647
|
-
/**
|
|
648
|
-
* Context-aware alias for `api.sendPaidMedia`. Use this method to send paid media. On success, the sent Message is returned.
|
|
649
|
-
*
|
|
650
|
-
* @param star_count The number of Telegram Stars that must be paid to buy access to the media
|
|
651
|
-
* @param media An array describing the media to be sent; up to 10 items
|
|
652
|
-
* @param other Optional remaining parameters, confer the official reference below
|
|
653
|
-
* @param signal Optional `AbortSignal` to cancel the request
|
|
654
|
-
*
|
|
655
|
-
* **Official reference:** https://core.telegram.org/bots/api#sendpaidmedia
|
|
656
|
-
*/
|
|
657
|
-
sendPaidMedia(star_count: number, media: InputPaidMedia[], other?: Other<"sendPaidMedia", "chat_id" | "star_count" | "media">, signal?: AbortSignal): Promise<Message.PaidMediaMessage>;
|
|
658
663
|
/**
|
|
659
664
|
* Context-aware alias for `api.sendVenue`. Use this method to send information about a venue. On success, the sent Message is returned.
|
|
660
665
|
*
|
|
@@ -683,7 +688,7 @@ export declare class Context implements RenamedUpdate {
|
|
|
683
688
|
* Context-aware alias for `api.sendPoll`. Use this method to send a native poll. On success, the sent Message is returned.
|
|
684
689
|
*
|
|
685
690
|
* @param question Poll question, 1-300 characters
|
|
686
|
-
* @param options A list of answer options,
|
|
691
|
+
* @param options A list of answer options, 1-12 strings 1-100 characters each
|
|
687
692
|
* @param other Optional remaining parameters, confer the official reference below
|
|
688
693
|
* @param signal Optional `AbortSignal` to cancel the request
|
|
689
694
|
*
|
|
@@ -744,6 +749,16 @@ export declare class Context implements RenamedUpdate {
|
|
|
744
749
|
* **Official reference:** https://core.telegram.org/bots/api#setmessagereaction
|
|
745
750
|
*/
|
|
746
751
|
react(reaction: MaybeArray<ReactionTypeEmoji["emoji"] | ReactionType>, other?: Other<"setMessageReaction", "chat_id" | "message_id" | "reaction">, signal?: AbortSignal): Promise<true>;
|
|
752
|
+
/**
|
|
753
|
+
* Context-aware alias for `api.sendMessageDraft`. Use this method to stream a partial message to a user while the message is being generated. Returns True on success.
|
|
754
|
+
*
|
|
755
|
+
* @param text Text of the message to be sent, 1-4096 characters after entities parsing
|
|
756
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
757
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
758
|
+
*
|
|
759
|
+
* **Official reference:** https://core.telegram.org/bots/api#sendmessagedraft
|
|
760
|
+
*/
|
|
761
|
+
replyWithDraft(text: string, other?: Other<"sendMessageDraft", "chat_id" | "text">, signal?: AbortSignal): Promise<true>;
|
|
747
762
|
/**
|
|
748
763
|
* Context-aware alias for `api.getUserProfilePhotos`. Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.
|
|
749
764
|
*
|
|
@@ -805,6 +820,40 @@ export declare class Context implements RenamedUpdate {
|
|
|
805
820
|
* **Official reference:** https://core.telegram.org/bots/api#getbusinessconnection
|
|
806
821
|
*/
|
|
807
822
|
getBusinessConnection(signal?: AbortSignal): Promise<import("@grammyjs/types/manage.js").BusinessConnection>;
|
|
823
|
+
/**
|
|
824
|
+
* Context-aware alias for `api.getManagedBotToken`. Use this method to get the token of a managed bot. Returns the token as String on success.
|
|
825
|
+
*
|
|
826
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
827
|
+
*
|
|
828
|
+
* **Official reference:** https://core.telegram.org/bots/api#getmanagedbottoken
|
|
829
|
+
*/
|
|
830
|
+
getManagedBotToken(signal?: AbortSignal): Promise<string>;
|
|
831
|
+
/**
|
|
832
|
+
* Context-aware alias for `api.replaceManagedBotToken`. Use this method to revoke the current token of a managed bot and generate a new one. Returns the new token as String on success.
|
|
833
|
+
*
|
|
834
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
835
|
+
*
|
|
836
|
+
* **Official reference:** https://core.telegram.org/bots/api#replacemanagedbottoken
|
|
837
|
+
*/
|
|
838
|
+
replaceManagedBotToken(signal?: AbortSignal): Promise<string>;
|
|
839
|
+
/**
|
|
840
|
+
* Context-aware alias for `api.getManagedBotAccessSettings`. Use this method to get the access settings of a managed bot. Returns a BotAccessSettings object on success.
|
|
841
|
+
*
|
|
842
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
843
|
+
*
|
|
844
|
+
* **Official reference:** https://core.telegram.org/bots/api#getmanagedbotaccesssettings
|
|
845
|
+
*/
|
|
846
|
+
getManagedBotAccessSettings(signal?: AbortSignal): Promise<import("@grammyjs/types/payment.js").BotAccessSettings>;
|
|
847
|
+
/**
|
|
848
|
+
* Context-aware alias for `api.setManagedBotAccessSettings`. Use this method to change the access settings of a managed bot. Returns True on success.
|
|
849
|
+
*
|
|
850
|
+
* @param is_access_restricted Pass True, if only selected users can access the bot
|
|
851
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
852
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
853
|
+
*
|
|
854
|
+
* **Official reference:** https://core.telegram.org/bots/api#setmanagedbotaccesssettingsrestricted
|
|
855
|
+
*/
|
|
856
|
+
setManagedBotAccessSettings(is_access_restricted: boolean, other?: Other<"setManagedBotAccessSettings", "user_id" | "is_access_restricted">, signal?: AbortSignal): Promise<true>;
|
|
808
857
|
/**
|
|
809
858
|
* Context-aware alias for `api.getFile`. Use this method to get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a File object is returned. The file can then be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>, where <file_path> is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile again.
|
|
810
859
|
*
|
|
@@ -1013,22 +1062,6 @@ export declare class Context implements RenamedUpdate {
|
|
|
1013
1062
|
* **Official reference:** https://core.telegram.org/bots/api#revokechatinvitelink
|
|
1014
1063
|
*/
|
|
1015
1064
|
revokeChatInviteLink(invite_link: string, signal?: AbortSignal): Promise<import("@grammyjs/types/manage.js").ChatInviteLink>;
|
|
1016
|
-
/**
|
|
1017
|
-
* Context-aware alias for `api.getManagedBotToken`. Use this method to get the token of a managed bot. Returns the token as String on success.
|
|
1018
|
-
*
|
|
1019
|
-
* @param signal Optional `AbortSignal` to cancel the request
|
|
1020
|
-
*
|
|
1021
|
-
* **Official reference:** https://core.telegram.org/bots/api#getmanagedbottoken
|
|
1022
|
-
*/
|
|
1023
|
-
getManagedBotToken(signal?: AbortSignal): Promise<string>;
|
|
1024
|
-
/**
|
|
1025
|
-
* Context-aware alias for `api.replaceManagedBotToken`. Use this method to revoke the current token of a managed bot and generate a new one. Returns the new token as String on success.
|
|
1026
|
-
*
|
|
1027
|
-
* @param signal Optional `AbortSignal` to cancel the request
|
|
1028
|
-
*
|
|
1029
|
-
* **Official reference:** https://core.telegram.org/bots/api#replacemanagedbottoken
|
|
1030
|
-
*/
|
|
1031
|
-
replaceManagedBotToken(signal?: AbortSignal): Promise<string>;
|
|
1032
1065
|
/**
|
|
1033
1066
|
* Context-aware alias for `api.approveChatJoinRequest`. Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success.
|
|
1034
1067
|
*
|
|
@@ -1147,11 +1180,12 @@ export declare class Context implements RenamedUpdate {
|
|
|
1147
1180
|
/**
|
|
1148
1181
|
* Context-aware alias for `api.getChatAdministrators`. Use this method to get a list of administrators in a chat, which aren't bots. Returns an Array of ChatMember objects.
|
|
1149
1182
|
*
|
|
1183
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
1150
1184
|
* @param signal Optional `AbortSignal` to cancel the request
|
|
1151
1185
|
*
|
|
1152
1186
|
* **Official reference:** https://core.telegram.org/bots/api#getchatadministrators
|
|
1153
1187
|
*/
|
|
1154
|
-
getChatAdministrators(signal?: AbortSignal): Promise<(import("@grammyjs/types/manage.js").ChatMemberOwner | import("@grammyjs/types/manage.js").ChatMemberAdministrator)[]>;
|
|
1188
|
+
getChatAdministrators(other?: Other<"getChatAdministrators", "chat_id">, signal?: AbortSignal): Promise<(import("@grammyjs/types/manage.js").ChatMemberOwner | import("@grammyjs/types/manage.js").ChatMemberAdministrator)[]>;
|
|
1155
1189
|
/** @deprecated Use `getChatMemberCount` instead. */
|
|
1156
1190
|
getChatMembersCount(...args: Parameters<Context["getChatMemberCount"]>): Promise<number>;
|
|
1157
1191
|
/**
|
|
@@ -1179,6 +1213,15 @@ export declare class Context implements RenamedUpdate {
|
|
|
1179
1213
|
* **Official reference:** https://core.telegram.org/bots/api#getchatmember
|
|
1180
1214
|
*/
|
|
1181
1215
|
getChatMember(user_id: number, signal?: AbortSignal): Promise<import("@grammyjs/types/manage.js").ChatMember>;
|
|
1216
|
+
/**
|
|
1217
|
+
* Context-aware alias for `api.getUserPersonalChatMessages`. Use this method to get the last messages from the personal chat (i.e., the chat currently added to their profile) of a given user. On success, an array of Message objects is returned.
|
|
1218
|
+
*
|
|
1219
|
+
* @param limit The maximum number of messages to return; 1-20
|
|
1220
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1221
|
+
*
|
|
1222
|
+
* **Official reference:** https://core.telegram.org/bots/api#getuserpersonalchatmessages
|
|
1223
|
+
*/
|
|
1224
|
+
getUserPersonalChatMessages(limit: number, signal?: AbortSignal): Promise<Message[]>;
|
|
1182
1225
|
/**
|
|
1183
1226
|
* Context-aware alias for `api.setChatStickerSet`. Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set ly returned in getChat requests to check if the bot can use this method. Returns True on success.
|
|
1184
1227
|
*
|
|
@@ -1307,6 +1350,15 @@ export declare class Context implements RenamedUpdate {
|
|
|
1307
1350
|
* **Official reference:** https://core.telegram.org/bots/api#answercallbackquery
|
|
1308
1351
|
*/
|
|
1309
1352
|
answerCallbackQuery(other?: string | Other<"answerCallbackQuery", "callback_query_id">, signal?: AbortSignal): Promise<true>;
|
|
1353
|
+
/**
|
|
1354
|
+
* Context-aware alias for `ctx.answerGuestQuery`. Use this method to reply to a received guest message. On success, a SentGuestMessage object is returned.
|
|
1355
|
+
*
|
|
1356
|
+
* @param result An object describing the message to be sent
|
|
1357
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1358
|
+
*
|
|
1359
|
+
* **Official reference:** https://core.telegram.org/bots/api#answerguestquery
|
|
1360
|
+
*/
|
|
1361
|
+
answerGuestQuery(result: InlineQueryResult, signal?: AbortSignal): Promise<import("@grammyjs/types/message.js").SentGuestMessage>;
|
|
1310
1362
|
/**
|
|
1311
1363
|
* 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.
|
|
1312
1364
|
*
|
|
@@ -1365,7 +1417,7 @@ export declare class Context implements RenamedUpdate {
|
|
|
1365
1417
|
*/
|
|
1366
1418
|
editMessageCaption(other?: Other<"editMessageCaption", "chat_id" | "message_id" | "inline_message_id">, signal?: AbortSignal): Promise<true | (Update.Edited & Message.CaptionableMessage)>;
|
|
1367
1419
|
/**
|
|
1368
|
-
* Context-aware alias for `api.editMessageMedia`. Use this method to edit animation, audio, document, photo, or video messages, or to add media to text messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
|
|
1420
|
+
* Context-aware alias for `api.editMessageMedia`. Use this method to edit animation, audio, document, live photo, photo, or video messages, or to add media to text messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo, a live photo, or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
|
|
1369
1421
|
*
|
|
1370
1422
|
* @param media An object for a new media content of the message
|
|
1371
1423
|
* @param other Optional remaining parameters, confer the official reference below
|
|
@@ -1419,6 +1471,64 @@ export declare class Context implements RenamedUpdate {
|
|
|
1419
1471
|
* **Official reference:** https://core.telegram.org/bots/api#deletemessages
|
|
1420
1472
|
*/
|
|
1421
1473
|
deleteMessages(message_ids: number[], signal?: AbortSignal): Promise<true>;
|
|
1474
|
+
/**
|
|
1475
|
+
* Use this method to remove a reaction from a message in a group or a supergroup chat. The bot must have the 'can_delete_messages' administrator right in the chat. Returns True on success.
|
|
1476
|
+
*
|
|
1477
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
1478
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1479
|
+
*
|
|
1480
|
+
* **Official reference:** https://core.telegram.org/bots/api#deletemessagereaction
|
|
1481
|
+
*/
|
|
1482
|
+
deleteMessageReaction(other?: Other<"deleteMessageReaction", "chat_id" | "message_id" | "user_id" | "actor_chat_id">, signal?: AbortSignal): Promise<true>;
|
|
1483
|
+
/**
|
|
1484
|
+
* Use this method to remove a reaction from a message in a group or a supergroup chat. The bot must have the 'can_delete_messages' administrator right in the chat. Returns True on success.
|
|
1485
|
+
*
|
|
1486
|
+
* @param user_id Identifier of the user whose reaction will be removed
|
|
1487
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
1488
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1489
|
+
*
|
|
1490
|
+
* **Official reference:** https://core.telegram.org/bots/api#deletemessagereaction
|
|
1491
|
+
*/
|
|
1492
|
+
deleteMessageReactionUser(user_id: number, other?: Other<"deleteMessageReaction", "chat_id" | "message_id" | "user_id">, signal?: AbortSignal): Promise<true>;
|
|
1493
|
+
/**
|
|
1494
|
+
* Use this method to remove a reaction from a message in a group or a supergroup chat. The bot must have the 'can_delete_messages' administrator right in the chat. Returns True on success.
|
|
1495
|
+
*
|
|
1496
|
+
* @param actor_chat_id Identifier of the chat whose reaction will be removed
|
|
1497
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
1498
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1499
|
+
*
|
|
1500
|
+
* **Official reference:** https://core.telegram.org/bots/api#deletemessagereaction
|
|
1501
|
+
*/
|
|
1502
|
+
deleteMessageReactionChat(actor_chat_id: number, other?: Other<"deleteMessageReaction", "chat_id" | "message_id" | "actor_chat_id">, signal?: AbortSignal): Promise<true>;
|
|
1503
|
+
/**
|
|
1504
|
+
* Use this method to remove up to 10000 recent reactions in a group or a supergroup chat added by a given user. The bot must have the 'can_delete_messages' administrator right in the chat. Returns True on success.
|
|
1505
|
+
*
|
|
1506
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
1507
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1508
|
+
*
|
|
1509
|
+
* **Official reference:** https://core.telegram.org/bots/api#deleteallmessagereactions
|
|
1510
|
+
*/
|
|
1511
|
+
deleteAllMessageReactions(other?: Other<"deleteAllMessageReactions", "chat_id" | "message_id" | "user_id" | "actor_chat_id">, signal?: AbortSignal): Promise<true>;
|
|
1512
|
+
/**
|
|
1513
|
+
* Use this method to remove up to 10000 recent reactions in a group or a supergroup chat added by a given user. The bot must have the 'can_delete_messages' administrator right in the chat. Returns True on success.
|
|
1514
|
+
*
|
|
1515
|
+
* @param user_id Identifier of the user whose reactions will be removed, if the reactions were added by a user
|
|
1516
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
1517
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1518
|
+
*
|
|
1519
|
+
* **Official reference:** https://core.telegram.org/bots/api#deleteallmessagereactions
|
|
1520
|
+
*/
|
|
1521
|
+
deleteAllMessageReactionsUser(user_id: number, other?: Other<"deleteAllMessageReactions", "chat_id" | "message_id" | "user_id">, signal?: AbortSignal): Promise<true>;
|
|
1522
|
+
/**
|
|
1523
|
+
* Use this method to remove up to 10000 recent reactions in a group or a supergroup chat added by a given chat. The bot must have the 'can_delete_messages' administrator right in the chat. Returns True on success.
|
|
1524
|
+
*
|
|
1525
|
+
* @param actor_chat_id Identifier of the chat whose reactions will be removed, if the reactions were added by a chat
|
|
1526
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
1527
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1528
|
+
*
|
|
1529
|
+
* **Official reference:** https://core.telegram.org/bots/api#deleteallmessagereactions
|
|
1530
|
+
*/
|
|
1531
|
+
deleteAllMessageReactionsChat(actor_chat_id: number, other?: Other<"deleteAllMessageReactions", "chat_id" | "message_id" | "actor_chat_id">, signal?: AbortSignal): Promise<true>;
|
|
1422
1532
|
/**
|
|
1423
1533
|
* Context-aware alias for `api.deleteBusinessMessages`. Delete messages on behalf of a business account. Requires the can_delete_outgoing_messages business bot right to delete messages sent by the bot itself, or the can_delete_all_messages business bot right to delete any message. Returns True on success.
|
|
1424
1534
|
*
|