@telegram.ts/types 1.22.1 → 1.23.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/package.json +1 -1
- package/src/apiMethodsTypes.d.ts +424 -248
- package/src/botCommandTypes.d.ts +3 -3
- package/src/checkListTask.d.ts +76 -0
- package/src/index.d.ts +1 -0
- package/src/invoiceTypes.d.ts +82 -3
- package/src/manageTypes.d.ts +26 -6
- package/src/markupTypes.d.ts +4 -4
- package/src/messageTypes.d.ts +86 -1
package/src/apiMethodsTypes.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ReadStream } from "node:fs";
|
|
2
2
|
import type { Buffer } from "node:buffer";
|
|
3
3
|
import type { LanguageCode } from "./languageTypes";
|
|
4
|
+
import type { InputChecklist } from "./checkListTask";
|
|
4
5
|
import type {
|
|
5
6
|
InlineQueryResult,
|
|
6
7
|
InlineQueryResultsButton,
|
|
@@ -46,6 +47,7 @@ import type {
|
|
|
46
47
|
Sticker,
|
|
47
48
|
StickerSet,
|
|
48
49
|
Story,
|
|
50
|
+
SuggestedPostParameters,
|
|
49
51
|
} from "./messageTypes";
|
|
50
52
|
import type { PassportElementError } from "./passportTypes";
|
|
51
53
|
import type {
|
|
@@ -86,7 +88,7 @@ export type ApiMethods = {
|
|
|
86
88
|
allowed_updates?: ReadonlyArray<Exclude<keyof Update, "update_id">>;
|
|
87
89
|
}): Update[];
|
|
88
90
|
|
|
89
|
-
/** Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized Update. In case of an unsuccessful request (a request with response HTTP status code different from 2XY), we will repeat the request
|
|
91
|
+
/** Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized Update. In case of an unsuccessful request (a request with response HTTP status code different from 2XY), we will repeat the request and give up after a reasonable amount of attempts. Returns True on success.
|
|
90
92
|
|
|
91
93
|
If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secret_token. If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content.
|
|
92
94
|
|
|
@@ -141,6 +143,8 @@ export type ApiMethods = {
|
|
|
141
143
|
chat_id: number | string;
|
|
142
144
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
143
145
|
message_thread_id?: number;
|
|
146
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
147
|
+
direct_messages_topic_id?: number;
|
|
144
148
|
/** Text of the message to be sent, 1-4096 characters after entities parsing */
|
|
145
149
|
text: string;
|
|
146
150
|
/** Mode for parsing entities in the message text. See formatting options for more details. */
|
|
@@ -155,6 +159,8 @@ export type ApiMethods = {
|
|
|
155
159
|
protect_content?: boolean;
|
|
156
160
|
/** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
|
|
157
161
|
allow_paid_broadcast?: boolean;
|
|
162
|
+
/** An object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */
|
|
163
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
158
164
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
159
165
|
message_effect_id?: string;
|
|
160
166
|
/** Description of the message to reply to */
|
|
@@ -165,6 +171,8 @@ export type ApiMethods = {
|
|
|
165
171
|
| ReplyKeyboardMarkup
|
|
166
172
|
| ReplyKeyboardRemove
|
|
167
173
|
| ForceReply;
|
|
174
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
175
|
+
reply_to_message_id?: number;
|
|
168
176
|
}): Message.TextMessage;
|
|
169
177
|
|
|
170
178
|
/** 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. */
|
|
@@ -173,10 +181,14 @@ export type ApiMethods = {
|
|
|
173
181
|
chat_id: number | string;
|
|
174
182
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
175
183
|
message_thread_id?: number;
|
|
184
|
+
/** Identifier of the direct messages topic to which the message will be forwarded; required if the message is forwarded to a direct messages chat */
|
|
185
|
+
direct_messages_topic_id?: number;
|
|
176
186
|
/** Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) */
|
|
177
187
|
from_chat_id: number | string;
|
|
178
188
|
/** New start timestamp for the copied video in the message */
|
|
179
189
|
video_start_timestamp?: number;
|
|
190
|
+
/** An object containing the parameters of the suggested post to send; for direct messages chats only */
|
|
191
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
180
192
|
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
181
193
|
disable_notification?: boolean;
|
|
182
194
|
/** Protects the contents of the forwarded message from forwarding and saving */
|
|
@@ -191,6 +203,8 @@ export type ApiMethods = {
|
|
|
191
203
|
chat_id: number | string;
|
|
192
204
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
193
205
|
message_thread_id?: number;
|
|
206
|
+
/** Identifier of the direct messages topic to which the messages will be forwarded; required if the messages are forwarded to a direct messages chat */
|
|
207
|
+
direct_messages_topic_id?: number;
|
|
194
208
|
/** Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername) */
|
|
195
209
|
from_chat_id: number | string;
|
|
196
210
|
/** A list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. */
|
|
@@ -207,12 +221,14 @@ export type ApiMethods = {
|
|
|
207
221
|
chat_id: number | string;
|
|
208
222
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
209
223
|
message_thread_id?: number;
|
|
224
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
225
|
+
direct_messages_topic_id?: number;
|
|
210
226
|
/** Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) */
|
|
211
227
|
from_chat_id: number | string;
|
|
212
|
-
/** New start timestamp for the copied video in the message */
|
|
213
|
-
video_start_timestamp?: number;
|
|
214
228
|
/** Message identifier in the chat specified in from_chat_id */
|
|
215
229
|
message_id: number;
|
|
230
|
+
/** New start timestamp for the copied video in the message */
|
|
231
|
+
video_start_timestamp?: number;
|
|
216
232
|
/** New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept */
|
|
217
233
|
caption?: string;
|
|
218
234
|
/** Mode for parsing entities in the new caption. See formatting options for more details. */
|
|
@@ -223,10 +239,12 @@ export type ApiMethods = {
|
|
|
223
239
|
show_caption_above_media?: boolean;
|
|
224
240
|
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
225
241
|
disable_notification?: boolean;
|
|
226
|
-
/** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
|
|
227
|
-
allow_paid_broadcast?: boolean;
|
|
228
242
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
229
243
|
protect_content?: boolean;
|
|
244
|
+
/** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
|
|
245
|
+
allow_paid_broadcast?: boolean;
|
|
246
|
+
/** An object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */
|
|
247
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
230
248
|
/** Description of the message to reply to */
|
|
231
249
|
reply_parameters?: ReplyParameters;
|
|
232
250
|
/** 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. */
|
|
@@ -235,14 +253,18 @@ export type ApiMethods = {
|
|
|
235
253
|
| ReplyKeyboardMarkup
|
|
236
254
|
| ReplyKeyboardRemove
|
|
237
255
|
| ForceReply;
|
|
256
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
257
|
+
reply_to_message_id?: number;
|
|
238
258
|
}): MessageId;
|
|
239
259
|
|
|
240
|
-
/** Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages,
|
|
260
|
+
/** Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of MessageId of the sent messages is returned. */
|
|
241
261
|
copyMessages(args: {
|
|
242
262
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
243
263
|
chat_id: number | string;
|
|
244
264
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
245
265
|
message_thread_id?: number;
|
|
266
|
+
/** Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat */
|
|
267
|
+
direct_messages_topic_id?: number;
|
|
246
268
|
/** Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername) */
|
|
247
269
|
from_chat_id: number | string;
|
|
248
270
|
/** A list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. */
|
|
@@ -263,6 +285,8 @@ export type ApiMethods = {
|
|
|
263
285
|
chat_id: number | string;
|
|
264
286
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
265
287
|
message_thread_id?: number;
|
|
288
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
289
|
+
direct_messages_topic_id?: number;
|
|
266
290
|
/** Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. */
|
|
267
291
|
photo: Buffer | ReadStream | string;
|
|
268
292
|
/** Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing */
|
|
@@ -281,6 +305,8 @@ export type ApiMethods = {
|
|
|
281
305
|
protect_content?: boolean;
|
|
282
306
|
/** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
|
|
283
307
|
allow_paid_broadcast?: boolean;
|
|
308
|
+
/** An object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */
|
|
309
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
284
310
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
285
311
|
message_effect_id?: string;
|
|
286
312
|
/** Description of the message to reply to */
|
|
@@ -291,6 +317,8 @@ export type ApiMethods = {
|
|
|
291
317
|
| ReplyKeyboardMarkup
|
|
292
318
|
| ReplyKeyboardRemove
|
|
293
319
|
| ForceReply;
|
|
320
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
321
|
+
reply_to_message_id?: number;
|
|
294
322
|
}): Message.PhotoMessage;
|
|
295
323
|
|
|
296
324
|
/** 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.
|
|
@@ -303,6 +331,8 @@ export type ApiMethods = {
|
|
|
303
331
|
chat_id: number | string;
|
|
304
332
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
305
333
|
message_thread_id?: number;
|
|
334
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
335
|
+
direct_messages_topic_id?: number;
|
|
306
336
|
/** Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. */
|
|
307
337
|
audio: Buffer | ReadStream | string;
|
|
308
338
|
/** Audio caption, 0-1024 characters after entities parsing */
|
|
@@ -325,6 +355,8 @@ export type ApiMethods = {
|
|
|
325
355
|
protect_content?: boolean;
|
|
326
356
|
/** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
|
|
327
357
|
allow_paid_broadcast?: boolean;
|
|
358
|
+
/** An object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */
|
|
359
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
328
360
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
329
361
|
message_effect_id?: string;
|
|
330
362
|
/** Description of the message to reply to */
|
|
@@ -335,6 +367,8 @@ export type ApiMethods = {
|
|
|
335
367
|
| ReplyKeyboardMarkup
|
|
336
368
|
| ReplyKeyboardRemove
|
|
337
369
|
| ForceReply;
|
|
370
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
371
|
+
reply_to_message_id?: number;
|
|
338
372
|
}): Message.AudioMessage;
|
|
339
373
|
|
|
340
374
|
/** 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. */
|
|
@@ -345,6 +379,8 @@ export type ApiMethods = {
|
|
|
345
379
|
chat_id: number | string;
|
|
346
380
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
347
381
|
message_thread_id?: number;
|
|
382
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
383
|
+
direct_messages_topic_id?: number;
|
|
348
384
|
/** File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. */
|
|
349
385
|
document: Buffer | ReadStream | string;
|
|
350
386
|
/** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. */
|
|
@@ -363,6 +399,8 @@ export type ApiMethods = {
|
|
|
363
399
|
protect_content?: boolean;
|
|
364
400
|
/** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
|
|
365
401
|
allow_paid_broadcast?: boolean;
|
|
402
|
+
/** An object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */
|
|
403
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
366
404
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
367
405
|
message_effect_id?: string;
|
|
368
406
|
/** Description of the message to reply to */
|
|
@@ -373,6 +411,8 @@ export type ApiMethods = {
|
|
|
373
411
|
| ReplyKeyboardMarkup
|
|
374
412
|
| ReplyKeyboardRemove
|
|
375
413
|
| ForceReply;
|
|
414
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
415
|
+
reply_to_message_id?: number;
|
|
376
416
|
}): Message.DocumentMessage;
|
|
377
417
|
|
|
378
418
|
/** 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. */
|
|
@@ -383,6 +423,8 @@ export type ApiMethods = {
|
|
|
383
423
|
chat_id: number | string;
|
|
384
424
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
385
425
|
message_thread_id?: number;
|
|
426
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
427
|
+
direct_messages_topic_id?: number;
|
|
386
428
|
/** Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. */
|
|
387
429
|
video: Buffer | ReadStream | string;
|
|
388
430
|
/** Duration of sent video in seconds */
|
|
@@ -415,6 +457,8 @@ export type ApiMethods = {
|
|
|
415
457
|
protect_content?: boolean;
|
|
416
458
|
/** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
|
|
417
459
|
allow_paid_broadcast?: boolean;
|
|
460
|
+
/** An object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */
|
|
461
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
418
462
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
419
463
|
message_effect_id?: string;
|
|
420
464
|
/** Description of the message to reply to */
|
|
@@ -425,6 +469,8 @@ export type ApiMethods = {
|
|
|
425
469
|
| ReplyKeyboardMarkup
|
|
426
470
|
| ReplyKeyboardRemove
|
|
427
471
|
| ForceReply;
|
|
472
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
473
|
+
reply_to_message_id?: number;
|
|
428
474
|
}): Message.VideoMessage;
|
|
429
475
|
|
|
430
476
|
/** 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. */
|
|
@@ -435,6 +481,8 @@ export type ApiMethods = {
|
|
|
435
481
|
chat_id: number | string;
|
|
436
482
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
437
483
|
message_thread_id?: number;
|
|
484
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
485
|
+
direct_messages_topic_id?: number;
|
|
438
486
|
/** Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. */
|
|
439
487
|
animation: Buffer | ReadStream | string;
|
|
440
488
|
/** Duration of sent animation in seconds */
|
|
@@ -461,6 +509,8 @@ export type ApiMethods = {
|
|
|
461
509
|
protect_content?: boolean;
|
|
462
510
|
/** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
|
|
463
511
|
allow_paid_broadcast?: boolean;
|
|
512
|
+
/** An object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */
|
|
513
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
464
514
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
465
515
|
message_effect_id?: string;
|
|
466
516
|
/** Description of the message to reply to */
|
|
@@ -471,6 +521,8 @@ export type ApiMethods = {
|
|
|
471
521
|
| ReplyKeyboardMarkup
|
|
472
522
|
| ReplyKeyboardRemove
|
|
473
523
|
| ForceReply;
|
|
524
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
525
|
+
reply_to_message_id?: number;
|
|
474
526
|
}): Message.AnimationMessage;
|
|
475
527
|
|
|
476
528
|
/** 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, or in .MP3 format, or in .M4A format (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. */
|
|
@@ -481,6 +533,8 @@ export type ApiMethods = {
|
|
|
481
533
|
chat_id: number | string;
|
|
482
534
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
483
535
|
message_thread_id?: number;
|
|
536
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
537
|
+
direct_messages_topic_id?: number;
|
|
484
538
|
/** Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. */
|
|
485
539
|
voice: Buffer | ReadStream | string;
|
|
486
540
|
/** Voice message caption, 0-1024 characters after entities parsing */
|
|
@@ -497,6 +551,8 @@ export type ApiMethods = {
|
|
|
497
551
|
protect_content?: boolean;
|
|
498
552
|
/** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
|
|
499
553
|
allow_paid_broadcast?: boolean;
|
|
554
|
+
/** An object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */
|
|
555
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
500
556
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
501
557
|
message_effect_id?: string;
|
|
502
558
|
/** Description of the message to reply to */
|
|
@@ -507,6 +563,8 @@ export type ApiMethods = {
|
|
|
507
563
|
| ReplyKeyboardMarkup
|
|
508
564
|
| ReplyKeyboardRemove
|
|
509
565
|
| ForceReply;
|
|
566
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
567
|
+
reply_to_message_id?: number;
|
|
510
568
|
}): Message.VoiceMessage;
|
|
511
569
|
|
|
512
570
|
/** Use this method to send video messages. On success, the sent Message is returned.
|
|
@@ -518,6 +576,8 @@ export type ApiMethods = {
|
|
|
518
576
|
chat_id: number | string;
|
|
519
577
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
520
578
|
message_thread_id?: number;
|
|
579
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
580
|
+
direct_messages_topic_id?: number;
|
|
521
581
|
/** Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data.. Sending video notes by a URL is currently unsupported */
|
|
522
582
|
video_note: Buffer | ReadStream | string;
|
|
523
583
|
/** Duration of sent video in seconds */
|
|
@@ -532,6 +592,8 @@ export type ApiMethods = {
|
|
|
532
592
|
protect_content?: boolean;
|
|
533
593
|
/** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
|
|
534
594
|
allow_paid_broadcast?: boolean;
|
|
595
|
+
/** An object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */
|
|
596
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
535
597
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
536
598
|
message_effect_id?: string;
|
|
537
599
|
/** Description of the message to reply to */
|
|
@@ -542,6 +604,8 @@ export type ApiMethods = {
|
|
|
542
604
|
| ReplyKeyboardMarkup
|
|
543
605
|
| ReplyKeyboardRemove
|
|
544
606
|
| ForceReply;
|
|
607
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
608
|
+
reply_to_message_id?: number;
|
|
545
609
|
}): Message.VideoNoteMessage;
|
|
546
610
|
|
|
547
611
|
/** 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. */
|
|
@@ -552,6 +616,8 @@ export type ApiMethods = {
|
|
|
552
616
|
chat_id: number | string;
|
|
553
617
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
554
618
|
message_thread_id?: number;
|
|
619
|
+
/** Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat */
|
|
620
|
+
direct_messages_topic_id?: number;
|
|
555
621
|
/** An array describing messages to be sent, must include 2-10 items */
|
|
556
622
|
media: ReadonlyArray<
|
|
557
623
|
InputMediaAudio | InputMediaDocument | InputMediaPhoto | InputMediaVideo
|
|
@@ -566,6 +632,8 @@ export type ApiMethods = {
|
|
|
566
632
|
message_effect_id?: string;
|
|
567
633
|
/** Description of the message to reply to */
|
|
568
634
|
reply_parameters?: ReplyParameters;
|
|
635
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
636
|
+
reply_to_message_id?: number;
|
|
569
637
|
}): Array<
|
|
570
638
|
| Message.AudioMessage
|
|
571
639
|
| Message.DocumentMessage
|
|
@@ -581,6 +649,8 @@ export type ApiMethods = {
|
|
|
581
649
|
chat_id: number | string;
|
|
582
650
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
583
651
|
message_thread_id?: number;
|
|
652
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
653
|
+
direct_messages_topic_id?: number;
|
|
584
654
|
/** Latitude of the location */
|
|
585
655
|
latitude: number;
|
|
586
656
|
/** Longitude of the location */
|
|
@@ -599,6 +669,8 @@ export type ApiMethods = {
|
|
|
599
669
|
protect_content?: boolean;
|
|
600
670
|
/** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
|
|
601
671
|
allow_paid_broadcast?: boolean;
|
|
672
|
+
/** An object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */
|
|
673
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
602
674
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
603
675
|
message_effect_id?: string;
|
|
604
676
|
/** Description of the message to reply to */
|
|
@@ -609,6 +681,8 @@ export type ApiMethods = {
|
|
|
609
681
|
| ReplyKeyboardMarkup
|
|
610
682
|
| ReplyKeyboardRemove
|
|
611
683
|
| ForceReply;
|
|
684
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
685
|
+
reply_to_message_id?: number;
|
|
612
686
|
}): Message.LocationMessage;
|
|
613
687
|
|
|
614
688
|
/** 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. */
|
|
@@ -651,12 +725,14 @@ export type ApiMethods = {
|
|
|
651
725
|
reply_markup?: InlineKeyboardMarkup;
|
|
652
726
|
}): (Update.Edited & Message.LocationMessage) | true;
|
|
653
727
|
|
|
654
|
-
/** Use this method to send paid media
|
|
728
|
+
/** Use this method to send paid media. On success, the sent Message is returned. */
|
|
655
729
|
sendPaidMedia(args: {
|
|
656
|
-
/** Unique identifier of the business connection on behalf of which the message
|
|
730
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
657
731
|
business_connection_id?: string;
|
|
658
|
-
/** Unique identifier for the target chat or username of the target channel (in the format
|
|
732
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance. */
|
|
659
733
|
chat_id: number | string;
|
|
734
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
735
|
+
direct_messages_topic_id?: number;
|
|
660
736
|
/** The number of Telegram Stars that must be paid to buy access to the media; 1-2500 */
|
|
661
737
|
star_count: number;
|
|
662
738
|
/** An array describing the media to be sent; up to 10 items */
|
|
@@ -673,10 +749,12 @@ export type ApiMethods = {
|
|
|
673
749
|
show_caption_above_media?: boolean;
|
|
674
750
|
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
675
751
|
disable_notification?: boolean;
|
|
676
|
-
/** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
|
|
677
|
-
allow_paid_broadcast?: boolean;
|
|
678
752
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
679
753
|
protect_content?: boolean;
|
|
754
|
+
/** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
|
|
755
|
+
allow_paid_broadcast?: boolean;
|
|
756
|
+
/** An object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */
|
|
757
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
680
758
|
/** Description of the message to reply to */
|
|
681
759
|
reply_parameters?: ReplyParameters;
|
|
682
760
|
/** Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user */
|
|
@@ -695,6 +773,8 @@ export type ApiMethods = {
|
|
|
695
773
|
chat_id: number | string;
|
|
696
774
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
697
775
|
message_thread_id?: number;
|
|
776
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
777
|
+
direct_messages_topic_id?: number;
|
|
698
778
|
/** Latitude of the venue */
|
|
699
779
|
latitude: number;
|
|
700
780
|
/** Longitude of the venue */
|
|
@@ -717,6 +797,8 @@ export type ApiMethods = {
|
|
|
717
797
|
protect_content?: boolean;
|
|
718
798
|
/** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
|
|
719
799
|
allow_paid_broadcast?: boolean;
|
|
800
|
+
/** An object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */
|
|
801
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
720
802
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
721
803
|
message_effect_id?: string;
|
|
722
804
|
/** Description of the message to reply to */
|
|
@@ -727,6 +809,8 @@ export type ApiMethods = {
|
|
|
727
809
|
| ReplyKeyboardMarkup
|
|
728
810
|
| ReplyKeyboardRemove
|
|
729
811
|
| ForceReply;
|
|
812
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
813
|
+
reply_to_message_id?: number;
|
|
730
814
|
}): Message.VenueMessage;
|
|
731
815
|
|
|
732
816
|
/** Use this method to send phone contacts. On success, the sent Message is returned. */
|
|
@@ -737,6 +821,8 @@ export type ApiMethods = {
|
|
|
737
821
|
chat_id: number | string;
|
|
738
822
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
739
823
|
message_thread_id?: number;
|
|
824
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
825
|
+
direct_messages_topic_id?: number;
|
|
740
826
|
/** Contact's phone number */
|
|
741
827
|
phone_number: string;
|
|
742
828
|
/** Contact's first name */
|
|
@@ -751,6 +837,8 @@ export type ApiMethods = {
|
|
|
751
837
|
protect_content?: boolean;
|
|
752
838
|
/** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
|
|
753
839
|
allow_paid_broadcast?: boolean;
|
|
840
|
+
/** An object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */
|
|
841
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
754
842
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
755
843
|
message_effect_id?: string;
|
|
756
844
|
/** Description of the message to reply to */
|
|
@@ -761,13 +849,15 @@ export type ApiMethods = {
|
|
|
761
849
|
| ReplyKeyboardMarkup
|
|
762
850
|
| ReplyKeyboardRemove
|
|
763
851
|
| ForceReply;
|
|
852
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
853
|
+
reply_to_message_id?: number;
|
|
764
854
|
}): Message.ContactMessage;
|
|
765
855
|
|
|
766
856
|
/** Use this method to send a native poll. On success, the sent Message is returned. */
|
|
767
857
|
sendPoll(args: {
|
|
768
858
|
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
769
859
|
business_connection_id?: string;
|
|
770
|
-
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
860
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername). Polls can't be sent to channel direct messages chats. */
|
|
771
861
|
chat_id: number | string;
|
|
772
862
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
773
863
|
message_thread_id?: number;
|
|
@@ -777,7 +867,7 @@ export type ApiMethods = {
|
|
|
777
867
|
question_parse_mode?: ParseMode;
|
|
778
868
|
/** A list of special entities that appear in the poll question. It can be specified instead of question_parse_mode */
|
|
779
869
|
question_entities?: MessageEntity[];
|
|
780
|
-
/** A list of 2-
|
|
870
|
+
/** A list of 2-12 answer options */
|
|
781
871
|
options: InputPollOption[];
|
|
782
872
|
/** True, if the poll needs to be anonymous, defaults to True */
|
|
783
873
|
is_anonymous?: boolean;
|
|
@@ -815,8 +905,44 @@ export type ApiMethods = {
|
|
|
815
905
|
| ReplyKeyboardMarkup
|
|
816
906
|
| ReplyKeyboardRemove
|
|
817
907
|
| ForceReply;
|
|
908
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
909
|
+
reply_to_message_id?: number;
|
|
818
910
|
}): Message.PollMessage;
|
|
819
911
|
|
|
912
|
+
/** Use this method to send a checklist on behalf of a connected business account. On success, the sent Message is returned. */
|
|
913
|
+
sendChecklist(args: {
|
|
914
|
+
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
915
|
+
business_connection_id: string;
|
|
916
|
+
/** Unique identifier for the target chat */
|
|
917
|
+
chat_id: number;
|
|
918
|
+
/** An object for the checklist to send */
|
|
919
|
+
checklist: InputChecklist;
|
|
920
|
+
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
921
|
+
disable_notification?: boolean;
|
|
922
|
+
/** Protects the contents of the sent message from forwarding and saving */
|
|
923
|
+
protect_content?: boolean;
|
|
924
|
+
/** Unique identifier of the message effect to be added to the message */
|
|
925
|
+
message_effect_id?: string;
|
|
926
|
+
/** An object for description of the message to reply to */
|
|
927
|
+
reply_parameters?: ReplyParameters;
|
|
928
|
+
/** An object for an inline keyboard */
|
|
929
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
930
|
+
}): Message.ChecklistMessage;
|
|
931
|
+
|
|
932
|
+
/** Use this method to edit a checklist on behalf of a connected business account. On success, the edited Message is returned. */
|
|
933
|
+
editMessageChecklist(args: {
|
|
934
|
+
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
935
|
+
business_connection_id: string;
|
|
936
|
+
/** Unique identifier for the target chat */
|
|
937
|
+
chat_id: number;
|
|
938
|
+
/** Unique identifier for the target message */
|
|
939
|
+
message_id: number;
|
|
940
|
+
/** An object for the new checklist */
|
|
941
|
+
checklist: InputChecklist;
|
|
942
|
+
/** An object for the new inline keyboard for the message */
|
|
943
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
944
|
+
}): Message.ChecklistMessage;
|
|
945
|
+
|
|
820
946
|
/** Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned. */
|
|
821
947
|
sendDice(args: {
|
|
822
948
|
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
@@ -825,14 +951,25 @@ export type ApiMethods = {
|
|
|
825
951
|
chat_id: number | string;
|
|
826
952
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
827
953
|
message_thread_id?: number;
|
|
954
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
955
|
+
direct_messages_topic_id?: number;
|
|
828
956
|
/** Emoji on which the dice throw animation is based. Currently, must be one of "🎲", "🎯", "🏀", "⚽", "🎳", or "🎰". Dice can have values 1-6 for "🎲", "🎯" and "🎳", values 1-5 for "🏀" and "⚽", and values 1-64 for "🎰". Defaults to "🎲" */
|
|
829
|
-
emoji?:
|
|
957
|
+
emoji?:
|
|
958
|
+
| (string & Record<never, never>)
|
|
959
|
+
| "🎲"
|
|
960
|
+
| "🎯"
|
|
961
|
+
| "🏀"
|
|
962
|
+
| "⚽"
|
|
963
|
+
| "🎳"
|
|
964
|
+
| "🎰";
|
|
830
965
|
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
831
966
|
disable_notification?: boolean;
|
|
832
967
|
/** Protects the contents of the sent message from forwarding */
|
|
833
968
|
protect_content?: boolean;
|
|
834
969
|
/** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
|
|
835
970
|
allow_paid_broadcast?: boolean;
|
|
971
|
+
/** An object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */
|
|
972
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
836
973
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
837
974
|
message_effect_id?: string;
|
|
838
975
|
/** Description of the message to reply to */
|
|
@@ -843,6 +980,8 @@ export type ApiMethods = {
|
|
|
843
980
|
| ReplyKeyboardMarkup
|
|
844
981
|
| ReplyKeyboardRemove
|
|
845
982
|
| ForceReply;
|
|
983
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
984
|
+
reply_to_message_id?: number;
|
|
846
985
|
}): Message.DiceMessage;
|
|
847
986
|
|
|
848
987
|
/** 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.
|
|
@@ -853,7 +992,7 @@ export type ApiMethods = {
|
|
|
853
992
|
sendChatAction(args: {
|
|
854
993
|
/** Unique identifier of the business connection on behalf of which the action will be sent */
|
|
855
994
|
business_connection_id?: string;
|
|
856
|
-
/** Unique identifier for the target chat or username of the target
|
|
995
|
+
/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). Channel chats and channel direct messages chats aren't supported. */
|
|
857
996
|
chat_id: number | string;
|
|
858
997
|
/** Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes. */
|
|
859
998
|
action:
|
|
@@ -872,23 +1011,13 @@ export type ApiMethods = {
|
|
|
872
1011
|
message_thread_id?: number;
|
|
873
1012
|
}): true;
|
|
874
1013
|
|
|
875
|
-
/**
|
|
876
|
-
readBusinessMessage(args: {
|
|
877
|
-
/** Unique identifier of the business connection on behalf of which to read the message */
|
|
878
|
-
business_connection_id: string;
|
|
879
|
-
/** Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours. */
|
|
880
|
-
chat_id: number;
|
|
881
|
-
/** Unique identifier of the message to mark as read */
|
|
882
|
-
message_id: number;
|
|
883
|
-
}): true;
|
|
884
|
-
|
|
885
|
-
/** Use this method to change the chosen reactions on a message. Service messages of some types 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. */
|
|
1014
|
+
/** Use this method to change the chosen reactions on a message. Service messages of some types 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. Bots can't use paid reactions. Returns True on success. */
|
|
886
1015
|
setMessageReaction(args: {
|
|
887
1016
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
888
1017
|
chat_id: number | string;
|
|
889
1018
|
/** Identifier of the target message */
|
|
890
1019
|
message_id: number;
|
|
891
|
-
/** A
|
|
1020
|
+
/** A 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. Paid reactions can't be used by bots. */
|
|
892
1021
|
reaction?: ReactionType[];
|
|
893
1022
|
/** Pass True to set the reaction with a big animation */
|
|
894
1023
|
is_big?: boolean;
|
|
@@ -922,9 +1051,6 @@ export type ApiMethods = {
|
|
|
922
1051
|
file_id: string;
|
|
923
1052
|
}): File;
|
|
924
1053
|
|
|
925
|
-
/** Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. */
|
|
926
|
-
kickChatMember: ApiMethods["banChatMember"];
|
|
927
|
-
|
|
928
1054
|
/** Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. */
|
|
929
1055
|
banChatMember(args: {
|
|
930
1056
|
/** Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername) */
|
|
@@ -969,7 +1095,7 @@ export type ApiMethods = {
|
|
|
969
1095
|
user_id: number;
|
|
970
1096
|
/** Pass True if the administrator's presence in the chat is hidden */
|
|
971
1097
|
is_anonymous?: boolean;
|
|
972
|
-
/** Pass True if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages
|
|
1098
|
+
/** Pass True if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege. */
|
|
973
1099
|
can_manage_chat?: boolean;
|
|
974
1100
|
/** Pass True if the administrator can delete messages of other users */
|
|
975
1101
|
can_delete_messages?: boolean;
|
|
@@ -989,7 +1115,7 @@ export type ApiMethods = {
|
|
|
989
1115
|
can_edit_stories?: boolean;
|
|
990
1116
|
/** True if the administrator can delete stories posted by other users */
|
|
991
1117
|
can_delete_stories?: boolean;
|
|
992
|
-
/** True if the administrator can post messages in the channel, or access channel statistics; for channels only */
|
|
1118
|
+
/** Pass True if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only */
|
|
993
1119
|
can_post_messages?: boolean;
|
|
994
1120
|
/** True if the administrator can edit messages of other users and can pin messages; for channels only */
|
|
995
1121
|
can_edit_messages?: boolean;
|
|
@@ -997,6 +1123,8 @@ export type ApiMethods = {
|
|
|
997
1123
|
can_pin_messages?: boolean;
|
|
998
1124
|
/** True if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only */
|
|
999
1125
|
can_manage_topics?: boolean;
|
|
1126
|
+
/** Pass True if the administrator can manage direct messages within the channel and decline suggested posts; for channels only */
|
|
1127
|
+
can_manage_direct_messages?: boolean;
|
|
1000
1128
|
}): true;
|
|
1001
1129
|
|
|
1002
1130
|
/** Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success. */
|
|
@@ -1079,7 +1207,7 @@ export type ApiMethods = {
|
|
|
1079
1207
|
chat_id: number | string;
|
|
1080
1208
|
/** Invite link name; 0-32 characters */
|
|
1081
1209
|
name?: string;
|
|
1082
|
-
/** The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days) */
|
|
1210
|
+
/** The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days). */
|
|
1083
1211
|
subscription_period: number;
|
|
1084
1212
|
/** The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500 */
|
|
1085
1213
|
subscription_price: number;
|
|
@@ -1087,7 +1215,7 @@ export type ApiMethods = {
|
|
|
1087
1215
|
|
|
1088
1216
|
/** Use this method to edit a subscription invite link created by the bot. The bot must have the can_invite_users administrator rights. Returns the edited invite link as a ChatInviteLink object. */
|
|
1089
1217
|
editChatSubscriptionInviteLink(args: {
|
|
1090
|
-
/** Unique identifier for the target
|
|
1218
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1091
1219
|
chat_id: number | string;
|
|
1092
1220
|
/** The invite link to edit */
|
|
1093
1221
|
invite_link: string;
|
|
@@ -1119,6 +1247,26 @@ export type ApiMethods = {
|
|
|
1119
1247
|
user_id: number;
|
|
1120
1248
|
}): true;
|
|
1121
1249
|
|
|
1250
|
+
/** Use this method to approve a suggested post in a direct messages chat. The bot must have the 'can_post_messages' administrator right in the corresponding channel chat. Returns True on success. */
|
|
1251
|
+
approveSuggestedPost(args: {
|
|
1252
|
+
/** Unique identifier for the target direct messages chat */
|
|
1253
|
+
chat_id: number;
|
|
1254
|
+
/** Identifier of a suggested post message to approve */
|
|
1255
|
+
message_id: number;
|
|
1256
|
+
/** Point in time (Unix timestamp) when the post is expected to be published; omit if the date has already been specified when the suggested post was created. If specified, then the date must be not more than 2678400 seconds (30 days) in the future */
|
|
1257
|
+
send_date?: number;
|
|
1258
|
+
}): true;
|
|
1259
|
+
|
|
1260
|
+
/** Use this method to decline a suggested post in a direct messages chat. The bot must have the 'can_manage_direct_messages' administrator right in the corresponding channel chat. Returns True on success. */
|
|
1261
|
+
declineSuggestedPost(args: {
|
|
1262
|
+
/** Unique identifier for the target direct messages chat */
|
|
1263
|
+
chat_id: number;
|
|
1264
|
+
/** Identifier of a suggested post message to decline */
|
|
1265
|
+
message_id: number;
|
|
1266
|
+
/** Comment for the creator of the suggested post; 0-128 characters */
|
|
1267
|
+
comment?: string;
|
|
1268
|
+
}): true;
|
|
1269
|
+
|
|
1122
1270
|
/** Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. */
|
|
1123
1271
|
setChatPhoto(args: {
|
|
1124
1272
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
@@ -1149,7 +1297,7 @@ export type ApiMethods = {
|
|
|
1149
1297
|
description?: string;
|
|
1150
1298
|
}): true;
|
|
1151
1299
|
|
|
1152
|
-
/** Use this method to add a message to the list of pinned messages in a chat.
|
|
1300
|
+
/** Use this method to add a message to the list of pinned messages in a chat. In private chats and channel direct messages chats, all non-service messages can be pinned. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to pin messages in groups and channels respectively. Returns True on success. */
|
|
1153
1301
|
pinChatMessage(args: {
|
|
1154
1302
|
/** Unique identifier of the business connection on behalf of which the message will be pinned */
|
|
1155
1303
|
business_connection_id?: string;
|
|
@@ -1161,7 +1309,7 @@ export type ApiMethods = {
|
|
|
1161
1309
|
disable_notification?: boolean;
|
|
1162
1310
|
}): true;
|
|
1163
1311
|
|
|
1164
|
-
/** Use this method to remove a message from the list of pinned messages in a chat.
|
|
1312
|
+
/** Use this method to remove a message from the list of pinned messages in a chat. In private chats and channel direct messages chats, all messages can be unpinned. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin messages in groups and channels respectively. Returns True on success. */
|
|
1165
1313
|
unpinChatMessage(args: {
|
|
1166
1314
|
/** Unique identifier of the business connection on behalf of which the message will be unpinned */
|
|
1167
1315
|
business_connection_id?: string;
|
|
@@ -1171,7 +1319,7 @@ export type ApiMethods = {
|
|
|
1171
1319
|
message_id?: number;
|
|
1172
1320
|
}): true;
|
|
1173
1321
|
|
|
1174
|
-
/** Use this method to clear the list of pinned messages in a chat.
|
|
1322
|
+
/** Use this method to clear the list of pinned messages in a chat. In private chats and channel direct messages chats, no additional rights are required to unpin all pinned messages. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin all pinned messages in groups and channels respectively. Returns True on success. */
|
|
1175
1323
|
unpinAllChatMessages(args: {
|
|
1176
1324
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1177
1325
|
chat_id: number | string;
|
|
@@ -1179,7 +1327,7 @@ export type ApiMethods = {
|
|
|
1179
1327
|
|
|
1180
1328
|
/** Use this method for your bot to leave a group, supergroup or channel. Returns True on success. */
|
|
1181
1329
|
leaveChat(args: {
|
|
1182
|
-
/** Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) */
|
|
1330
|
+
/** Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername). Channel direct messages chats aren't supported; leave the corresponding channel instead. */
|
|
1183
1331
|
chat_id: number | string;
|
|
1184
1332
|
}): true;
|
|
1185
1333
|
|
|
@@ -1243,7 +1391,7 @@ export type ApiMethods = {
|
|
|
1243
1391
|
icon_custom_emoji_id?: string;
|
|
1244
1392
|
}): ForumTopic;
|
|
1245
1393
|
|
|
1246
|
-
/** Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success. */
|
|
1394
|
+
/** Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success. */
|
|
1247
1395
|
editForumTopic(args: {
|
|
1248
1396
|
/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
|
|
1249
1397
|
chat_id: number | string;
|
|
@@ -1287,7 +1435,7 @@ export type ApiMethods = {
|
|
|
1287
1435
|
message_thread_id: number;
|
|
1288
1436
|
}): true;
|
|
1289
1437
|
|
|
1290
|
-
/** Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights. Returns True on success. */
|
|
1438
|
+
/** Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success. */
|
|
1291
1439
|
editGeneralForumTopic(args: {
|
|
1292
1440
|
/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
|
|
1293
1441
|
chat_id: number | string;
|
|
@@ -1453,6 +1601,129 @@ export type ApiMethods = {
|
|
|
1453
1601
|
for_channels?: boolean;
|
|
1454
1602
|
}): ChatAdministratorRights;
|
|
1455
1603
|
|
|
1604
|
+
/** A method to get the current Telegram Stars balance of the bot. Requires no parameters. On success, returns a StarAmount object. */
|
|
1605
|
+
getMyStarBalance(): StarAmount;
|
|
1606
|
+
|
|
1607
|
+
/** 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. */
|
|
1608
|
+
editMessageText(args: {
|
|
1609
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
1610
|
+
business_connection_id?: string;
|
|
1611
|
+
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1612
|
+
chat_id?: number | string;
|
|
1613
|
+
/** Required if inline_message_id is not specified. Identifier of the message to edit */
|
|
1614
|
+
message_id?: number;
|
|
1615
|
+
/** Required if chat_id and message_id are not specified. Identifier of the inline message */
|
|
1616
|
+
inline_message_id?: string;
|
|
1617
|
+
/** New text of the message, 1-4096 characters after entities parsing */
|
|
1618
|
+
text: string;
|
|
1619
|
+
/** Mode for parsing entities in the message text. See formatting options for more details. */
|
|
1620
|
+
parse_mode?: ParseMode;
|
|
1621
|
+
/** A list of special entities that appear in message text, which can be specified instead of parse_mode */
|
|
1622
|
+
entities?: MessageEntity[];
|
|
1623
|
+
/** Link preview generation options for the message */
|
|
1624
|
+
link_preview_options?: LinkPreviewOptions;
|
|
1625
|
+
/** An object for an inline keyboard. */
|
|
1626
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
1627
|
+
}): (Update.Edited & Message.TextMessage) | true;
|
|
1628
|
+
|
|
1629
|
+
/** Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. 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. */
|
|
1630
|
+
editMessageCaption(args: {
|
|
1631
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
1632
|
+
business_connection_id?: string;
|
|
1633
|
+
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1634
|
+
chat_id?: number | string;
|
|
1635
|
+
/** Required if inline_message_id is not specified. Identifier of the message to edit */
|
|
1636
|
+
message_id?: number;
|
|
1637
|
+
/** Required if chat_id and message_id are not specified. Identifier of the inline message */
|
|
1638
|
+
inline_message_id?: string;
|
|
1639
|
+
/** New caption of the message, 0-1024 characters after entities parsing */
|
|
1640
|
+
caption?: string;
|
|
1641
|
+
/** Mode for parsing entities in the message caption. See formatting options for more details. */
|
|
1642
|
+
parse_mode?: ParseMode;
|
|
1643
|
+
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
1644
|
+
caption_entities?: MessageEntity[];
|
|
1645
|
+
/** Pass True, if the caption must be shown above the message media. Supported only for animation, photo and video messages. */
|
|
1646
|
+
show_caption_above_media?: boolean;
|
|
1647
|
+
/** An object for an inline keyboard. */
|
|
1648
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
1649
|
+
}): (Update.Edited & Message.CaptionableMessage) | true;
|
|
1650
|
+
|
|
1651
|
+
/** Use this method to edit animation, audio, document, photo, or video messages, or to add media to text messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. */
|
|
1652
|
+
editMessageMedia(args: {
|
|
1653
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
1654
|
+
business_connection_id?: string;
|
|
1655
|
+
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1656
|
+
chat_id?: number | string;
|
|
1657
|
+
/** Required if inline_message_id is not specified. Identifier of the message to edit */
|
|
1658
|
+
message_id?: number;
|
|
1659
|
+
/** Required if chat_id and message_id are not specified. Identifier of the inline message */
|
|
1660
|
+
inline_message_id?: string;
|
|
1661
|
+
/** An object for a new media content of the message */
|
|
1662
|
+
media: InputMedia;
|
|
1663
|
+
/** An object for a new inline keyboard. */
|
|
1664
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
1665
|
+
}): (Update.Edited & Message) | true;
|
|
1666
|
+
|
|
1667
|
+
/** Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. 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. */
|
|
1668
|
+
editMessageReplyMarkup(args: {
|
|
1669
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
1670
|
+
business_connection_id?: string;
|
|
1671
|
+
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1672
|
+
chat_id?: number | string;
|
|
1673
|
+
/** Required if inline_message_id is not specified. Identifier of the message to edit */
|
|
1674
|
+
message_id?: number;
|
|
1675
|
+
/** Required if chat_id and message_id are not specified. Identifier of the inline message */
|
|
1676
|
+
inline_message_id?: string;
|
|
1677
|
+
/** An object for an inline keyboard. */
|
|
1678
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
1679
|
+
}): (Update.Edited & Message) | true;
|
|
1680
|
+
|
|
1681
|
+
/** Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned. */
|
|
1682
|
+
stopPoll(args: {
|
|
1683
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
1684
|
+
business_connection_id?: string;
|
|
1685
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1686
|
+
chat_id: number | string;
|
|
1687
|
+
/** Identifier of the original message with the poll */
|
|
1688
|
+
message_id: number;
|
|
1689
|
+
/** An object for a new message inline keyboard. */
|
|
1690
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
1691
|
+
}): Poll;
|
|
1692
|
+
|
|
1693
|
+
/** Use this method to delete a message, including service messages, with the following limitations:
|
|
1694
|
+
- A message can only be deleted if it was sent less than 48 hours ago.
|
|
1695
|
+
- Service messages about a supergroup, channel, or forum topic creation can't be deleted.
|
|
1696
|
+
- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.
|
|
1697
|
+
- Bots can delete outgoing messages in private chats, groups, and supergroups.
|
|
1698
|
+
- Bots can delete incoming messages in private chats.
|
|
1699
|
+
- Bots granted can_post_messages permissions can delete outgoing messages in channels.
|
|
1700
|
+
- If the bot is an administrator of a group, it can delete any message there.
|
|
1701
|
+
- If the bot has can_delete_messages administrator right in a supergroup or a channel, it can delete any message there.
|
|
1702
|
+
- If the bot has can_manage_direct_messages administrator right in a channel, it can delete any message in the corresponding direct messages chat.
|
|
1703
|
+
Returns True on success. */
|
|
1704
|
+
deleteMessage(args: {
|
|
1705
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1706
|
+
chat_id: number | string;
|
|
1707
|
+
/** Identifier of the message to delete */
|
|
1708
|
+
message_id: number;
|
|
1709
|
+
}): true;
|
|
1710
|
+
|
|
1711
|
+
/** Use this method to delete multiple messages simultaneously. Returns True on success. */
|
|
1712
|
+
deleteMessages(args: {
|
|
1713
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1714
|
+
chat_id: number | string;
|
|
1715
|
+
/** A list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted */
|
|
1716
|
+
message_ids: number[];
|
|
1717
|
+
}): true;
|
|
1718
|
+
|
|
1719
|
+
/** Delete messages on behalf of a business account. Requires the can_delete_outgoing_messages business bot right to delete messages sent by the bot itself, or the can_delete_all_messages business bot right to delete any message. Returns True on success. */
|
|
1720
|
+
deleteBusinessMessages(args: {
|
|
1721
|
+
/** Unique identifier of the business connection on behalf of which to delete the messages */
|
|
1722
|
+
business_connection_id: string;
|
|
1723
|
+
/** A list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See deleteMessage for limitations on which messages can be deleted */
|
|
1724
|
+
message_ids: number[];
|
|
1725
|
+
}): true;
|
|
1726
|
+
|
|
1456
1727
|
/** Changes the first and last name of a managed business account. Requires the can_change_name business bot right. Returns True on success. */
|
|
1457
1728
|
setBusinessAccountName(args: {
|
|
1458
1729
|
/** Unique identifier of the business connection */
|
|
@@ -1513,6 +1784,14 @@ export type ApiMethods = {
|
|
|
1513
1784
|
business_connection_id: string;
|
|
1514
1785
|
}): StarAmount;
|
|
1515
1786
|
|
|
1787
|
+
/** Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can_transfer_stars business bot right. Returns True on success. */
|
|
1788
|
+
transferBusinessAccountStars(args: {
|
|
1789
|
+
/** Unique identifier of the business connection */
|
|
1790
|
+
business_connection_id: string;
|
|
1791
|
+
/** Number of Telegram Stars to transfer; 1-10000 */
|
|
1792
|
+
star_count: number;
|
|
1793
|
+
}): true;
|
|
1794
|
+
|
|
1516
1795
|
/** Returns the gifts received and owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns OwnedGifts on success. */
|
|
1517
1796
|
getBusinessAccountGifts(args: {
|
|
1518
1797
|
/** Unique identifier of the business connection */
|
|
@@ -1567,123 +1846,52 @@ export type ApiMethods = {
|
|
|
1567
1846
|
star_count: number;
|
|
1568
1847
|
}): true;
|
|
1569
1848
|
|
|
1570
|
-
/**
|
|
1571
|
-
|
|
1572
|
-
/** Unique identifier of the business connection
|
|
1573
|
-
business_connection_id
|
|
1574
|
-
/**
|
|
1575
|
-
|
|
1576
|
-
/**
|
|
1577
|
-
|
|
1578
|
-
/**
|
|
1579
|
-
|
|
1580
|
-
/**
|
|
1581
|
-
text: string;
|
|
1582
|
-
/** Mode for parsing entities in the message text. See formatting options for more details. */
|
|
1849
|
+
/** Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success. */
|
|
1850
|
+
postStory(args: {
|
|
1851
|
+
/** Unique identifier of the business connection */
|
|
1852
|
+
business_connection_id: string;
|
|
1853
|
+
/** Content of the story */
|
|
1854
|
+
content: InputStoryContent;
|
|
1855
|
+
/** Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 */
|
|
1856
|
+
active_period: number;
|
|
1857
|
+
/** Caption of the story, 0-2048 characters after entities parsing */
|
|
1858
|
+
caption?: string;
|
|
1859
|
+
/** Mode for parsing entities in the story caption. See formatting options for more details. */
|
|
1583
1860
|
parse_mode?: ParseMode;
|
|
1584
|
-
/** A list of special entities that appear in
|
|
1585
|
-
|
|
1586
|
-
/**
|
|
1587
|
-
|
|
1588
|
-
/**
|
|
1589
|
-
|
|
1590
|
-
|
|
1861
|
+
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
1862
|
+
caption_entities?: MessageEntity[];
|
|
1863
|
+
/** A list of clickable areas to be shown on the story */
|
|
1864
|
+
areas?: StoryArea[];
|
|
1865
|
+
/** Pass True to keep the story accessible after it expires */
|
|
1866
|
+
post_to_chat_page?: boolean;
|
|
1867
|
+
/** Pass True if the content of the story must be protected from forwarding and screenshotting */
|
|
1868
|
+
protect_content?: boolean;
|
|
1869
|
+
}): Story;
|
|
1591
1870
|
|
|
1592
|
-
/**
|
|
1593
|
-
|
|
1594
|
-
/** Unique identifier of the business connection
|
|
1595
|
-
business_connection_id
|
|
1596
|
-
/**
|
|
1597
|
-
|
|
1598
|
-
/**
|
|
1599
|
-
|
|
1600
|
-
/**
|
|
1601
|
-
inline_message_id?: string;
|
|
1602
|
-
/** New caption of the message, 0-1024 characters after entities parsing */
|
|
1871
|
+
/** Edits a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success. */
|
|
1872
|
+
editStory(args: {
|
|
1873
|
+
/** Unique identifier of the business connection */
|
|
1874
|
+
business_connection_id: string;
|
|
1875
|
+
/** Unique identifier of the story to edit */
|
|
1876
|
+
story_id: number;
|
|
1877
|
+
/** Content of the story */
|
|
1878
|
+
content: InputStoryContent;
|
|
1879
|
+
/** Caption of the story, 0-2048 characters after entities parsing */
|
|
1603
1880
|
caption?: string;
|
|
1604
|
-
/** Mode for parsing entities in the
|
|
1881
|
+
/** Mode for parsing entities in the story caption. See formatting options for more details. */
|
|
1605
1882
|
parse_mode?: ParseMode;
|
|
1606
1883
|
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
1607
1884
|
caption_entities?: MessageEntity[];
|
|
1608
|
-
/**
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
reply_markup?: InlineKeyboardMarkup;
|
|
1612
|
-
}): (Update.Edited & Message.CaptionableMessage) | true;
|
|
1613
|
-
|
|
1614
|
-
/** Use this method to edit animation, audio, document, photo, or video messages, or to add media to text messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. */
|
|
1615
|
-
editMessageMedia(args: {
|
|
1616
|
-
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
1617
|
-
business_connection_id?: string;
|
|
1618
|
-
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1619
|
-
chat_id?: number | string;
|
|
1620
|
-
/** Required if inline_message_id is not specified. Identifier of the message to edit */
|
|
1621
|
-
message_id?: number;
|
|
1622
|
-
/** Required if chat_id and message_id are not specified. Identifier of the inline message */
|
|
1623
|
-
inline_message_id?: string;
|
|
1624
|
-
/** An object for a new media content of the message */
|
|
1625
|
-
media: InputMedia;
|
|
1626
|
-
/** An object for a new inline keyboard. */
|
|
1627
|
-
reply_markup?: InlineKeyboardMarkup;
|
|
1628
|
-
}): (Update.Edited & Message) | true;
|
|
1629
|
-
|
|
1630
|
-
/** Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. 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. */
|
|
1631
|
-
editMessageReplyMarkup(args: {
|
|
1632
|
-
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
1633
|
-
business_connection_id?: string;
|
|
1634
|
-
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1635
|
-
chat_id?: number | string;
|
|
1636
|
-
/** Required if inline_message_id is not specified. Identifier of the message to edit */
|
|
1637
|
-
message_id?: number;
|
|
1638
|
-
/** Required if chat_id and message_id are not specified. Identifier of the inline message */
|
|
1639
|
-
inline_message_id?: string;
|
|
1640
|
-
/** An object for an inline keyboard. */
|
|
1641
|
-
reply_markup?: InlineKeyboardMarkup;
|
|
1642
|
-
}): (Update.Edited & Message) | true;
|
|
1643
|
-
|
|
1644
|
-
/** Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned. */
|
|
1645
|
-
stopPoll(args: {
|
|
1646
|
-
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
1647
|
-
business_connection_id?: string;
|
|
1648
|
-
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1649
|
-
chat_id: number | string;
|
|
1650
|
-
/** Identifier of the original message with the poll */
|
|
1651
|
-
message_id: number;
|
|
1652
|
-
/** An object for a new message inline keyboard. */
|
|
1653
|
-
reply_markup?: InlineKeyboardMarkup;
|
|
1654
|
-
}): Poll;
|
|
1655
|
-
|
|
1656
|
-
/** Use this method to delete a message, including service messages, with the following limitations:
|
|
1657
|
-
- A message can only be deleted if it was sent less than 48 hours ago.
|
|
1658
|
-
- Service messages about a supergroup, channel, or forum topic creation can't be deleted.
|
|
1659
|
-
- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.
|
|
1660
|
-
- Bots can delete outgoing messages in private chats, groups, and supergroups.
|
|
1661
|
-
- Bots can delete incoming messages in private chats.
|
|
1662
|
-
- Bots granted can_post_messages permissions can delete outgoing messages in channels.
|
|
1663
|
-
- If the bot is an administrator of a group, it can delete any message there.
|
|
1664
|
-
- If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
|
|
1665
|
-
Returns True on success. */
|
|
1666
|
-
deleteMessage(args: {
|
|
1667
|
-
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1668
|
-
chat_id: number | string;
|
|
1669
|
-
/** Identifier of the message to delete */
|
|
1670
|
-
message_id: number;
|
|
1671
|
-
}): true;
|
|
1672
|
-
|
|
1673
|
-
/** Use this method to delete multiple messages simultaneously. Returns True on success. */
|
|
1674
|
-
deleteMessages(args: {
|
|
1675
|
-
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1676
|
-
chat_id: number | string;
|
|
1677
|
-
/** A list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted */
|
|
1678
|
-
message_ids: number[];
|
|
1679
|
-
}): true;
|
|
1885
|
+
/** A list of clickable areas to be shown on the story */
|
|
1886
|
+
areas?: StoryArea;
|
|
1887
|
+
}): Story;
|
|
1680
1888
|
|
|
1681
|
-
/**
|
|
1682
|
-
|
|
1683
|
-
/** Unique identifier of the business connection
|
|
1889
|
+
/** Deletes a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns True on success. */
|
|
1890
|
+
deleteStory(args: {
|
|
1891
|
+
/** Unique identifier of the business connection */
|
|
1684
1892
|
business_connection_id: string;
|
|
1685
|
-
/**
|
|
1686
|
-
|
|
1893
|
+
/** Unique identifier of the story to delete */
|
|
1894
|
+
story_id: number;
|
|
1687
1895
|
}): true;
|
|
1688
1896
|
|
|
1689
1897
|
/** Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned. */
|
|
@@ -1694,6 +1902,8 @@ export type ApiMethods = {
|
|
|
1694
1902
|
chat_id: number | string;
|
|
1695
1903
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
1696
1904
|
message_thread_id?: number;
|
|
1905
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
1906
|
+
direct_messages_topic_id?: number;
|
|
1697
1907
|
/** Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. Video and animated stickers can't be sent via an HTTP URL. */
|
|
1698
1908
|
sticker: Buffer | ReadStream | string;
|
|
1699
1909
|
/** Emoji associated with the sticker; only for just uploaded stickers */
|
|
@@ -1704,6 +1914,8 @@ export type ApiMethods = {
|
|
|
1704
1914
|
protect_content?: boolean;
|
|
1705
1915
|
/** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
|
|
1706
1916
|
allow_paid_broadcast?: boolean;
|
|
1917
|
+
/** An object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */
|
|
1918
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
1707
1919
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
1708
1920
|
message_effect_id?: string;
|
|
1709
1921
|
/** Description of the message to reply to */
|
|
@@ -1714,6 +1926,8 @@ export type ApiMethods = {
|
|
|
1714
1926
|
| ReplyKeyboardMarkup
|
|
1715
1927
|
| ReplyKeyboardRemove
|
|
1716
1928
|
| ForceReply;
|
|
1929
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
1930
|
+
reply_to_message_id?: number;
|
|
1717
1931
|
}): Message.StickerMessage;
|
|
1718
1932
|
|
|
1719
1933
|
/** Use this method to get a sticker set. On success, a StickerSet object is returned. */
|
|
@@ -1848,55 +2062,7 @@ export type ApiMethods = {
|
|
|
1848
2062
|
custom_emoji_id?: string;
|
|
1849
2063
|
}): true;
|
|
1850
2064
|
|
|
1851
|
-
/**
|
|
1852
|
-
postStory(args: {
|
|
1853
|
-
/** Unique identifier of the business connection */
|
|
1854
|
-
business_connection_id: string;
|
|
1855
|
-
/** Content of the story */
|
|
1856
|
-
content: InputStoryContent;
|
|
1857
|
-
/** Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 */
|
|
1858
|
-
active_period: number;
|
|
1859
|
-
/** Caption of the story, 0-2048 characters after entities parsing */
|
|
1860
|
-
caption?: string;
|
|
1861
|
-
/** Mode for parsing entities in the story caption. See formatting options for more details. */
|
|
1862
|
-
parse_mode?: ParseMode;
|
|
1863
|
-
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
1864
|
-
caption_entities?: MessageEntity[];
|
|
1865
|
-
/** A list of clickable areas to be shown on the story */
|
|
1866
|
-
areas?: StoryArea[];
|
|
1867
|
-
/** Pass True to keep the story accessible after it expires */
|
|
1868
|
-
post_to_chat_page?: boolean;
|
|
1869
|
-
/** Pass True if the content of the story must be protected from forwarding and screenshotting */
|
|
1870
|
-
protect_content?: boolean;
|
|
1871
|
-
}): Story;
|
|
1872
|
-
|
|
1873
|
-
/** Edits a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success. */
|
|
1874
|
-
editStory(args: {
|
|
1875
|
-
/** Unique identifier of the business connection */
|
|
1876
|
-
business_connection_id: string;
|
|
1877
|
-
/** Unique identifier of the story to edit */
|
|
1878
|
-
story_id: number;
|
|
1879
|
-
/** Content of the story */
|
|
1880
|
-
content: InputStoryContent;
|
|
1881
|
-
/** Caption of the story, 0-2048 characters after entities parsing */
|
|
1882
|
-
caption?: string;
|
|
1883
|
-
/** Mode for parsing entities in the story caption. See formatting options for more details. */
|
|
1884
|
-
parse_mode?: ParseMode;
|
|
1885
|
-
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
1886
|
-
caption_entities?: MessageEntity[];
|
|
1887
|
-
/** A list of clickable areas to be shown on the story */
|
|
1888
|
-
areas?: StoryArea;
|
|
1889
|
-
}): Story;
|
|
1890
|
-
|
|
1891
|
-
/** Deletes a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns True on success. */
|
|
1892
|
-
deleteStory(args: {
|
|
1893
|
-
/** Unique identifier of the business connection */
|
|
1894
|
-
business_connection_id: string;
|
|
1895
|
-
/** Unique identifier of the story to delete */
|
|
1896
|
-
story_id: number;
|
|
1897
|
-
}): true;
|
|
1898
|
-
|
|
1899
|
-
/** Returns the list of gifts that can be sent by the bot to users and chennel chats. Requires no parameters. Returns a Gifts object. */
|
|
2065
|
+
/** Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a Gifts object. */
|
|
1900
2066
|
getAvailableGifts(): Gifts;
|
|
1901
2067
|
|
|
1902
2068
|
/** Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success. */
|
|
@@ -1909,13 +2075,13 @@ export type ApiMethods = {
|
|
|
1909
2075
|
gift_id: string;
|
|
1910
2076
|
/** Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver */
|
|
1911
2077
|
pay_for_upgrade?: boolean;
|
|
1912
|
-
/** Text that will be shown along with the gift; 0-
|
|
2078
|
+
/** Text that will be shown along with the gift; 0-128 characters */
|
|
1913
2079
|
text?: string;
|
|
1914
2080
|
/** Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored. */
|
|
1915
2081
|
text_parse_mode?: ParseMode;
|
|
1916
2082
|
/** A list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored. */
|
|
1917
2083
|
text_entities?: MessageEntity[];
|
|
1918
|
-
}):
|
|
2084
|
+
}): Gifts;
|
|
1919
2085
|
|
|
1920
2086
|
/** Gifts a Telegram Premium subscription to the given user. Returns True on success. */
|
|
1921
2087
|
giftPremiumSubscription(args: {
|
|
@@ -1933,14 +2099,6 @@ export type ApiMethods = {
|
|
|
1933
2099
|
text_entities?: MessageEntity[];
|
|
1934
2100
|
}): true;
|
|
1935
2101
|
|
|
1936
|
-
/** Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can_transfer_stars business bot right. Returns True on success. */
|
|
1937
|
-
transferBusinessAccountStars(args: {
|
|
1938
|
-
/** Unique identifier of the business connection */
|
|
1939
|
-
business_connection_id: string;
|
|
1940
|
-
/** Number of Telegram Stars to transfer; 1-10000 */
|
|
1941
|
-
star_count: number;
|
|
1942
|
-
}): true;
|
|
1943
|
-
|
|
1944
2102
|
/** Use this method to send answers to an inline query. On success, True is returned.
|
|
1945
2103
|
No more than 50 results per query are allowed.
|
|
1946
2104
|
|
|
@@ -1990,11 +2148,13 @@ export type ApiMethods = {
|
|
|
1990
2148
|
chat_id: number | string;
|
|
1991
2149
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
1992
2150
|
message_thread_id?: number;
|
|
2151
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
2152
|
+
direct_messages_topic_id?: number;
|
|
1993
2153
|
/** Product name, 1-32 characters */
|
|
1994
2154
|
title: string;
|
|
1995
2155
|
/** Product description, 1-255 characters */
|
|
1996
2156
|
description: string;
|
|
1997
|
-
/** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */
|
|
2157
|
+
/** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. */
|
|
1998
2158
|
payload: string;
|
|
1999
2159
|
/** Payment provider token, obtained via BotFather. Pass an empty string for payments in Telegram Stars. */
|
|
2000
2160
|
provider_token?: string;
|
|
@@ -2032,6 +2192,8 @@ export type ApiMethods = {
|
|
|
2032
2192
|
send_email_to_provider?: boolean;
|
|
2033
2193
|
/** Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars. */
|
|
2034
2194
|
is_flexible?: boolean;
|
|
2195
|
+
/** An object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */
|
|
2196
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
2035
2197
|
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
2036
2198
|
disable_notification?: boolean;
|
|
2037
2199
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
@@ -2044,6 +2206,8 @@ export type ApiMethods = {
|
|
|
2044
2206
|
reply_parameters?: ReplyParameters;
|
|
2045
2207
|
/** 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. */
|
|
2046
2208
|
reply_markup?: InlineKeyboardMarkup;
|
|
2209
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
2210
|
+
reply_to_message_id?: number;
|
|
2047
2211
|
}): Message.InvoiceMessage;
|
|
2048
2212
|
|
|
2049
2213
|
/** Use this method to create a link for an invoice. Returns the created invoice link as String on success. */
|
|
@@ -2054,7 +2218,7 @@ export type ApiMethods = {
|
|
|
2054
2218
|
title: string;
|
|
2055
2219
|
/** Product description, 1-255 characters */
|
|
2056
2220
|
description: string;
|
|
2057
|
-
/** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */
|
|
2221
|
+
/** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. */
|
|
2058
2222
|
payload: string;
|
|
2059
2223
|
/** Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. */
|
|
2060
2224
|
provider_token?: string;
|
|
@@ -2094,6 +2258,44 @@ export type ApiMethods = {
|
|
|
2094
2258
|
is_flexible?: boolean;
|
|
2095
2259
|
}): string;
|
|
2096
2260
|
|
|
2261
|
+
/** If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned. */
|
|
2262
|
+
answerShippingQuery(args: {
|
|
2263
|
+
/** Unique identifier for the query to be answered */
|
|
2264
|
+
shipping_query_id: string;
|
|
2265
|
+
/** Pass True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible) */
|
|
2266
|
+
ok: boolean;
|
|
2267
|
+
/** Required if ok is True. An array of available shipping options. */
|
|
2268
|
+
shipping_options?: readonly ShippingOption[];
|
|
2269
|
+
/** Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. “Sorry, delivery to your desired address is unavailable”). Telegram will display this message to the user. */
|
|
2270
|
+
error_message?: string;
|
|
2271
|
+
}): true;
|
|
2272
|
+
|
|
2273
|
+
/** Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent. */
|
|
2274
|
+
answerPreCheckoutQuery(args: {
|
|
2275
|
+
/** Unique identifier for the query to be answered */
|
|
2276
|
+
pre_checkout_query_id: string;
|
|
2277
|
+
/** Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems. */
|
|
2278
|
+
ok: boolean;
|
|
2279
|
+
/** Required if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user. */
|
|
2280
|
+
error_message?: string;
|
|
2281
|
+
}): true;
|
|
2282
|
+
|
|
2283
|
+
/** Returns the bot's Telegram Star transactions in chronological order. On success, returns a StarTransactions object. */
|
|
2284
|
+
getStarTransactions(args: {
|
|
2285
|
+
/** Number of transactions to skip in the response */
|
|
2286
|
+
offset?: number;
|
|
2287
|
+
/** The maximum number of transactions to be retrieved. Values between 1-100 are accepted. Defaults to 100. */
|
|
2288
|
+
limit?: number;
|
|
2289
|
+
}): StarTransactions;
|
|
2290
|
+
|
|
2291
|
+
/** Refunds a successful payment in Telegram Stars. Returns True on success. */
|
|
2292
|
+
refundStarPayment(args: {
|
|
2293
|
+
/** Identifier of the user whose payment will be refunded */
|
|
2294
|
+
user_id: number;
|
|
2295
|
+
/** Telegram payment identifier */
|
|
2296
|
+
telegram_payment_charge_id: string;
|
|
2297
|
+
}): true;
|
|
2298
|
+
|
|
2097
2299
|
/** Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns True on success. */
|
|
2098
2300
|
editUserStarSubscription(args: {
|
|
2099
2301
|
/** Identifier of the user whose subscription will be edited */
|
|
@@ -2114,7 +2316,7 @@ export type ApiMethods = {
|
|
|
2114
2316
|
|
|
2115
2317
|
/** Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success. */
|
|
2116
2318
|
verifyChat(args: {
|
|
2117
|
-
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
2319
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername). Channel direct messages chats can't be verified. */
|
|
2118
2320
|
chat_id: number | string;
|
|
2119
2321
|
/** Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description. */
|
|
2120
2322
|
custom_description?: string;
|
|
@@ -2132,44 +2334,16 @@ export type ApiMethods = {
|
|
|
2132
2334
|
chat_id: number | string;
|
|
2133
2335
|
}): true;
|
|
2134
2336
|
|
|
2135
|
-
/**
|
|
2136
|
-
|
|
2137
|
-
/** Unique identifier
|
|
2138
|
-
|
|
2139
|
-
/**
|
|
2140
|
-
|
|
2141
|
-
/**
|
|
2142
|
-
|
|
2143
|
-
/** Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable"). Telegram will display this message to the user. */
|
|
2144
|
-
error_message?: string;
|
|
2145
|
-
}): true;
|
|
2146
|
-
|
|
2147
|
-
/** Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent. */
|
|
2148
|
-
answerPreCheckoutQuery(args: {
|
|
2149
|
-
/** Unique identifier for the query to be answered */
|
|
2150
|
-
pre_checkout_query_id: string;
|
|
2151
|
-
/** Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems. */
|
|
2152
|
-
ok: boolean;
|
|
2153
|
-
/** Required if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user. */
|
|
2154
|
-
error_message?: string;
|
|
2155
|
-
}): true;
|
|
2156
|
-
|
|
2157
|
-
/** Refunds a successful payment in Telegram Stars. Returns True on success. */
|
|
2158
|
-
refundStarPayment(args: {
|
|
2159
|
-
/** Identifier of the user whose payment will be refunded */
|
|
2160
|
-
user_id: number;
|
|
2161
|
-
/** Telegram payment identifier */
|
|
2162
|
-
telegram_payment_charge_id: string;
|
|
2337
|
+
/** Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success. */
|
|
2338
|
+
readBusinessMessage(args: {
|
|
2339
|
+
/** Unique identifier of the business connection on behalf of which to read the message */
|
|
2340
|
+
business_connection_id: string;
|
|
2341
|
+
/** Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours. */
|
|
2342
|
+
chat_id: number;
|
|
2343
|
+
/** Unique identifier of the message to mark as read */
|
|
2344
|
+
message_id: number;
|
|
2163
2345
|
}): true;
|
|
2164
2346
|
|
|
2165
|
-
/** Returns the bot's Telegram Star transactions in chronological order. On success, returns a StarTransactions object. */
|
|
2166
|
-
getStarTransactions(args: {
|
|
2167
|
-
/** Number of transactions to skip in the response */
|
|
2168
|
-
offset?: number;
|
|
2169
|
-
/** The maximum number of transactions to be retrieved. Values between 1-100 are accepted. Defaults to 100. */
|
|
2170
|
-
limit?: number;
|
|
2171
|
-
}): StarTransactions;
|
|
2172
|
-
|
|
2173
2347
|
/** Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.
|
|
2174
2348
|
|
|
2175
2349
|
Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues. */
|
|
@@ -2184,7 +2358,7 @@ export type ApiMethods = {
|
|
|
2184
2358
|
sendGame(args: {
|
|
2185
2359
|
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
2186
2360
|
business_connection_id?: string;
|
|
2187
|
-
/** Unique identifier for the target chat */
|
|
2361
|
+
/** Unique identifier for the target chat. Games can't be sent to channel direct messages chats and channel chats. */
|
|
2188
2362
|
chat_id: number;
|
|
2189
2363
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
2190
2364
|
message_thread_id?: number;
|
|
@@ -2202,6 +2376,8 @@ export type ApiMethods = {
|
|
|
2202
2376
|
reply_parameters?: ReplyParameters;
|
|
2203
2377
|
/** 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. */
|
|
2204
2378
|
reply_markup?: InlineKeyboardMarkup;
|
|
2379
|
+
/** @deprecated Use `reply_parameters` instead. */
|
|
2380
|
+
reply_to_message_id?: number;
|
|
2205
2381
|
}): Message.GameMessage;
|
|
2206
2382
|
|
|
2207
2383
|
/** 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. */
|