@grammyjs/types 3.3.1 → 3.4.1
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/api.d.ts +1 -1
- package/inline.d.ts +3 -3
- package/manage.d.ts +111 -46
- package/markup.d.ts +15 -13
- package/message.d.ts +319 -35
- package/methods.d.ts +151 -94
- package/package.json +1 -1
- package/update.d.ts +10 -2
package/methods.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { InlineQueryResult, InlineQueryResultsButton } from "./inline.js";
|
|
2
|
-
import type { BotCommand, ChatAdministratorRights, ChatFromGetChat, ChatInviteLink, ChatMember, ChatMemberAdministrator, ChatMemberOwner, ChatPermissions,
|
|
2
|
+
import type { BotCommand, ChatAdministratorRights, ChatFromGetChat, ChatInviteLink, ChatMember, ChatMemberAdministrator, ChatMemberOwner, ChatPermissions, ForumTopic, UserChatBoosts, UserFromGetMe, UserProfilePhotos, WebhookInfo } from "./manage.js";
|
|
3
3
|
import type { ForceReply, InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove } from "./markup.js";
|
|
4
|
-
import type { GameHighScore, MaskPosition, Message, MessageEntity, MessageId, ParseMode, Poll, SentWebAppMessage, Sticker, StickerSet } from "./message.js";
|
|
4
|
+
import type { GameHighScore, LinkPreviewOptions, MaskPosition, Message, MessageEntity, MessageId, ParseMode, Poll, ReactionType, ReplyParameters, SentWebAppMessage, Sticker, StickerSet } from "./message.js";
|
|
5
5
|
import type { PassportElementError } from "./passport.js";
|
|
6
6
|
import type { LabeledPrice, ShippingOption } from "./payment.js";
|
|
7
7
|
import type { BotCommandScope, BotDescription, BotName, BotShortDescription, MenuButton } from "./settings.js";
|
|
@@ -26,7 +26,7 @@ export type ApiMethods<F> = {
|
|
|
26
26
|
limit?: number;
|
|
27
27
|
/** 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. */
|
|
28
28
|
timeout?: number;
|
|
29
|
-
/** A list of the update types you want your bot to receive. For example, specify [
|
|
29
|
+
/** 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.
|
|
30
30
|
|
|
31
31
|
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. */
|
|
32
32
|
allowed_updates?: ReadonlyArray<Exclude<keyof Update, "update_id">>;
|
|
@@ -50,7 +50,7 @@ export type ApiMethods<F> = {
|
|
|
50
50
|
ip_address?: string;
|
|
51
51
|
/** 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. */
|
|
52
52
|
max_connections?: number;
|
|
53
|
-
/** A list of the update types you want your bot to receive. For example, specify [
|
|
53
|
+
/** 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.
|
|
54
54
|
|
|
55
55
|
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. */
|
|
56
56
|
allowed_updates?: ReadonlyArray<Exclude<keyof Update, "update_id">>;
|
|
@@ -84,20 +84,20 @@ export type ApiMethods<F> = {
|
|
|
84
84
|
parse_mode?: ParseMode;
|
|
85
85
|
/** A list of special entities that appear in message text, which can be specified instead of parse_mode */
|
|
86
86
|
entities?: MessageEntity[];
|
|
87
|
-
/**
|
|
88
|
-
|
|
87
|
+
/** Link preview generation options for the message */
|
|
88
|
+
link_preview_options?: LinkPreviewOptions;
|
|
89
89
|
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
90
90
|
disable_notification?: boolean;
|
|
91
91
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
92
92
|
protect_content?: boolean;
|
|
93
|
-
/**
|
|
94
|
-
|
|
95
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
96
|
-
allow_sending_without_reply?: boolean;
|
|
93
|
+
/** Description of the message to reply to */
|
|
94
|
+
reply_parameters?: ReplyParameters;
|
|
97
95
|
/** 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. */
|
|
98
96
|
reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
97
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
98
|
+
reply_to_message_id?: number;
|
|
99
99
|
}): Message.TextMessage;
|
|
100
|
-
/** Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent Message is returned. */
|
|
100
|
+
/** 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. */
|
|
101
101
|
forwardMessage(args: {
|
|
102
102
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
103
103
|
chat_id: number | string;
|
|
@@ -112,7 +112,22 @@ export type ApiMethods<F> = {
|
|
|
112
112
|
/** Message identifier in the chat specified in from_chat_id */
|
|
113
113
|
message_id: number;
|
|
114
114
|
}): Message;
|
|
115
|
-
/** Use this method to
|
|
115
|
+
/** 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. */
|
|
116
|
+
forwardMessages(args: {
|
|
117
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
118
|
+
chat_id: number | string;
|
|
119
|
+
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
120
|
+
message_thread_id?: number;
|
|
121
|
+
/** Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername) */
|
|
122
|
+
from_chat_id: number | string;
|
|
123
|
+
/** Identifiers of 1-100 messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. */
|
|
124
|
+
message_ids: number[];
|
|
125
|
+
/** Sends the messages silently. Users will receive a notification with no sound. */
|
|
126
|
+
disable_notification?: boolean;
|
|
127
|
+
/** Protects the contents of the forwarded messages from forwarding and saving */
|
|
128
|
+
protect_content?: boolean;
|
|
129
|
+
}): MessageId[];
|
|
130
|
+
/** Use this method to copy messages of any kind. 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 forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success. */
|
|
116
131
|
copyMessage(args: {
|
|
117
132
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
118
133
|
chat_id: number | string;
|
|
@@ -132,13 +147,30 @@ export type ApiMethods<F> = {
|
|
|
132
147
|
disable_notification?: boolean;
|
|
133
148
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
134
149
|
protect_content?: boolean;
|
|
135
|
-
/**
|
|
136
|
-
|
|
137
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
138
|
-
allow_sending_without_reply?: boolean;
|
|
150
|
+
/** Description of the message to reply to */
|
|
151
|
+
reply_parameters?: ReplyParameters;
|
|
139
152
|
/** 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. */
|
|
140
153
|
reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
154
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
155
|
+
reply_to_message_id?: number;
|
|
141
156
|
}): MessageId;
|
|
157
|
+
/** 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. */
|
|
158
|
+
copyMessages(args: {
|
|
159
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
160
|
+
chat_id: number | string;
|
|
161
|
+
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
162
|
+
message_thread_id?: number;
|
|
163
|
+
/** Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername) */
|
|
164
|
+
from_chat_id: number | string;
|
|
165
|
+
/** Identifiers of 1-100 messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. */
|
|
166
|
+
message_ids: number[];
|
|
167
|
+
/** Sends the messages silently. Users will receive a notification with no sound. */
|
|
168
|
+
disable_notification?: boolean;
|
|
169
|
+
/** Protects the contents of the sent messages from forwarding and saving */
|
|
170
|
+
protect_content?: boolean;
|
|
171
|
+
/** Pass True to copy the messages without their captions */
|
|
172
|
+
remove_caption?: boolean;
|
|
173
|
+
}): MessageId[];
|
|
142
174
|
/** Use this method to send photos. On success, the sent Message is returned. */
|
|
143
175
|
sendPhoto(args: {
|
|
144
176
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
@@ -159,12 +191,12 @@ export type ApiMethods<F> = {
|
|
|
159
191
|
disable_notification?: boolean;
|
|
160
192
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
161
193
|
protect_content?: boolean;
|
|
162
|
-
/**
|
|
163
|
-
|
|
164
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
165
|
-
allow_sending_without_reply?: boolean;
|
|
194
|
+
/** Description of the message to reply to */
|
|
195
|
+
reply_parameters?: ReplyParameters;
|
|
166
196
|
/** 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. */
|
|
167
197
|
reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
198
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
199
|
+
reply_to_message_id?: number;
|
|
168
200
|
}): Message.PhotoMessage;
|
|
169
201
|
/** 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.
|
|
170
202
|
|
|
@@ -194,12 +226,12 @@ export type ApiMethods<F> = {
|
|
|
194
226
|
disable_notification?: boolean;
|
|
195
227
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
196
228
|
protect_content?: boolean;
|
|
197
|
-
/**
|
|
198
|
-
|
|
199
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
200
|
-
allow_sending_without_reply?: boolean;
|
|
229
|
+
/** Description of the message to reply to */
|
|
230
|
+
reply_parameters?: ReplyParameters;
|
|
201
231
|
/** 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. */
|
|
202
232
|
reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
233
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
234
|
+
reply_to_message_id?: number;
|
|
203
235
|
}): Message.AudioMessage;
|
|
204
236
|
/** Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. */
|
|
205
237
|
sendDocument(args: {
|
|
@@ -223,12 +255,12 @@ export type ApiMethods<F> = {
|
|
|
223
255
|
disable_notification?: boolean;
|
|
224
256
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
225
257
|
protect_content?: boolean;
|
|
226
|
-
/**
|
|
227
|
-
|
|
228
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
229
|
-
allow_sending_without_reply?: boolean;
|
|
258
|
+
/** Description of the message to reply to */
|
|
259
|
+
reply_parameters?: ReplyParameters;
|
|
230
260
|
/** 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. */
|
|
231
261
|
reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
262
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
263
|
+
reply_to_message_id?: number;
|
|
232
264
|
}): Message.DocumentMessage;
|
|
233
265
|
/** Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future. */
|
|
234
266
|
sendVideo(args: {
|
|
@@ -260,12 +292,12 @@ export type ApiMethods<F> = {
|
|
|
260
292
|
disable_notification?: boolean;
|
|
261
293
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
262
294
|
protect_content?: boolean;
|
|
263
|
-
/**
|
|
264
|
-
|
|
265
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
266
|
-
allow_sending_without_reply?: boolean;
|
|
295
|
+
/** Description of the message to reply to */
|
|
296
|
+
reply_parameters?: ReplyParameters;
|
|
267
297
|
/** 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. */
|
|
268
298
|
reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
299
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
300
|
+
reply_to_message_id?: number;
|
|
269
301
|
}): Message.VideoMessage;
|
|
270
302
|
/** Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. */
|
|
271
303
|
sendAnimation(args: {
|
|
@@ -295,12 +327,12 @@ export type ApiMethods<F> = {
|
|
|
295
327
|
disable_notification?: boolean;
|
|
296
328
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
297
329
|
protect_content?: boolean;
|
|
298
|
-
/**
|
|
299
|
-
|
|
300
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
301
|
-
allow_sending_without_reply?: boolean;
|
|
330
|
+
/** Description of the message to reply to */
|
|
331
|
+
reply_parameters?: ReplyParameters;
|
|
302
332
|
/** 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. */
|
|
303
333
|
reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
334
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
335
|
+
reply_to_message_id?: number;
|
|
304
336
|
}): Message.AnimationMessage;
|
|
305
337
|
/** Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. */
|
|
306
338
|
sendVoice(args: {
|
|
@@ -322,12 +354,12 @@ export type ApiMethods<F> = {
|
|
|
322
354
|
disable_notification?: boolean;
|
|
323
355
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
324
356
|
protect_content?: boolean;
|
|
325
|
-
/**
|
|
326
|
-
|
|
327
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
328
|
-
allow_sending_without_reply?: boolean;
|
|
357
|
+
/** Description of the message to reply to */
|
|
358
|
+
reply_parameters?: ReplyParameters;
|
|
329
359
|
/** 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. */
|
|
330
360
|
reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
361
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
362
|
+
reply_to_message_id?: number;
|
|
331
363
|
}): Message.VoiceMessage;
|
|
332
364
|
/** Use this method to send video messages. On success, the sent Message is returned.
|
|
333
365
|
As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. */
|
|
@@ -348,12 +380,12 @@ export type ApiMethods<F> = {
|
|
|
348
380
|
disable_notification?: boolean;
|
|
349
381
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
350
382
|
protect_content?: boolean;
|
|
351
|
-
/**
|
|
352
|
-
|
|
353
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
354
|
-
allow_sending_without_reply?: boolean;
|
|
383
|
+
/** Description of the message to reply to */
|
|
384
|
+
reply_parameters?: ReplyParameters;
|
|
355
385
|
/** 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. */
|
|
356
386
|
reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
387
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
388
|
+
reply_to_message_id?: number;
|
|
357
389
|
}): Message.VideoNoteMessage;
|
|
358
390
|
/** 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. */
|
|
359
391
|
sendMediaGroup(args: {
|
|
@@ -367,10 +399,10 @@ export type ApiMethods<F> = {
|
|
|
367
399
|
disable_notification?: boolean;
|
|
368
400
|
/** Protects the contents of the sent messages from forwarding and saving */
|
|
369
401
|
protect_content?: boolean;
|
|
370
|
-
/**
|
|
402
|
+
/** Description of the message to reply to */
|
|
403
|
+
reply_parameters?: ReplyParameters;
|
|
404
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
371
405
|
reply_to_message_id?: number;
|
|
372
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
373
|
-
allow_sending_without_reply?: boolean;
|
|
374
406
|
}): Array<Message.AudioMessage | Message.DocumentMessage | Message.PhotoMessage | Message.VideoMessage>;
|
|
375
407
|
/** Use this method to send point on the map. On success, the sent Message is returned. */
|
|
376
408
|
sendLocation(args: {
|
|
@@ -394,12 +426,12 @@ export type ApiMethods<F> = {
|
|
|
394
426
|
disable_notification?: boolean;
|
|
395
427
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
396
428
|
protect_content?: boolean;
|
|
397
|
-
/**
|
|
398
|
-
|
|
399
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
400
|
-
allow_sending_without_reply?: boolean;
|
|
429
|
+
/** Description of the message to reply to */
|
|
430
|
+
reply_parameters?: ReplyParameters;
|
|
401
431
|
/** 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. */
|
|
402
432
|
reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
433
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
434
|
+
reply_to_message_id?: number;
|
|
403
435
|
}): Message.LocationMessage;
|
|
404
436
|
/** Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. */
|
|
405
437
|
editMessageLiveLocation(args: {
|
|
@@ -459,12 +491,12 @@ export type ApiMethods<F> = {
|
|
|
459
491
|
disable_notification?: boolean;
|
|
460
492
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
461
493
|
protect_content?: boolean;
|
|
462
|
-
/**
|
|
463
|
-
|
|
464
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
465
|
-
allow_sending_without_reply?: boolean;
|
|
494
|
+
/** Description of the message to reply to */
|
|
495
|
+
reply_parameters?: ReplyParameters;
|
|
466
496
|
/** 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. */
|
|
467
497
|
reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
498
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
499
|
+
reply_to_message_id?: number;
|
|
468
500
|
}): Message.VenueMessage;
|
|
469
501
|
/** Use this method to send phone contacts. On success, the sent Message is returned. */
|
|
470
502
|
sendContact(args: {
|
|
@@ -484,12 +516,12 @@ export type ApiMethods<F> = {
|
|
|
484
516
|
disable_notification?: boolean;
|
|
485
517
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
486
518
|
protect_content?: boolean;
|
|
487
|
-
/**
|
|
488
|
-
|
|
489
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
490
|
-
allow_sending_without_reply?: boolean;
|
|
519
|
+
/** Description of the message to reply to */
|
|
520
|
+
reply_parameters?: ReplyParameters;
|
|
491
521
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove keyboard or to force a reply from the user. */
|
|
492
522
|
reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
523
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
524
|
+
reply_to_message_id?: number;
|
|
493
525
|
}): Message.ContactMessage;
|
|
494
526
|
/** Use this method to send a native poll. On success, the sent Message is returned. */
|
|
495
527
|
sendPoll(args: {
|
|
@@ -525,12 +557,12 @@ export type ApiMethods<F> = {
|
|
|
525
557
|
disable_notification?: boolean;
|
|
526
558
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
527
559
|
protect_content?: boolean;
|
|
528
|
-
/**
|
|
529
|
-
|
|
530
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
531
|
-
allow_sending_without_reply?: boolean;
|
|
560
|
+
/** Description of the message to reply to */
|
|
561
|
+
reply_parameters?: ReplyParameters;
|
|
532
562
|
/** 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. */
|
|
533
563
|
reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
564
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
565
|
+
reply_to_message_id?: number;
|
|
534
566
|
}): Message.PollMessage;
|
|
535
567
|
/** Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned. */
|
|
536
568
|
sendDice(args: {
|
|
@@ -544,12 +576,12 @@ export type ApiMethods<F> = {
|
|
|
544
576
|
disable_notification?: boolean;
|
|
545
577
|
/** Protects the contents of the sent message from forwarding */
|
|
546
578
|
protect_content?: boolean;
|
|
547
|
-
/**
|
|
548
|
-
|
|
549
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
550
|
-
allow_sending_without_reply?: boolean;
|
|
579
|
+
/** Description of the message to reply to */
|
|
580
|
+
reply_parameters?: ReplyParameters;
|
|
551
581
|
/** 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. */
|
|
552
582
|
reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
583
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
584
|
+
reply_to_message_id?: number;
|
|
553
585
|
}): Message.DiceMessage;
|
|
554
586
|
/** 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.
|
|
555
587
|
|
|
@@ -564,6 +596,17 @@ export type ApiMethods<F> = {
|
|
|
564
596
|
/** Unique identifier for the target message thread; supergroups only */
|
|
565
597
|
message_thread_id?: number;
|
|
566
598
|
}): true;
|
|
599
|
+
/** 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. */
|
|
600
|
+
setMessageReaction(args: {
|
|
601
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
602
|
+
chat_id: number | string;
|
|
603
|
+
/** Identifier of the target message */
|
|
604
|
+
message_id: number;
|
|
605
|
+
/** 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. */
|
|
606
|
+
reaction?: ReactionType[];
|
|
607
|
+
/** Pass True to set the reaction with a big animation */
|
|
608
|
+
is_big?: boolean;
|
|
609
|
+
}): true;
|
|
567
610
|
/** Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object. */
|
|
568
611
|
getUserProfilePhotos(args: {
|
|
569
612
|
/** Unique identifier of the target user */
|
|
@@ -793,7 +836,7 @@ export type ApiMethods<F> = {
|
|
|
793
836
|
/** Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) */
|
|
794
837
|
chat_id: number | string;
|
|
795
838
|
}): true;
|
|
796
|
-
/** Use this method to get up to date information about the chat
|
|
839
|
+
/** Use this method to get up to date information about the chat. Returns a Chat object on success. */
|
|
797
840
|
getChat(args: {
|
|
798
841
|
/** Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) */
|
|
799
842
|
chat_id: number | string;
|
|
@@ -931,18 +974,13 @@ export type ApiMethods<F> = {
|
|
|
931
974
|
/** 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. */
|
|
932
975
|
cache_time?: number;
|
|
933
976
|
}): true;
|
|
934
|
-
/** Use this method to
|
|
935
|
-
|
|
936
|
-
/**
|
|
937
|
-
|
|
938
|
-
/**
|
|
939
|
-
|
|
940
|
-
}):
|
|
941
|
-
/** Use this method to get the current bot name for the given user language. Returns BotName on success. */
|
|
942
|
-
getMyName(args: {
|
|
943
|
-
/** A two-letter ISO 639-1 language code or an empty string */
|
|
944
|
-
language_code?: string;
|
|
945
|
-
}): BotName;
|
|
977
|
+
/** 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. */
|
|
978
|
+
getUserChatBoosts(args: {
|
|
979
|
+
/** Unique identifier for the chat or username of the channel (in the format @channelusername) */
|
|
980
|
+
chat_id: number | string;
|
|
981
|
+
/** Unique identifier of the target user */
|
|
982
|
+
user_id: number;
|
|
983
|
+
}): UserChatBoosts;
|
|
946
984
|
/** Use this method to change the list of the bot's commands. See https://core.telegram.org/bots#commands for more details about bot commands. Returns True on success. */
|
|
947
985
|
setMyCommands(args: {
|
|
948
986
|
/** A list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified. */
|
|
@@ -966,6 +1004,18 @@ export type ApiMethods<F> = {
|
|
|
966
1004
|
/** A two-letter ISO 639-1 language code or an empty string */
|
|
967
1005
|
language_code?: string;
|
|
968
1006
|
}): BotCommand[];
|
|
1007
|
+
/** Use this method to change the bot's name. Returns True on success. */
|
|
1008
|
+
setMyName(args: {
|
|
1009
|
+
/** New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language. */
|
|
1010
|
+
name?: string;
|
|
1011
|
+
/** A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose language there is no dedicated name. */
|
|
1012
|
+
language_code?: string;
|
|
1013
|
+
}): true;
|
|
1014
|
+
/** Use this method to get the current bot name for the given user language. Returns BotName on success. */
|
|
1015
|
+
getMyName(args: {
|
|
1016
|
+
/** A two-letter ISO 639-1 language code or an empty string */
|
|
1017
|
+
language_code?: string;
|
|
1018
|
+
}): BotName;
|
|
969
1019
|
/** Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns True on success. */
|
|
970
1020
|
setMyDescription(args: {
|
|
971
1021
|
/** New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language. */
|
|
@@ -1028,8 +1078,8 @@ export type ApiMethods<F> = {
|
|
|
1028
1078
|
parse_mode?: ParseMode;
|
|
1029
1079
|
/** A list of special entities that appear in message text, which can be specified instead of parse_mode */
|
|
1030
1080
|
entities?: MessageEntity[];
|
|
1031
|
-
/**
|
|
1032
|
-
|
|
1081
|
+
/** Link preview generation options for the message */
|
|
1082
|
+
link_preview_options?: LinkPreviewOptions;
|
|
1033
1083
|
/** An object for an inline keyboard. */
|
|
1034
1084
|
reply_markup?: InlineKeyboardMarkup;
|
|
1035
1085
|
}): (Update.Edited & Message.TextMessage) | true;
|
|
@@ -1099,6 +1149,13 @@ export type ApiMethods<F> = {
|
|
|
1099
1149
|
/** Identifier of the message to delete */
|
|
1100
1150
|
message_id: number;
|
|
1101
1151
|
}): true;
|
|
1152
|
+
/** Use this method to delete multiple messages simultaneously. Returns True on success. */
|
|
1153
|
+
deleteMessages(args: {
|
|
1154
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1155
|
+
chat_id: number | string;
|
|
1156
|
+
/** Identifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted */
|
|
1157
|
+
message_ids: number[];
|
|
1158
|
+
}): true;
|
|
1102
1159
|
/** Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned. */
|
|
1103
1160
|
sendSticker(args: {
|
|
1104
1161
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
@@ -1113,12 +1170,12 @@ export type ApiMethods<F> = {
|
|
|
1113
1170
|
disable_notification?: boolean;
|
|
1114
1171
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
1115
1172
|
protect_content?: boolean;
|
|
1116
|
-
/**
|
|
1117
|
-
|
|
1118
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
1119
|
-
allow_sending_without_reply?: boolean;
|
|
1173
|
+
/** Description of the message to reply to */
|
|
1174
|
+
reply_parameters?: ReplyParameters;
|
|
1120
1175
|
/** 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. */
|
|
1121
1176
|
reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
1177
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
1178
|
+
reply_to_message_id?: number;
|
|
1122
1179
|
}): Message.StickerMessage;
|
|
1123
1180
|
/** Use this method to get a sticker set. On success, a StickerSet object is returned. */
|
|
1124
1181
|
getStickerSet(args: {
|
|
@@ -1303,12 +1360,12 @@ export type ApiMethods<F> = {
|
|
|
1303
1360
|
disable_notification?: boolean;
|
|
1304
1361
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
1305
1362
|
protect_content?: boolean;
|
|
1306
|
-
/**
|
|
1307
|
-
|
|
1308
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
1309
|
-
allow_sending_without_reply?: boolean;
|
|
1363
|
+
/** Description of the message to reply to */
|
|
1364
|
+
reply_parameters?: ReplyParameters;
|
|
1310
1365
|
/** 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. */
|
|
1311
1366
|
reply_markup?: InlineKeyboardMarkup;
|
|
1367
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
1368
|
+
reply_to_message_id?: number;
|
|
1312
1369
|
}): Message.InvoiceMessage;
|
|
1313
1370
|
/** Use this method to create a link for an invoice. Returns the created invoice link as String on success. */
|
|
1314
1371
|
createInvoiceLink(args: {
|
|
@@ -1394,12 +1451,12 @@ export type ApiMethods<F> = {
|
|
|
1394
1451
|
disable_notification?: boolean;
|
|
1395
1452
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
1396
1453
|
protect_content?: boolean;
|
|
1397
|
-
/**
|
|
1398
|
-
|
|
1399
|
-
/** Pass True if the message should be sent even if the specified replied-to message is not found */
|
|
1400
|
-
allow_sending_without_reply?: boolean;
|
|
1454
|
+
/** Description of the message to reply to */
|
|
1455
|
+
reply_parameters?: ReplyParameters;
|
|
1401
1456
|
/** 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. */
|
|
1402
1457
|
reply_markup?: InlineKeyboardMarkup;
|
|
1458
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
1459
|
+
reply_to_message_id?: number;
|
|
1403
1460
|
}): Message.GameMessage;
|
|
1404
1461
|
/** Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the Message is returned, otherwise True is returned. Returns an error, if the new score is not greater than the user's current score in the chat and force is False. */
|
|
1405
1462
|
setGameScore(args: {
|
package/package.json
CHANGED
package/update.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ChosenInlineResult, InlineQuery } from "./inline.js";
|
|
2
|
-
import type { Chat, ChatJoinRequest, ChatMemberUpdated, User } from "./manage.js";
|
|
2
|
+
import type { Chat, ChatBoostRemoved, ChatBoostUpdated, ChatJoinRequest, ChatMemberUpdated, User } from "./manage.js";
|
|
3
3
|
import type { CallbackQuery } from "./markup.js";
|
|
4
|
-
import type { Message, Poll, PollAnswer } from "./message.js";
|
|
4
|
+
import type { Message, MessageReactionCountUpdated, MessageReactionUpdated, Poll, PollAnswer } from "./message.js";
|
|
5
5
|
import type { PreCheckoutQuery, ShippingQuery } from "./payment.js";
|
|
6
6
|
/** Internal namespace used to make some message types more accurate */
|
|
7
7
|
export declare namespace Update {
|
|
@@ -33,6 +33,10 @@ export interface Update {
|
|
|
33
33
|
channel_post?: Message & Update.Channel;
|
|
34
34
|
/** New version of a channel post that is known to the bot and was edited */
|
|
35
35
|
edited_channel_post?: Message & Update.Edited & Update.Channel;
|
|
36
|
+
/** A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify "message_reaction" in the list of allowed_updates to receive these updates. The update isn't received for reactions set by bots. */
|
|
37
|
+
message_reaction?: MessageReactionUpdated;
|
|
38
|
+
/** Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify "message_reaction_count" in the list of allowed_updates to receive these updates. */
|
|
39
|
+
message_reaction_count?: MessageReactionCountUpdated;
|
|
36
40
|
/** New incoming inline query */
|
|
37
41
|
inline_query?: InlineQuery;
|
|
38
42
|
/** The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot. */
|
|
@@ -53,4 +57,8 @@ export interface Update {
|
|
|
53
57
|
chat_member?: ChatMemberUpdated;
|
|
54
58
|
/** A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates. */
|
|
55
59
|
chat_join_request?: ChatJoinRequest;
|
|
60
|
+
/** A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates. */
|
|
61
|
+
chat_boost?: ChatBoostUpdated;
|
|
62
|
+
/** A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates. */
|
|
63
|
+
removed_chat_boost?: ChatBoostRemoved;
|
|
56
64
|
}
|