grammy 1.36.3 → 1.37.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 +1 -1
- package/out/context.d.ts +23 -3
- package/out/context.js +28 -1
- package/out/core/api.d.ts +36 -3
- package/out/core/api.js +53 -2
- package/out/core/client.js +2 -1
- package/out/filter.d.ts +26 -0
- package/out/filter.js +4 -0
- package/out/web.mjs +41 -3
- 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-)
|
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 InputFile, type InputMedia, type InputMediaAudio, type InputMediaDocument, type InputMediaPhoto, type InputMediaVideo, type InputPaidMedia, type InputPollOption, type InputProfilePhoto, type InputStoryContent, 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 InputMediaPhoto, type InputMediaVideo, type InputPaidMedia, type InputPollOption, type InputProfilePhoto, type InputStoryContent, 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";
|
|
@@ -671,13 +671,33 @@ export declare class Context implements RenamedUpdate {
|
|
|
671
671
|
* Context-aware alias for `api.sendPoll`. Use this method to send a native poll. On success, the sent Message is returned.
|
|
672
672
|
*
|
|
673
673
|
* @param question Poll question, 1-300 characters
|
|
674
|
-
* @param options A list of answer options, 2-
|
|
674
|
+
* @param options A list of answer options, 2-12 strings 1-100 characters each
|
|
675
675
|
* @param other Optional remaining parameters, confer the official reference below
|
|
676
676
|
* @param signal Optional `AbortSignal` to cancel the request
|
|
677
677
|
*
|
|
678
678
|
* **Official reference:** https://core.telegram.org/bots/api#sendpoll
|
|
679
679
|
*/
|
|
680
|
-
replyWithPoll(question: string, options: InputPollOption[], other?: Other<"sendPoll", "chat_id" | "question" | "options">, signal?: AbortSignal): Promise<Message.PollMessage>;
|
|
680
|
+
replyWithPoll(question: string, options: (string | InputPollOption)[], other?: Other<"sendPoll", "chat_id" | "question" | "options">, signal?: AbortSignal): Promise<Message.PollMessage>;
|
|
681
|
+
/**
|
|
682
|
+
* Context-aware alias for `api.sendChecklist`. Use this method to send a checklist on behalf of a connected business account. On success, the sent Message is returned.
|
|
683
|
+
*
|
|
684
|
+
* @param checklist An object for the checklist to send
|
|
685
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
686
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
687
|
+
*
|
|
688
|
+
* **Official reference:** https://core.telegram.org/bots/api#sendchecklist
|
|
689
|
+
*/
|
|
690
|
+
replyWithChecklist(checklist: InputChecklist, other?: Other<"sendChecklist", "business_connection_id" | "chat_id" | "checklist">, signal?: AbortSignal): Promise<Message.ChecklistMessage>;
|
|
691
|
+
/**
|
|
692
|
+
* Context-aware alias for `api.editMessageChecklist`. Use this method to edit a checklist on behalf of a connected business account. On success, the edited Message is returned.
|
|
693
|
+
*
|
|
694
|
+
* @param checklist An object for the new checklist
|
|
695
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
696
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
697
|
+
*
|
|
698
|
+
* **Official reference:** https://core.telegram.org/bots/api#editmessagechecklist
|
|
699
|
+
*/
|
|
700
|
+
editMessageChecklist(checklist: InputChecklist, other?: Other<"editMessageChecklist", "business_connection_id" | "chat_id" | "messaage_id" | "checklist">, signal?: AbortSignal): Promise<Message.ChecklistMessage>;
|
|
681
701
|
/**
|
|
682
702
|
* Context-aware alias for `api.sendDice`. Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.
|
|
683
703
|
*
|
package/out/context.js
CHANGED
|
@@ -905,7 +905,7 @@ class Context {
|
|
|
905
905
|
* Context-aware alias for `api.sendPoll`. Use this method to send a native poll. On success, the sent Message is returned.
|
|
906
906
|
*
|
|
907
907
|
* @param question Poll question, 1-300 characters
|
|
908
|
-
* @param options A list of answer options, 2-
|
|
908
|
+
* @param options A list of answer options, 2-12 strings 1-100 characters each
|
|
909
909
|
* @param other Optional remaining parameters, confer the official reference below
|
|
910
910
|
* @param signal Optional `AbortSignal` to cancel the request
|
|
911
911
|
*
|
|
@@ -914,6 +914,33 @@ class Context {
|
|
|
914
914
|
replyWithPoll(question, options, other, signal) {
|
|
915
915
|
return this.api.sendPoll(orThrow(this.chatId, "sendPoll"), question, options, { business_connection_id: this.businessConnectionId, ...other }, signal);
|
|
916
916
|
}
|
|
917
|
+
/**
|
|
918
|
+
* Context-aware alias for `api.sendChecklist`. Use this method to send a checklist on behalf of a connected business account. On success, the sent Message is returned.
|
|
919
|
+
*
|
|
920
|
+
* @param checklist An object for the checklist to send
|
|
921
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
922
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
923
|
+
*
|
|
924
|
+
* **Official reference:** https://core.telegram.org/bots/api#sendchecklist
|
|
925
|
+
*/
|
|
926
|
+
replyWithChecklist(checklist, other, signal) {
|
|
927
|
+
return this.api.sendChecklist(orThrow(this.businessConnectionId, "sendChecklist"), orThrow(this.chatId, "sendChecklist"), checklist, other, signal);
|
|
928
|
+
}
|
|
929
|
+
/**
|
|
930
|
+
* Context-aware alias for `api.editMessageChecklist`. Use this method to edit a checklist on behalf of a connected business account. On success, the edited Message is returned.
|
|
931
|
+
*
|
|
932
|
+
* @param checklist An object for the new checklist
|
|
933
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
934
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
935
|
+
*
|
|
936
|
+
* **Official reference:** https://core.telegram.org/bots/api#editmessagechecklist
|
|
937
|
+
*/
|
|
938
|
+
editMessageChecklist(checklist, other, signal) {
|
|
939
|
+
var _a, _b, _c, _d;
|
|
940
|
+
const msg = orThrow(this.msg, "editMessageChecklist");
|
|
941
|
+
const target = (_d = (_b = (_a = msg.checklist_tasks_done) === null || _a === void 0 ? void 0 : _a.checklist_message) !== null && _b !== void 0 ? _b : (_c = msg.checklist_tasks_added) === null || _c === void 0 ? void 0 : _c.checklist_message) !== null && _d !== void 0 ? _d : msg;
|
|
942
|
+
return this.api.editMessageChecklist(orThrow(this.businessConnectionId, "editMessageChecklist"), orThrow(target.chat.id, "editMessageChecklist"), orThrow(target.message_id, "editMessageChecklist"), checklist, other, signal);
|
|
943
|
+
}
|
|
917
944
|
/**
|
|
918
945
|
* Context-aware alias for `api.sendDice`. Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.
|
|
919
946
|
*
|
package/out/core/api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AcceptedGiftTypes, type BotCommand, type ChatPermissions, type InlineQueryResult, type InputFile, type InputMedia, type InputMediaAudio, type InputMediaDocument, type InputMediaPhoto, type InputMediaVideo, type InputPaidMedia, type InputPollOption, type InputProfilePhoto, type InputSticker, type InputStoryContent, type LabeledPrice, type MaskPosition, type PassportElementError, type ReactionType } from "../types.js";
|
|
1
|
+
import { type AcceptedGiftTypes, type BotCommand, 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 InputSticker, type InputStoryContent, type LabeledPrice, type MaskPosition, type PassportElementError, type ReactionType } from "../types.js";
|
|
2
2
|
import { type ApiClientOptions, type Methods, type Payload, type RawApi, type Transformer, type TransformerConsumer, type WebhookReplyEnvelope } from "./client.js";
|
|
3
3
|
/**
|
|
4
4
|
* Helper type to derive remaining properties of a given API method call M,
|
|
@@ -402,13 +402,38 @@ export declare class Api<R extends RawApi = RawApi> {
|
|
|
402
402
|
*
|
|
403
403
|
* @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
|
404
404
|
* @param question Poll question, 1-300 characters
|
|
405
|
-
* @param options A list of answer options, 2-
|
|
405
|
+
* @param options A list of answer options, 2-12 strings 1-100 characters each
|
|
406
406
|
* @param other Optional remaining parameters, confer the official reference below
|
|
407
407
|
* @param signal Optional `AbortSignal` to cancel the request
|
|
408
408
|
*
|
|
409
409
|
* **Official reference:** https://core.telegram.org/bots/api#sendpoll
|
|
410
410
|
*/
|
|
411
|
-
sendPoll(chat_id: number | string, question: string, options: InputPollOption[], other?: Other<R, "sendPoll", "chat_id" | "question" | "options">, signal?: AbortSignal): Promise<import("@grammyjs/types/message.js").Message.PollMessage>;
|
|
411
|
+
sendPoll(chat_id: number | string, question: string, options: (string | InputPollOption)[], other?: Other<R, "sendPoll", "chat_id" | "question" | "options">, signal?: AbortSignal): Promise<import("@grammyjs/types/message.js").Message.PollMessage>;
|
|
412
|
+
/**
|
|
413
|
+
* Use this method to send a checklist on behalf of a connected business account. On success, the sent Message is returned.
|
|
414
|
+
*
|
|
415
|
+
* @param business_connection_id Unique identifier of the business connection on behalf of which the message will be sent
|
|
416
|
+
* @param chat_id Unique identifier for the target chat
|
|
417
|
+
* @param checklist An object for the checklist to send
|
|
418
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
419
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
420
|
+
*
|
|
421
|
+
* **Official reference:** https://core.telegram.org/bots/api#sendchecklist
|
|
422
|
+
*/
|
|
423
|
+
sendChecklist(business_connection_id: string, chat_id: number, checklist: InputChecklist, other?: Other<R, "sendChecklist", "business_connection_id" | "chat_id" | "checklist">, signal?: AbortSignal): Promise<import("@grammyjs/types/message.js").Message.ChecklistMessage>;
|
|
424
|
+
/**
|
|
425
|
+
* Use this method to edit a checklist on behalf of a connected business account. On success, the edited Message is returned.
|
|
426
|
+
*
|
|
427
|
+
* @param business_connection_id Unique identifier of the business connection on behalf of which the message will be sent
|
|
428
|
+
* @param chat_id Unique identifier for the target chat
|
|
429
|
+
* @param message_id Unique identifier for the target message
|
|
430
|
+
* @param checklist An object for the new checklist
|
|
431
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
432
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
433
|
+
*
|
|
434
|
+
* **Official reference:** https://core.telegram.org/bots/api#editmessagechecklist
|
|
435
|
+
*/
|
|
436
|
+
editMessageChecklist(business_connection_id: string, chat_id: number, message_id: number, checklist: InputChecklist, other?: Other<R, "editMessageChecklist", "business_connection_id" | "chat_id" | "messaage_id" | "checklist">, signal?: AbortSignal): Promise<import("@grammyjs/types/message.js").Message.ChecklistMessage>;
|
|
412
437
|
/**
|
|
413
438
|
* Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.
|
|
414
439
|
*
|
|
@@ -1066,6 +1091,14 @@ export declare class Api<R extends RawApi = RawApi> {
|
|
|
1066
1091
|
* **Official reference:** https://core.telegram.org/bots/api#getmydefaultadministratorrights
|
|
1067
1092
|
*/
|
|
1068
1093
|
getMyDefaultAdministratorRights(other?: Other<R, "getMyDefaultAdministratorRights">, signal?: AbortSignal): Promise<import("@grammyjs/types/manage.js").ChatAdministratorRights>;
|
|
1094
|
+
/**
|
|
1095
|
+
* A method to get the current Telegram Stars balance of the bot. Requires no parameters. On success, returns a StarAmount object.
|
|
1096
|
+
*
|
|
1097
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1098
|
+
*
|
|
1099
|
+
* **Official reference:** https://core.telegram.org/bots/api#getmystarbalance
|
|
1100
|
+
*/
|
|
1101
|
+
getMyStarBalance(signal?: AbortSignal): Promise<import("@grammyjs/types/payment.js").StarAmount>;
|
|
1069
1102
|
/**
|
|
1070
1103
|
* Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
|
|
1071
1104
|
*
|
package/out/core/api.js
CHANGED
|
@@ -429,14 +429,55 @@ class Api {
|
|
|
429
429
|
*
|
|
430
430
|
* @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
|
431
431
|
* @param question Poll question, 1-300 characters
|
|
432
|
-
* @param options A list of answer options, 2-
|
|
432
|
+
* @param options A list of answer options, 2-12 strings 1-100 characters each
|
|
433
433
|
* @param other Optional remaining parameters, confer the official reference below
|
|
434
434
|
* @param signal Optional `AbortSignal` to cancel the request
|
|
435
435
|
*
|
|
436
436
|
* **Official reference:** https://core.telegram.org/bots/api#sendpoll
|
|
437
437
|
*/
|
|
438
438
|
sendPoll(chat_id, question, options, other, signal) {
|
|
439
|
-
|
|
439
|
+
const opts = options.map((o) => typeof o === "string" ? { text: o } : o);
|
|
440
|
+
return this.raw.sendPoll({ chat_id, question, options: opts, ...other }, signal);
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Use this method to send a checklist on behalf of a connected business account. On success, the sent Message is returned.
|
|
444
|
+
*
|
|
445
|
+
* @param business_connection_id Unique identifier of the business connection on behalf of which the message will be sent
|
|
446
|
+
* @param chat_id Unique identifier for the target chat
|
|
447
|
+
* @param checklist An object for the checklist to send
|
|
448
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
449
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
450
|
+
*
|
|
451
|
+
* **Official reference:** https://core.telegram.org/bots/api#sendchecklist
|
|
452
|
+
*/
|
|
453
|
+
sendChecklist(business_connection_id, chat_id, checklist, other, signal) {
|
|
454
|
+
return this.raw.sendChecklist({
|
|
455
|
+
business_connection_id,
|
|
456
|
+
chat_id,
|
|
457
|
+
checklist,
|
|
458
|
+
...other,
|
|
459
|
+
}, signal);
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Use this method to edit a checklist on behalf of a connected business account. On success, the edited Message is returned.
|
|
463
|
+
*
|
|
464
|
+
* @param business_connection_id Unique identifier of the business connection on behalf of which the message will be sent
|
|
465
|
+
* @param chat_id Unique identifier for the target chat
|
|
466
|
+
* @param message_id Unique identifier for the target message
|
|
467
|
+
* @param checklist An object for the new checklist
|
|
468
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
469
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
470
|
+
*
|
|
471
|
+
* **Official reference:** https://core.telegram.org/bots/api#editmessagechecklist
|
|
472
|
+
*/
|
|
473
|
+
editMessageChecklist(business_connection_id, chat_id, message_id, checklist, other, signal) {
|
|
474
|
+
return this.raw.editMessageChecklist({
|
|
475
|
+
business_connection_id,
|
|
476
|
+
chat_id,
|
|
477
|
+
message_id,
|
|
478
|
+
checklist,
|
|
479
|
+
...other,
|
|
480
|
+
}, signal);
|
|
440
481
|
}
|
|
441
482
|
/**
|
|
442
483
|
* Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.
|
|
@@ -1234,6 +1275,16 @@ class Api {
|
|
|
1234
1275
|
getMyDefaultAdministratorRights(other, signal) {
|
|
1235
1276
|
return this.raw.getMyDefaultAdministratorRights({ ...other }, signal);
|
|
1236
1277
|
}
|
|
1278
|
+
/**
|
|
1279
|
+
* A method to get the current Telegram Stars balance of the bot. Requires no parameters. On success, returns a StarAmount object.
|
|
1280
|
+
*
|
|
1281
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1282
|
+
*
|
|
1283
|
+
* **Official reference:** https://core.telegram.org/bots/api#getmystarbalance
|
|
1284
|
+
*/
|
|
1285
|
+
getMyStarBalance(signal) {
|
|
1286
|
+
return this.raw.getMyStarBalance(signal);
|
|
1287
|
+
}
|
|
1237
1288
|
/**
|
|
1238
1289
|
* Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
|
|
1239
1290
|
*
|
package/out/core/client.js
CHANGED
|
@@ -123,7 +123,8 @@ function createRawApi(token, options, webhookReplyEnvelope) {
|
|
|
123
123
|
m === "getForumTopicIconStickers" ||
|
|
124
124
|
m === "getAvailableGifts" ||
|
|
125
125
|
m === "logOut" ||
|
|
126
|
-
m === "close"
|
|
126
|
+
m === "close" ||
|
|
127
|
+
m === "getMyStarBalance"
|
|
127
128
|
? client.callApi.bind(client, m, {})
|
|
128
129
|
: client.callApi.bind(client, m);
|
|
129
130
|
},
|
package/out/filter.d.ts
CHANGED
|
@@ -62,6 +62,12 @@ declare const UPDATE_KEYS: {
|
|
|
62
62
|
readonly forum_topic_reopened: {};
|
|
63
63
|
readonly general_forum_topic_hidden: {};
|
|
64
64
|
readonly general_forum_topic_unhidden: {};
|
|
65
|
+
readonly checklist: {
|
|
66
|
+
readonly others_can_add_tasks: {};
|
|
67
|
+
readonly others_can_mark_tasks_as_done: {};
|
|
68
|
+
};
|
|
69
|
+
readonly checklist_tasks_done: {};
|
|
70
|
+
readonly checklist_tasks_added: {};
|
|
65
71
|
readonly sender_boost_count: {};
|
|
66
72
|
readonly forward_origin: {
|
|
67
73
|
readonly user: {};
|
|
@@ -206,6 +212,12 @@ declare const UPDATE_KEYS: {
|
|
|
206
212
|
readonly forum_topic_reopened: {};
|
|
207
213
|
readonly general_forum_topic_hidden: {};
|
|
208
214
|
readonly general_forum_topic_unhidden: {};
|
|
215
|
+
readonly checklist: {
|
|
216
|
+
readonly others_can_add_tasks: {};
|
|
217
|
+
readonly others_can_mark_tasks_as_done: {};
|
|
218
|
+
};
|
|
219
|
+
readonly checklist_tasks_done: {};
|
|
220
|
+
readonly checklist_tasks_added: {};
|
|
209
221
|
readonly sender_boost_count: {};
|
|
210
222
|
readonly forward_origin: {
|
|
211
223
|
readonly user: {};
|
|
@@ -318,6 +330,7 @@ declare const UPDATE_KEYS: {
|
|
|
318
330
|
};
|
|
319
331
|
readonly channel_post: {
|
|
320
332
|
readonly channel_chat_created: {};
|
|
333
|
+
readonly direct_message_price_changed: {};
|
|
321
334
|
readonly forward_origin: {
|
|
322
335
|
readonly user: {};
|
|
323
336
|
readonly hidden_user: {};
|
|
@@ -429,6 +442,7 @@ declare const UPDATE_KEYS: {
|
|
|
429
442
|
};
|
|
430
443
|
readonly edited_channel_post: {
|
|
431
444
|
readonly channel_chat_created: {};
|
|
445
|
+
readonly direct_message_price_changed: {};
|
|
432
446
|
readonly forward_origin: {
|
|
433
447
|
readonly user: {};
|
|
434
448
|
readonly hidden_user: {};
|
|
@@ -576,6 +590,12 @@ declare const UPDATE_KEYS: {
|
|
|
576
590
|
readonly forum_topic_reopened: {};
|
|
577
591
|
readonly general_forum_topic_hidden: {};
|
|
578
592
|
readonly general_forum_topic_unhidden: {};
|
|
593
|
+
readonly checklist: {
|
|
594
|
+
readonly others_can_add_tasks: {};
|
|
595
|
+
readonly others_can_mark_tasks_as_done: {};
|
|
596
|
+
};
|
|
597
|
+
readonly checklist_tasks_done: {};
|
|
598
|
+
readonly checklist_tasks_added: {};
|
|
579
599
|
readonly sender_boost_count: {};
|
|
580
600
|
readonly forward_origin: {
|
|
581
601
|
readonly user: {};
|
|
@@ -720,6 +740,12 @@ declare const UPDATE_KEYS: {
|
|
|
720
740
|
readonly forum_topic_reopened: {};
|
|
721
741
|
readonly general_forum_topic_hidden: {};
|
|
722
742
|
readonly general_forum_topic_unhidden: {};
|
|
743
|
+
readonly checklist: {
|
|
744
|
+
readonly others_can_add_tasks: {};
|
|
745
|
+
readonly others_can_mark_tasks_as_done: {};
|
|
746
|
+
};
|
|
747
|
+
readonly checklist_tasks_done: {};
|
|
748
|
+
readonly checklist_tasks_added: {};
|
|
723
749
|
readonly sender_boost_count: {};
|
|
724
750
|
readonly forward_origin: {
|
|
725
751
|
readonly user: {};
|
package/out/filter.js
CHANGED
|
@@ -321,11 +321,15 @@ const MESSAGE_KEYS = {
|
|
|
321
321
|
forum_topic_reopened: {},
|
|
322
322
|
general_forum_topic_hidden: {},
|
|
323
323
|
general_forum_topic_unhidden: {},
|
|
324
|
+
checklist: { others_can_add_tasks: {}, others_can_mark_tasks_as_done: {} },
|
|
325
|
+
checklist_tasks_done: {},
|
|
326
|
+
checklist_tasks_added: {},
|
|
324
327
|
sender_boost_count: {},
|
|
325
328
|
};
|
|
326
329
|
const CHANNEL_POST_KEYS = {
|
|
327
330
|
...COMMON_MESSAGE_KEYS,
|
|
328
331
|
channel_chat_created: {},
|
|
332
|
+
direct_message_price_changed: {},
|
|
329
333
|
};
|
|
330
334
|
const BUSINESS_CONNECTION_KEYS = {
|
|
331
335
|
can_reply: {},
|
package/out/web.mjs
CHANGED
|
@@ -276,11 +276,18 @@ const MESSAGE_KEYS = {
|
|
|
276
276
|
forum_topic_reopened: {},
|
|
277
277
|
general_forum_topic_hidden: {},
|
|
278
278
|
general_forum_topic_unhidden: {},
|
|
279
|
+
checklist: {
|
|
280
|
+
others_can_add_tasks: {},
|
|
281
|
+
others_can_mark_tasks_as_done: {}
|
|
282
|
+
},
|
|
283
|
+
checklist_tasks_done: {},
|
|
284
|
+
checklist_tasks_added: {},
|
|
279
285
|
sender_boost_count: {}
|
|
280
286
|
};
|
|
281
287
|
const CHANNEL_POST_KEYS = {
|
|
282
288
|
...COMMON_MESSAGE_KEYS,
|
|
283
|
-
channel_chat_created: {}
|
|
289
|
+
channel_chat_created: {},
|
|
290
|
+
direct_message_price_changed: {}
|
|
284
291
|
};
|
|
285
292
|
const BUSINESS_CONNECTION_KEYS = {
|
|
286
293
|
can_reply: {},
|
|
@@ -852,6 +859,14 @@ class Context {
|
|
|
852
859
|
...other
|
|
853
860
|
}, signal);
|
|
854
861
|
}
|
|
862
|
+
replyWithChecklist(checklist, other, signal) {
|
|
863
|
+
return this.api.sendChecklist(orThrow(this.businessConnectionId, "sendChecklist"), orThrow(this.chatId, "sendChecklist"), checklist, other, signal);
|
|
864
|
+
}
|
|
865
|
+
editMessageChecklist(checklist, other, signal) {
|
|
866
|
+
const msg = orThrow(this.msg, "editMessageChecklist");
|
|
867
|
+
const target = msg.checklist_tasks_done?.checklist_message ?? msg.checklist_tasks_added?.checklist_message ?? msg;
|
|
868
|
+
return this.api.editMessageChecklist(orThrow(this.businessConnectionId, "editMessageChecklist"), orThrow(target.chat.id, "editMessageChecklist"), orThrow(target.message_id, "editMessageChecklist"), checklist, other, signal);
|
|
869
|
+
}
|
|
855
870
|
replyWithDice(emoji, other, signal) {
|
|
856
871
|
return this.api.sendDice(orThrow(this.chatId, "sendDice"), emoji, {
|
|
857
872
|
business_connection_id: this.businessConnectionId,
|
|
@@ -2455,7 +2470,7 @@ function createRawApi(token, options, webhookReplyEnvelope) {
|
|
|
2455
2470
|
const client = new ApiClient(token, options, webhookReplyEnvelope);
|
|
2456
2471
|
const proxyHandler = {
|
|
2457
2472
|
get (_, m) {
|
|
2458
|
-
return m === "toJSON" ? "__internal" : m === "getMe" || m === "getWebhookInfo" || m === "getForumTopicIconStickers" || m === "getAvailableGifts" || m === "logOut" || m === "close" ? client.callApi.bind(client, m, {}) : client.callApi.bind(client, m);
|
|
2473
|
+
return m === "toJSON" ? "__internal" : m === "getMe" || m === "getWebhookInfo" || m === "getForumTopicIconStickers" || m === "getAvailableGifts" || m === "logOut" || m === "close" || m === "getMyStarBalance" ? client.callApi.bind(client, m, {}) : client.callApi.bind(client, m);
|
|
2459
2474
|
},
|
|
2460
2475
|
...proxyMethods
|
|
2461
2476
|
};
|
|
@@ -2757,10 +2772,30 @@ class Api {
|
|
|
2757
2772
|
}, signal);
|
|
2758
2773
|
}
|
|
2759
2774
|
sendPoll(chat_id, question, options, other, signal) {
|
|
2775
|
+
const opts = options.map((o)=>typeof o === "string" ? {
|
|
2776
|
+
text: o
|
|
2777
|
+
} : o);
|
|
2760
2778
|
return this.raw.sendPoll({
|
|
2761
2779
|
chat_id,
|
|
2762
2780
|
question,
|
|
2763
|
-
options,
|
|
2781
|
+
options: opts,
|
|
2782
|
+
...other
|
|
2783
|
+
}, signal);
|
|
2784
|
+
}
|
|
2785
|
+
sendChecklist(business_connection_id, chat_id, checklist, other, signal) {
|
|
2786
|
+
return this.raw.sendChecklist({
|
|
2787
|
+
business_connection_id,
|
|
2788
|
+
chat_id,
|
|
2789
|
+
checklist,
|
|
2790
|
+
...other
|
|
2791
|
+
}, signal);
|
|
2792
|
+
}
|
|
2793
|
+
editMessageChecklist(business_connection_id, chat_id, message_id, checklist, other, signal) {
|
|
2794
|
+
return this.raw.editMessageChecklist({
|
|
2795
|
+
business_connection_id,
|
|
2796
|
+
chat_id,
|
|
2797
|
+
message_id,
|
|
2798
|
+
checklist,
|
|
2764
2799
|
...other
|
|
2765
2800
|
}, signal);
|
|
2766
2801
|
}
|
|
@@ -3150,6 +3185,9 @@ class Api {
|
|
|
3150
3185
|
...other
|
|
3151
3186
|
}, signal);
|
|
3152
3187
|
}
|
|
3188
|
+
getMyStarBalance(signal) {
|
|
3189
|
+
return this.raw.getMyStarBalance(signal);
|
|
3190
|
+
}
|
|
3153
3191
|
editMessageText(chat_id, message_id, text, other, signal) {
|
|
3154
3192
|
return this.raw.editMessageText({
|
|
3155
3193
|
chat_id,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grammy",
|
|
3
3
|
"description": "The Telegram Bot Framework.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.37.0",
|
|
5
5
|
"author": "KnorpelSenf",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"engines": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"backport": "deno2node tsconfig.json"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@grammyjs/types": "3.
|
|
20
|
+
"@grammyjs/types": "3.21.0",
|
|
21
21
|
"abort-controller": "^3.0.0",
|
|
22
22
|
"debug": "^4.3.4",
|
|
23
23
|
"node-fetch": "^2.7.0"
|