@telegram.ts/types 1.4.0 → 1.6.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/package.json +1 -1
- package/src/apiMethodsTypes.d.ts +113 -87
- package/src/index.d.ts +10 -10
- package/src/inlineTypes.d.ts +11 -6
- package/src/invoiceTypes.d.ts +1 -1
- package/src/manageTypes.d.ts +189 -62
- package/src/markupTypes.d.ts +40 -25
- package/src/messageTypes.d.ts +507 -51
- package/src/telegramTypes.d.ts +1 -5
- package/src/updateTypes.d.ts +25 -5
package/package.json
CHANGED
package/src/apiMethodsTypes.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
InlineQueryResult,
|
|
3
3
|
InlineQueryResultsButton,
|
|
4
|
-
} from "./inlineTypes
|
|
4
|
+
} from "./inlineTypes";
|
|
5
5
|
import type {
|
|
6
6
|
BotCommand,
|
|
7
7
|
ChatAdministratorRights,
|
|
@@ -11,19 +11,20 @@ import type {
|
|
|
11
11
|
ChatMemberAdministrator,
|
|
12
12
|
ChatMemberOwner,
|
|
13
13
|
ChatPermissions,
|
|
14
|
-
File,
|
|
15
14
|
ForumTopic,
|
|
15
|
+
UserChatBoosts,
|
|
16
16
|
UserFromGetMe,
|
|
17
17
|
UserProfilePhotos,
|
|
18
18
|
WebhookInfo,
|
|
19
|
-
} from "./manageTypes
|
|
19
|
+
} from "./manageTypes";
|
|
20
20
|
import type {
|
|
21
21
|
ForceReply,
|
|
22
22
|
InlineKeyboardMarkup,
|
|
23
23
|
ReplyKeyboardMarkup,
|
|
24
24
|
ReplyKeyboardRemove,
|
|
25
|
-
} from "./markupTypes
|
|
25
|
+
} from "./markupTypes";
|
|
26
26
|
import type {
|
|
27
|
+
LinkPreviewOptions,
|
|
27
28
|
GameHighScore,
|
|
28
29
|
MaskPosition,
|
|
29
30
|
Message,
|
|
@@ -31,20 +32,23 @@ import type {
|
|
|
31
32
|
MessageId,
|
|
32
33
|
ParseMode,
|
|
33
34
|
Poll,
|
|
35
|
+
File,
|
|
36
|
+
ReactionType,
|
|
37
|
+
ReplyParameters,
|
|
34
38
|
SentWebAppMessage,
|
|
35
39
|
Sticker,
|
|
36
40
|
StickerSet,
|
|
37
|
-
} from "./messageTypes
|
|
38
|
-
import type { PassportElementError } from "./passportTypes
|
|
39
|
-
import type { LabeledPrice, ShippingOption } from "./invoiceTypes
|
|
41
|
+
} from "./messageTypes";
|
|
42
|
+
import type { PassportElementError } from "./passportTypes";
|
|
43
|
+
import type { LabeledPrice, ShippingOption } from "./invoiceTypes";
|
|
40
44
|
import type {
|
|
41
45
|
BotCommandScope,
|
|
42
46
|
BotDescription,
|
|
43
47
|
BotName,
|
|
44
48
|
BotShortDescription,
|
|
45
49
|
MenuButton,
|
|
46
|
-
} from "./botCommandTypes
|
|
47
|
-
import type { Update } from "./updateTypes
|
|
50
|
+
} from "./botCommandTypes";
|
|
51
|
+
import type { Update } from "./updateTypes";
|
|
48
52
|
/** Extracts the parameters of a given method name */
|
|
49
53
|
type Params<F, M extends keyof ApiMethods<F>> = Parameters<ApiMethods<F>[M]>;
|
|
50
54
|
/** Utility type providing the argument type for the given method name or `{}` if the method does not take any parameters */
|
|
@@ -67,7 +71,7 @@ export type ApiMethods<F> = {
|
|
|
67
71
|
limit?: number;
|
|
68
72
|
/** Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only. */
|
|
69
73
|
timeout?: number;
|
|
70
|
-
/** A list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.
|
|
74
|
+
/** A list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction and message_reaction_count (default). If not specified, the previous setting will be used.
|
|
71
75
|
|
|
72
76
|
Please note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time. */
|
|
73
77
|
allowed_updates?: ReadonlyArray<Exclude<keyof Update, "update_id">>;
|
|
@@ -91,7 +95,7 @@ export type ApiMethods<F> = {
|
|
|
91
95
|
ip_address?: string;
|
|
92
96
|
/** The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput. */
|
|
93
97
|
max_connections?: number;
|
|
94
|
-
/** A list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.
|
|
98
|
+
/** A list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction and message_reaction_count (default). If not specified, the previous setting will be used.
|
|
95
99
|
|
|
96
100
|
Please note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time. */
|
|
97
101
|
allowed_updates?: ReadonlyArray<Exclude<keyof Update, "update_id">>;
|
|
@@ -125,16 +129,14 @@ export type ApiMethods<F> = {
|
|
|
125
129
|
parse_mode?: ParseMode;
|
|
126
130
|
/** A list of special entities that appear in message text, which can be specified instead of parse_mode */
|
|
127
131
|
entities?: MessageEntity[];
|
|
128
|
-
/**
|
|
129
|
-
|
|
132
|
+
/** Link preview generation options for the message */
|
|
133
|
+
link_preview_options?: LinkPreviewOptions;
|
|
130
134
|
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
131
135
|
disable_notification?: boolean;
|
|
132
136
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
133
137
|
protect_content?: boolean;
|
|
134
|
-
/**
|
|
135
|
-
|
|
136
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
137
|
-
allow_sending_without_reply?: boolean;
|
|
138
|
+
/** Description of the message to reply to */
|
|
139
|
+
reply_parameters?: ReplyParameters;
|
|
138
140
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
|
|
139
141
|
reply_markup?:
|
|
140
142
|
| InlineKeyboardMarkup
|
|
@@ -142,7 +144,7 @@ export type ApiMethods<F> = {
|
|
|
142
144
|
| ReplyKeyboardRemove
|
|
143
145
|
| ForceReply;
|
|
144
146
|
}): Message.TextMessage;
|
|
145
|
-
/** Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent Message is returned.
|
|
147
|
+
/** 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. **/
|
|
146
148
|
forwardMessage(args: {
|
|
147
149
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
148
150
|
chat_id: number | string;
|
|
@@ -157,6 +159,21 @@ export type ApiMethods<F> = {
|
|
|
157
159
|
/** Message identifier in the chat specified in from_chat_id */
|
|
158
160
|
message_id: number;
|
|
159
161
|
}): Message;
|
|
162
|
+
/** 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. */
|
|
163
|
+
forwardMessages(args: {
|
|
164
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
165
|
+
chat_id: number | string;
|
|
166
|
+
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
167
|
+
message_thread_id?: number;
|
|
168
|
+
/** Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername) */
|
|
169
|
+
from_chat_id: number | string;
|
|
170
|
+
/** Identifiers of 1-100 messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. */
|
|
171
|
+
message_ids: number[];
|
|
172
|
+
/** Sends the messages silently. Users will receive a notification with no sound. */
|
|
173
|
+
disable_notification?: boolean;
|
|
174
|
+
/** Protects the contents of the forwarded messages from forwarding and saving */
|
|
175
|
+
protect_content?: boolean;
|
|
176
|
+
}): MessageId[];
|
|
160
177
|
/** Use this method to copy messages of any kind. Service 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. */
|
|
161
178
|
copyMessage(args: {
|
|
162
179
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
@@ -177,10 +194,8 @@ export type ApiMethods<F> = {
|
|
|
177
194
|
disable_notification?: boolean;
|
|
178
195
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
179
196
|
protect_content?: boolean;
|
|
180
|
-
/**
|
|
181
|
-
|
|
182
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
183
|
-
allow_sending_without_reply?: boolean;
|
|
197
|
+
/** Description of the message to reply to */
|
|
198
|
+
reply_parameters?: ReplyParameters;
|
|
184
199
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
|
|
185
200
|
reply_markup?:
|
|
186
201
|
| InlineKeyboardMarkup
|
|
@@ -188,6 +203,23 @@ export type ApiMethods<F> = {
|
|
|
188
203
|
| ReplyKeyboardRemove
|
|
189
204
|
| ForceReply;
|
|
190
205
|
}): MessageId;
|
|
206
|
+
/** 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, 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. */
|
|
207
|
+
copyMessages(args: {
|
|
208
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
209
|
+
chat_id: number | string;
|
|
210
|
+
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
211
|
+
message_thread_id?: number;
|
|
212
|
+
/** Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername) */
|
|
213
|
+
from_chat_id: number | string;
|
|
214
|
+
/** Identifiers of 1-100 messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. */
|
|
215
|
+
message_ids: number[];
|
|
216
|
+
/** Sends the messages silently. Users will receive a notification with no sound. */
|
|
217
|
+
disable_notification?: boolean;
|
|
218
|
+
/** Protects the contents of the sent messages from forwarding and saving */
|
|
219
|
+
protect_content?: boolean;
|
|
220
|
+
/** Pass True to copy the messages without their captions */
|
|
221
|
+
remove_caption?: boolean;
|
|
222
|
+
}): MessageId[];
|
|
191
223
|
/** Use this method to send photos. On success, the sent Message is returned. */
|
|
192
224
|
sendPhoto(args: {
|
|
193
225
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
@@ -208,10 +240,8 @@ export type ApiMethods<F> = {
|
|
|
208
240
|
disable_notification?: boolean;
|
|
209
241
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
210
242
|
protect_content?: boolean;
|
|
211
|
-
/**
|
|
212
|
-
|
|
213
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
214
|
-
allow_sending_without_reply?: boolean;
|
|
243
|
+
/** Description of the message to reply to */
|
|
244
|
+
reply_parameters?: ReplyParameters;
|
|
215
245
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
|
|
216
246
|
reply_markup?:
|
|
217
247
|
| InlineKeyboardMarkup
|
|
@@ -247,10 +277,8 @@ export type ApiMethods<F> = {
|
|
|
247
277
|
disable_notification?: boolean;
|
|
248
278
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
249
279
|
protect_content?: boolean;
|
|
250
|
-
/**
|
|
251
|
-
|
|
252
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
253
|
-
allow_sending_without_reply?: boolean;
|
|
280
|
+
/** Description of the message to reply to */
|
|
281
|
+
reply_parameters?: ReplyParameters;
|
|
254
282
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
|
|
255
283
|
reply_markup?:
|
|
256
284
|
| InlineKeyboardMarkup
|
|
@@ -280,10 +308,8 @@ export type ApiMethods<F> = {
|
|
|
280
308
|
disable_notification?: boolean;
|
|
281
309
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
282
310
|
protect_content?: boolean;
|
|
283
|
-
/**
|
|
284
|
-
|
|
285
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
286
|
-
allow_sending_without_reply?: boolean;
|
|
311
|
+
/** Description of the message to reply to */
|
|
312
|
+
reply_parameters?: ReplyParameters;
|
|
287
313
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
|
|
288
314
|
reply_markup?:
|
|
289
315
|
| InlineKeyboardMarkup
|
|
@@ -321,10 +347,8 @@ export type ApiMethods<F> = {
|
|
|
321
347
|
disable_notification?: boolean;
|
|
322
348
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
323
349
|
protect_content?: boolean;
|
|
324
|
-
/**
|
|
325
|
-
|
|
326
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
327
|
-
allow_sending_without_reply?: boolean;
|
|
350
|
+
/** Description of the message to reply to */
|
|
351
|
+
reply_parameters?: ReplyParameters;
|
|
328
352
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
|
|
329
353
|
reply_markup?:
|
|
330
354
|
| InlineKeyboardMarkup
|
|
@@ -360,10 +384,8 @@ export type ApiMethods<F> = {
|
|
|
360
384
|
disable_notification?: boolean;
|
|
361
385
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
362
386
|
protect_content?: boolean;
|
|
363
|
-
/**
|
|
364
|
-
|
|
365
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
366
|
-
allow_sending_without_reply?: boolean;
|
|
387
|
+
/** Description of the message to reply to */
|
|
388
|
+
reply_parameters?: ReplyParameters;
|
|
367
389
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
|
|
368
390
|
reply_markup?:
|
|
369
391
|
| InlineKeyboardMarkup
|
|
@@ -391,10 +413,8 @@ export type ApiMethods<F> = {
|
|
|
391
413
|
disable_notification?: boolean;
|
|
392
414
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
393
415
|
protect_content?: boolean;
|
|
394
|
-
/**
|
|
395
|
-
|
|
396
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
397
|
-
allow_sending_without_reply?: boolean;
|
|
416
|
+
/** Description of the message to reply to */
|
|
417
|
+
reply_parameters?: ReplyParameters;
|
|
398
418
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
|
|
399
419
|
reply_markup?:
|
|
400
420
|
| InlineKeyboardMarkup
|
|
@@ -421,10 +441,8 @@ export type ApiMethods<F> = {
|
|
|
421
441
|
disable_notification?: boolean;
|
|
422
442
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
423
443
|
protect_content?: boolean;
|
|
424
|
-
/**
|
|
425
|
-
|
|
426
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
427
|
-
allow_sending_without_reply?: boolean;
|
|
444
|
+
/** Description of the message to reply to */
|
|
445
|
+
reply_parameters?: ReplyParameters;
|
|
428
446
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
|
|
429
447
|
reply_markup?:
|
|
430
448
|
| InlineKeyboardMarkup
|
|
@@ -449,10 +467,8 @@ export type ApiMethods<F> = {
|
|
|
449
467
|
disable_notification?: boolean;
|
|
450
468
|
/** Protects the contents of the sent messages from forwarding and saving */
|
|
451
469
|
protect_content?: boolean;
|
|
452
|
-
/**
|
|
453
|
-
|
|
454
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
455
|
-
allow_sending_without_reply?: boolean;
|
|
470
|
+
/** Description of the message to reply to */
|
|
471
|
+
reply_parameters?: ReplyParameters;
|
|
456
472
|
}): Array<
|
|
457
473
|
| Message.AudioMessage
|
|
458
474
|
| Message.DocumentMessage
|
|
@@ -481,10 +497,8 @@ export type ApiMethods<F> = {
|
|
|
481
497
|
disable_notification?: boolean;
|
|
482
498
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
483
499
|
protect_content?: boolean;
|
|
484
|
-
/**
|
|
485
|
-
|
|
486
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
487
|
-
allow_sending_without_reply?: boolean;
|
|
500
|
+
/** Description of the message to reply to */
|
|
501
|
+
reply_parameters?: ReplyParameters;
|
|
488
502
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
|
|
489
503
|
reply_markup?:
|
|
490
504
|
| InlineKeyboardMarkup
|
|
@@ -550,10 +564,8 @@ export type ApiMethods<F> = {
|
|
|
550
564
|
disable_notification?: boolean;
|
|
551
565
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
552
566
|
protect_content?: boolean;
|
|
553
|
-
/**
|
|
554
|
-
|
|
555
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
556
|
-
allow_sending_without_reply?: boolean;
|
|
567
|
+
/** Description of the message to reply to */
|
|
568
|
+
reply_parameters?: ReplyParameters;
|
|
557
569
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
|
|
558
570
|
reply_markup?:
|
|
559
571
|
| InlineKeyboardMarkup
|
|
@@ -579,10 +591,8 @@ export type ApiMethods<F> = {
|
|
|
579
591
|
disable_notification?: boolean;
|
|
580
592
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
581
593
|
protect_content?: boolean;
|
|
582
|
-
/**
|
|
583
|
-
|
|
584
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
585
|
-
allow_sending_without_reply?: boolean;
|
|
594
|
+
/** Description of the message to reply to */
|
|
595
|
+
reply_parameters?: ReplyParameters;
|
|
586
596
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove keyboard or to force a reply from the user. */
|
|
587
597
|
reply_markup?:
|
|
588
598
|
| InlineKeyboardMarkup
|
|
@@ -624,10 +634,8 @@ export type ApiMethods<F> = {
|
|
|
624
634
|
disable_notification?: boolean;
|
|
625
635
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
626
636
|
protect_content?: boolean;
|
|
627
|
-
/**
|
|
628
|
-
|
|
629
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
630
|
-
allow_sending_without_reply?: boolean;
|
|
637
|
+
/** Description of the message to reply to */
|
|
638
|
+
reply_parameters?: ReplyParameters;
|
|
631
639
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
|
|
632
640
|
reply_markup?:
|
|
633
641
|
| InlineKeyboardMarkup
|
|
@@ -647,10 +655,8 @@ export type ApiMethods<F> = {
|
|
|
647
655
|
disable_notification?: boolean;
|
|
648
656
|
/** Protects the contents of the sent message from forwarding */
|
|
649
657
|
protect_content?: boolean;
|
|
650
|
-
/**
|
|
651
|
-
|
|
652
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
653
|
-
allow_sending_without_reply?: boolean;
|
|
658
|
+
/** Description of the message to reply to */
|
|
659
|
+
reply_parameters?: ReplyParameters;
|
|
654
660
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
|
|
655
661
|
reply_markup?:
|
|
656
662
|
| InlineKeyboardMarkup
|
|
@@ -658,6 +664,18 @@ export type ApiMethods<F> = {
|
|
|
658
664
|
| ReplyKeyboardRemove
|
|
659
665
|
| ForceReply;
|
|
660
666
|
}): Message.DiceMessage;
|
|
667
|
+
|
|
668
|
+
/** Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. In albums, bots must react to the first message. Returns True on success. */
|
|
669
|
+
setMessageReaction(args: {
|
|
670
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
671
|
+
chat_id: number | string;
|
|
672
|
+
/** Identifier of the target message */
|
|
673
|
+
message_id: number;
|
|
674
|
+
/** New list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. */
|
|
675
|
+
reaction?: ReactionType[];
|
|
676
|
+
/** Pass True to set the reaction with a big animation */
|
|
677
|
+
is_big?: boolean;
|
|
678
|
+
}): true;
|
|
661
679
|
/** 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.
|
|
662
680
|
|
|
663
681
|
Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of "Retrieving image, please wait...", the bot may use sendChatAction with action = upload_photo. The user will see a "sending photo" status for the bot.
|
|
@@ -911,7 +929,7 @@ export type ApiMethods<F> = {
|
|
|
911
929
|
/** Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) */
|
|
912
930
|
chat_id: number | string;
|
|
913
931
|
}): true;
|
|
914
|
-
/** Use this method to get up to date information about the chat
|
|
932
|
+
/** Use this method to get up to date information about the chat. Returns a Chat object on success. */
|
|
915
933
|
getChat(args: {
|
|
916
934
|
/** Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) */
|
|
917
935
|
chat_id: number | string;
|
|
@@ -1055,6 +1073,13 @@ export type ApiMethods<F> = {
|
|
|
1055
1073
|
/** The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0. */
|
|
1056
1074
|
cache_time?: number;
|
|
1057
1075
|
}): true;
|
|
1076
|
+
/** Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a UserChatBoosts object. */
|
|
1077
|
+
getUserChatBoosts(args: {
|
|
1078
|
+
/** Unique identifier for the chat or username of the channel (in the format @channelusername) */
|
|
1079
|
+
chat_id: number | string;
|
|
1080
|
+
/** Unique identifier of the target user */
|
|
1081
|
+
user_id: number;
|
|
1082
|
+
}): UserChatBoosts;
|
|
1058
1083
|
/** Use this method to change the bot's name. Returns True on success. */
|
|
1059
1084
|
setMyName(args: {
|
|
1060
1085
|
/** New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language. */
|
|
@@ -1223,6 +1248,13 @@ export type ApiMethods<F> = {
|
|
|
1223
1248
|
/** Identifier of the message to delete */
|
|
1224
1249
|
message_id: number;
|
|
1225
1250
|
}): true;
|
|
1251
|
+
/** Use this method to delete multiple messages simultaneously. Returns True on success. */
|
|
1252
|
+
deleteMessages(args: {
|
|
1253
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1254
|
+
chat_id: number | string;
|
|
1255
|
+
/** Identifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted */
|
|
1256
|
+
message_ids: number[];
|
|
1257
|
+
}): true;
|
|
1226
1258
|
/** Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned. */
|
|
1227
1259
|
sendSticker(args: {
|
|
1228
1260
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
@@ -1237,10 +1269,8 @@ export type ApiMethods<F> = {
|
|
|
1237
1269
|
disable_notification?: boolean;
|
|
1238
1270
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
1239
1271
|
protect_content?: boolean;
|
|
1240
|
-
/**
|
|
1241
|
-
|
|
1242
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
1243
|
-
allow_sending_without_reply?: boolean;
|
|
1272
|
+
/** Description of the message to reply to */
|
|
1273
|
+
reply_parameters?: ReplyParameters;
|
|
1244
1274
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
|
|
1245
1275
|
reply_markup?:
|
|
1246
1276
|
| InlineKeyboardMarkup
|
|
@@ -1431,10 +1461,8 @@ export type ApiMethods<F> = {
|
|
|
1431
1461
|
disable_notification?: boolean;
|
|
1432
1462
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
1433
1463
|
protect_content?: boolean;
|
|
1434
|
-
/**
|
|
1435
|
-
|
|
1436
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
1437
|
-
allow_sending_without_reply?: boolean;
|
|
1464
|
+
/** Description of the message to reply to */
|
|
1465
|
+
reply_parameters?: ReplyParameters;
|
|
1438
1466
|
/** An object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button. */
|
|
1439
1467
|
reply_markup?: InlineKeyboardMarkup;
|
|
1440
1468
|
}): Message.InvoiceMessage;
|
|
@@ -1522,10 +1550,8 @@ export type ApiMethods<F> = {
|
|
|
1522
1550
|
disable_notification?: boolean;
|
|
1523
1551
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
1524
1552
|
protect_content?: boolean;
|
|
1525
|
-
/**
|
|
1526
|
-
|
|
1527
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
1528
|
-
allow_sending_without_reply?: boolean;
|
|
1553
|
+
/** Description of the message to reply to */
|
|
1554
|
+
reply_parameters?: ReplyParameters;
|
|
1529
1555
|
/** An object for an inline keyboard. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game. */
|
|
1530
1556
|
reply_markup?: InlineKeyboardMarkup;
|
|
1531
1557
|
}): Message.GameMessage;
|
package/src/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * from "./telegramTypes
|
|
2
|
-
export * from "./inlineTypes
|
|
3
|
-
export * from "./manageTypes
|
|
4
|
-
export * from "./markupTypes
|
|
5
|
-
export * from "./messageTypes
|
|
6
|
-
export * from "./apiMethodsTypes
|
|
7
|
-
export * from "./passportTypes
|
|
8
|
-
export * from "./invoiceTypes
|
|
9
|
-
export * from "./botCommandTypes
|
|
10
|
-
export * from "./updateTypes
|
|
1
|
+
export * from "./telegramTypes";
|
|
2
|
+
export * from "./inlineTypes";
|
|
3
|
+
export * from "./manageTypes";
|
|
4
|
+
export * from "./markupTypes";
|
|
5
|
+
export * from "./messageTypes";
|
|
6
|
+
export * from "./apiMethodsTypes";
|
|
7
|
+
export * from "./passportTypes";
|
|
8
|
+
export * from "./invoiceTypes";
|
|
9
|
+
export * from "./botCommandTypes";
|
|
10
|
+
export * from "./updateTypes";
|
package/src/inlineTypes.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import type { Chat, User } from "./manageTypes
|
|
2
|
-
import type { InlineKeyboardMarkup, WebAppInfo } from "./markupTypes
|
|
3
|
-
import type {
|
|
4
|
-
|
|
1
|
+
import type { Chat, User } from "./manageTypes";
|
|
2
|
+
import type { InlineKeyboardMarkup, WebAppInfo } from "./markupTypes";
|
|
3
|
+
import type {
|
|
4
|
+
LinkPreviewOptions,
|
|
5
|
+
Location,
|
|
6
|
+
MessageEntity,
|
|
7
|
+
ParseMode,
|
|
8
|
+
} from "./messageTypes";
|
|
9
|
+
import type { LabeledPrice } from "./invoiceTypes";
|
|
5
10
|
/** This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results. */
|
|
6
11
|
export interface InlineQuery {
|
|
7
12
|
/** Unique identifier for this query */
|
|
@@ -599,8 +604,8 @@ export interface InputTextMessageContent {
|
|
|
599
604
|
parse_mode?: ParseMode;
|
|
600
605
|
/** List of special entities that appear in message text, which can be specified instead of parse_mode */
|
|
601
606
|
entities?: MessageEntity[];
|
|
602
|
-
/**
|
|
603
|
-
|
|
607
|
+
/** Link preview generation options for the message */
|
|
608
|
+
link_preview_options?: LinkPreviewOptions;
|
|
604
609
|
}
|
|
605
610
|
/** Represents the content of a location message to be sent as the result of an inline query. */
|
|
606
611
|
export interface InputLocationMessageContent {
|
package/src/invoiceTypes.d.ts
CHANGED