0
# Advanced Features
1
2
Advanced Telegram features including inline queries, payments, games, sticker management, forum topics, and business features for sophisticated bot implementations.
3
4
## Capabilities
5
6
### Inline Queries and Web Apps
7
8
Methods for handling inline queries and web app interactions.
9
10
```javascript { .api }
11
/**
12
* Answer inline query with results
13
* @param {string} inlineQueryId - Inline query identifier
14
* @param {object[]} results - Array of inline query results
15
* @param {object} [options] - Answer options
16
* @returns {Promise<boolean>}
17
*/
18
answerInlineQuery(inlineQueryId, results, options): Promise<boolean>;
19
20
/**
21
* Answer Web App query
22
* @param {string} webAppQueryId - Web App query identifier
23
* @param {object} result - Inline query result
24
* @param {object} [options] - Additional options
25
* @returns {Promise<SentWebAppMessage>}
26
*/
27
answerWebAppQuery(webAppQueryId, result, options): Promise<SentWebAppMessage>;
28
```
29
30
**Usage Example:**
31
32
```javascript
33
// Handle inline queries
34
bot.on('inline_query', async (inlineQuery) => {
35
const query = inlineQuery.query;
36
const results = [];
37
38
// Create article results based on query
39
if (query.toLowerCase().includes('weather')) {
40
results.push({
41
type: 'article',
42
id: '1',
43
title: 'Weather Information',
44
description: 'Get current weather data',
45
input_message_content: {
46
message_text: `Weather query: ${query}`,
47
parse_mode: 'HTML'
48
},
49
reply_markup: {
50
inline_keyboard: [
51
[{ text: '๐ค๏ธ Check Weather', callback_data: 'weather_check' }]
52
]
53
}
54
});
55
}
56
57
// Add photo result
58
results.push({
59
type: 'photo',
60
id: '2',
61
photo_url: 'https://example.com/photo.jpg',
62
thumbnail_url: 'https://example.com/thumb.jpg',
63
caption: `Photo result for: ${query}`
64
});
65
66
// Add GIF result
67
results.push({
68
type: 'gif',
69
id: '3',
70
gif_url: 'https://example.com/animation.gif',
71
thumbnail_url: 'https://example.com/gif-thumb.jpg',
72
title: 'Animated Result'
73
});
74
75
// Answer the inline query
76
await bot.answerInlineQuery(inlineQuery.id, results, {
77
cache_time: 300,
78
is_personal: true,
79
next_offset: results.length < 10 ? '' : '10'
80
});
81
});
82
83
// Handle Web App queries
84
bot.on('web_app_data', async (msg) => {
85
const webAppData = msg.web_app_data;
86
console.log('Web App data:', webAppData.data);
87
88
// Process the data and respond
89
await bot.sendMessage(msg.chat.id, `Received Web App data: ${webAppData.data}`);
90
});
91
92
// Answer Web App query (typically called from web app)
93
await bot.answerWebAppQuery('web_app_query_id', {
94
type: 'article',
95
id: 'webapp_result',
96
title: 'Web App Result',
97
input_message_content: {
98
message_text: 'Result from Web App interaction'
99
}
100
});
101
```
102
103
### Payments
104
105
Comprehensive payment processing including invoices, shipping, and checkout handling.
106
107
```javascript { .api }
108
/**
109
* Send invoice for payment
110
* @param {number|string} chatId - Chat identifier
111
* @param {string} title - Product title
112
* @param {string} description - Product description
113
* @param {string} payload - Bot-defined invoice payload
114
* @param {string} providerToken - Payment provider token
115
* @param {string} currency - Three-letter ISO 4217 currency code
116
* @param {object[]} prices - Price breakdown
117
* @param {object} [options] - Invoice options
118
* @returns {Promise<Message>}
119
*/
120
sendInvoice(chatId, title, description, payload, providerToken, currency, prices, options): Promise<Message>;
121
122
/**
123
* Create invoice link for payments
124
* @param {string} title - Product title
125
* @param {string} description - Product description
126
* @param {string} payload - Bot-defined invoice payload
127
* @param {string} providerToken - Payment provider token
128
* @param {string} currency - Three-letter ISO 4217 currency code
129
* @param {object[]} prices - Price breakdown
130
* @param {object} [options] - Invoice options
131
* @returns {Promise<string>}
132
*/
133
createInvoiceLink(title, description, payload, providerToken, currency, prices, options): Promise<string>;
134
135
/**
136
* Answer shipping query with shipping options
137
* @param {string} shippingQueryId - Shipping query identifier
138
* @param {boolean} ok - Specify if delivery is possible
139
* @param {object} [options] - Shipping options
140
* @returns {Promise<boolean>}
141
*/
142
answerShippingQuery(shippingQueryId, ok, options): Promise<boolean>;
143
144
/**
145
* Answer pre-checkout query
146
* @param {string} preCheckoutQueryId - Pre-checkout query identifier
147
* @param {boolean} ok - Specify if everything is alright
148
* @param {object} [options] - Pre-checkout options
149
* @returns {Promise<boolean>}
150
*/
151
answerPreCheckoutQuery(preCheckoutQueryId, ok, options): Promise<boolean>;
152
```
153
154
**Usage Example:**
155
156
```javascript
157
// Send invoice
158
await bot.sendInvoice(
159
chatId,
160
'Premium Subscription',
161
'Monthly premium subscription with advanced features',
162
'premium_sub_payload_123',
163
process.env.PAYMENT_PROVIDER_TOKEN,
164
'USD',
165
[
166
{ label: 'Premium Subscription', amount: 999 }, // $9.99
167
{ label: 'Tax', amount: 100 } // $1.00
168
],
169
{
170
photo_url: 'https://example.com/premium-badge.jpg',
171
photo_width: 512,
172
photo_height: 512,
173
need_name: true,
174
need_phone_number: false,
175
need_email: true,
176
need_shipping_address: false,
177
send_phone_number_to_provider: false,
178
send_email_to_provider: true,
179
is_flexible: false
180
}
181
);
182
183
// Create invoice link
184
const invoiceLink = await bot.createInvoiceLink(
185
'Digital Product',
186
'Downloadable content package',
187
'digital_product_payload',
188
process.env.PAYMENT_PROVIDER_TOKEN,
189
'USD',
190
[{ label: 'Digital Product', amount: 1999 }] // $19.99
191
);
192
193
console.log('Invoice link:', invoiceLink);
194
195
// Handle shipping queries
196
bot.on('shipping_query', async (shippingQuery) => {
197
const shippingAddress = shippingQuery.shipping_address;
198
199
// Check if shipping is available to this address
200
if (shippingAddress.country_code === 'US') {
201
await bot.answerShippingQuery(shippingQuery.id, true, {
202
shipping_options: [
203
{
204
id: 'standard',
205
title: 'Standard Shipping',
206
prices: [{ label: 'Standard', amount: 500 }] // $5.00
207
},
208
{
209
id: 'express',
210
title: 'Express Shipping',
211
prices: [{ label: 'Express', amount: 1500 }] // $15.00
212
}
213
]
214
});
215
} else {
216
await bot.answerShippingQuery(shippingQuery.id, false, {
217
error_message: 'Sorry, we do not ship to your country.'
218
});
219
}
220
});
221
222
// Handle pre-checkout queries
223
bot.on('pre_checkout_query', async (preCheckoutQuery) => {
224
// Verify the payload and order details
225
const payload = preCheckoutQuery.invoice_payload;
226
const totalAmount = preCheckoutQuery.total_amount;
227
228
console.log(`Pre-checkout: ${payload}, amount: ${totalAmount}`);
229
230
// Approve the payment
231
await bot.answerPreCheckoutQuery(preCheckoutQuery.id, true);
232
233
// Or reject with error
234
// await bot.answerPreCheckoutQuery(preCheckoutQuery.id, false, {
235
// error_message: 'Payment verification failed.'
236
// });
237
});
238
239
// Handle successful payments
240
bot.on('successful_payment', (msg) => {
241
const payment = msg.successful_payment;
242
243
console.log('Payment successful!');
244
console.log('Currency:', payment.currency);
245
console.log('Total amount:', payment.total_amount);
246
console.log('Payload:', payment.invoice_payload);
247
console.log('Provider payment charge ID:', payment.provider_payment_charge_id);
248
console.log('Telegram payment charge ID:', payment.telegram_payment_charge_id);
249
250
// Send confirmation message
251
bot.sendMessage(msg.chat.id, 'โ Payment successful! Thank you for your purchase.');
252
});
253
```
254
255
### Games
256
257
Methods for implementing Telegram games with score management.
258
259
```javascript { .api }
260
/**
261
* Send game
262
* @param {number|string} chatId - Chat identifier
263
* @param {string} gameShortName - Short name of the game
264
* @param {object} [options] - Game options
265
* @returns {Promise<Message>}
266
*/
267
sendGame(chatId, gameShortName, options): Promise<Message>;
268
269
/**
270
* Set game score for user
271
* @param {number} userId - User identifier
272
* @param {number} score - New score value
273
* @param {object} options - Score options with chat_id and message_id
274
* @returns {Promise<Message|boolean>}
275
*/
276
setGameScore(userId, score, options): Promise<Message|boolean>;
277
278
/**
279
* Get game high scores
280
* @param {number} userId - User identifier
281
* @param {object} options - High score options with chat_id and message_id
282
* @returns {Promise<GameHighScore[]>}
283
*/
284
getGameHighScores(userId, options): Promise<GameHighScore[]>;
285
```
286
287
**Usage Example:**
288
289
```javascript
290
// Send game
291
const gameMessage = await bot.sendGame(chatId, 'my_awesome_game', {
292
disable_notification: true,
293
reply_markup: {
294
inline_keyboard: [
295
[{ text: '๐ฎ Play Game', callback_game: {} }]
296
]
297
}
298
});
299
300
// Handle game callback
301
bot.on('callback_query', async (callbackQuery) => {
302
if (callbackQuery.game_short_name) {
303
// User wants to play the game
304
const gameUrl = `https://mybot.example.com/game?user=${callbackQuery.from.id}`;
305
306
await bot.answerCallbackQuery(callbackQuery.id, {
307
url: gameUrl
308
});
309
}
310
});
311
312
// Set game score (called from game server)
313
await bot.setGameScore(userId, 1500, {
314
chat_id: chatId,
315
message_id: gameMessageId,
316
force: false, // Don't decrease score
317
disable_edit_message: false
318
});
319
320
// Get high scores
321
const highScores = await bot.getGameHighScores(userId, {
322
chat_id: chatId,
323
message_id: gameMessageId
324
});
325
326
console.log('High scores:');
327
highScores.forEach((score, index) => {
328
console.log(`${index + 1}. ${score.user.first_name}: ${score.score}`);
329
});
330
331
// Handle game score updates in groups
332
bot.on('chosen_inline_result', (chosenResult) => {
333
if (chosenResult.query === 'game_score') {
334
console.log('User chose game score result:', chosenResult.result_id);
335
}
336
});
337
```
338
339
### Sticker Management
340
341
Advanced sticker set creation and management functionality.
342
343
```javascript { .api }
344
/**
345
* Upload sticker file
346
* @param {number} userId - User identifier
347
* @param {string|Buffer|stream.Readable} sticker - Sticker file
348
* @param {string} stickerFormat - Sticker format (static, animated, video)
349
* @param {object} [options] - Upload options
350
* @param {object} [fileOptions] - File options
351
* @returns {Promise<File>}
352
*/
353
uploadStickerFile(userId, sticker, stickerFormat, options, fileOptions): Promise<File>;
354
355
/**
356
* Create new sticker set
357
* @param {number} userId - User identifier
358
* @param {string} name - Sticker set name
359
* @param {string} title - Sticker set title
360
* @param {object[]} stickers - Initial stickers
361
* @param {string} stickerFormat - Sticker format
362
* @param {object} [options] - Creation options
363
* @returns {Promise<boolean>}
364
*/
365
createNewStickerSet(userId, name, title, stickers, stickerFormat, options): Promise<boolean>;
366
367
/**
368
* Add sticker to existing set
369
* @param {number} userId - User identifier
370
* @param {string} name - Sticker set name
371
* @param {object} sticker - Sticker to add
372
* @param {object} [options] - Add options
373
* @returns {Promise<boolean>}
374
*/
375
addStickerToSet(userId, name, sticker, options): Promise<boolean>;
376
377
/**
378
* Set sticker position in set
379
* @param {string} sticker - File identifier of sticker
380
* @param {number} position - New position (0-based)
381
* @param {object} [options] - Additional options
382
* @returns {Promise<boolean>}
383
*/
384
setStickerPositionInSet(sticker, position, options): Promise<boolean>;
385
386
/**
387
* Delete sticker from set
388
* @param {string} sticker - File identifier of sticker
389
* @param {object} [options] - Additional options
390
* @returns {Promise<boolean>}
391
*/
392
deleteStickerFromSet(sticker, options): Promise<boolean>;
393
394
/**
395
* Set sticker set thumbnail
396
* @param {number} userId - User identifier
397
* @param {string} name - Sticker set name
398
* @param {string|Buffer|stream.Readable} thumbnail - Thumbnail file
399
* @param {object} [options] - Thumbnail options
400
* @param {object} [fileOptions] - File options
401
* @returns {Promise<boolean>}
402
*/
403
setStickerSetThumbnail(userId, name, thumbnail, options, fileOptions): Promise<boolean>;
404
405
/**
406
* Replace sticker in set
407
* @param {number} userId - User identifier
408
* @param {string} name - Sticker set name
409
* @param {string} oldSticker - File identifier of sticker to replace
410
* @param {object} sticker - New sticker data
411
* @param {object} [options] - Additional options
412
* @returns {Promise<boolean>}
413
*/
414
replaceStickerInSet(userId, name, oldSticker, sticker, options): Promise<boolean>;
415
416
/**
417
* Set sticker emoji list
418
* @param {string} sticker - File identifier of sticker
419
* @param {string[]} emojiList - List of emoji associated with sticker
420
* @param {object} [options] - Additional options
421
* @returns {Promise<boolean>}
422
*/
423
setStickerEmojiList(sticker, emojiList, options): Promise<boolean>;
424
425
/**
426
* Set sticker keywords for search
427
* @param {string} sticker - File identifier of sticker
428
* @param {string[]} keywords - List of keywords (0-20 items, 1-64 chars each)
429
* @param {object} [options] - Additional options
430
* @returns {Promise<boolean>}
431
*/
432
setStickerKeywords(sticker, keywords, options): Promise<boolean>;
433
434
/**
435
* Set sticker mask position
436
* @param {string} sticker - File identifier of sticker
437
* @param {object} maskPosition - Mask position object
438
* @param {object} [options] - Additional options
439
* @returns {Promise<boolean>}
440
*/
441
setStickerMaskPosition(sticker, maskPosition, options): Promise<boolean>;
442
443
/**
444
* Set sticker set title
445
* @param {string} name - Sticker set name
446
* @param {string} title - New sticker set title (1-64 chars)
447
* @param {object} [options] - Additional options
448
* @returns {Promise<boolean>}
449
*/
450
setStickerSetTitle(name, title, options): Promise<boolean>;
451
452
/**
453
* Set custom emoji sticker set thumbnail
454
* @param {string} name - Sticker set name
455
* @param {string} customEmojiId - Custom emoji identifier for thumbnail
456
* @param {object} [options] - Additional options
457
* @returns {Promise<boolean>}
458
*/
459
setCustomEmojiStickerSetThumbnail(name, customEmojiId, options): Promise<boolean>;
460
461
/**
462
* Delete sticker set
463
* @param {string} name - Sticker set name
464
* @param {object} [options] - Additional options
465
* @returns {Promise<boolean>}
466
*/
467
deleteStickerSet(name, options): Promise<boolean>;
468
```
469
470
**Usage Example:**
471
472
```javascript
473
// Create new sticker set
474
const userId = 12345;
475
const stickerSetName = `my_stickers_by_${bot.options.username}`;
476
477
await bot.createNewStickerSet(
478
userId,
479
stickerSetName,
480
'My Custom Stickers',
481
[
482
{
483
sticker: './sticker1.webp',
484
emoji_list: ['๐', '๐']
485
},
486
{
487
sticker: './sticker2.webp',
488
emoji_list: ['๐', '๐คฃ']
489
}
490
],
491
'static',
492
{
493
sticker_type: 'regular'
494
}
495
);
496
497
// Add sticker to existing set
498
await bot.addStickerToSet(userId, stickerSetName, {
499
sticker: './new_sticker.webp',
500
emoji_list: ['๐', '๐']
501
});
502
503
// Reorder stickers
504
await bot.setStickerPositionInSet('CAADAgADAAECAwQFBg', 0); // Move to first position
505
506
// Delete sticker
507
await bot.deleteStickerFromSet('CAADAgADAAECAwQFBg');
508
509
// Set thumbnail for sticker set
510
await bot.setStickerSetThumbnail(userId, stickerSetName, './thumbnail.webp');
511
512
// Upload sticker file first, then use in set
513
const uploadedFile = await bot.uploadStickerFile(userId, './animated_sticker.tgs', 'animated');
514
console.log('Uploaded file ID:', uploadedFile.file_id);
515
```
516
517
### Forum Topics
518
519
Methods for managing forum topics in supergroups.
520
521
```javascript { .api }
522
/**
523
* Get forum topic icon stickers
524
* @param {number|string} chatId - Chat identifier
525
* @param {object} [options] - Additional options
526
* @returns {Promise<Sticker[]>}
527
*/
528
getForumTopicIconStickers(chatId, options): Promise<Sticker[]>;
529
530
/**
531
* Create forum topic
532
* @param {number|string} chatId - Chat identifier
533
* @param {string} name - Topic name
534
* @param {object} [options] - Topic options
535
* @returns {Promise<ForumTopic>}
536
*/
537
createForumTopic(chatId, name, options): Promise<ForumTopic>;
538
539
/**
540
* Edit forum topic
541
* @param {number|string} chatId - Chat identifier
542
* @param {number} messageThreadId - Topic thread identifier
543
* @param {object} [options] - Edit options
544
* @returns {Promise<boolean>}
545
*/
546
editForumTopic(chatId, messageThreadId, options): Promise<boolean>;
547
548
/**
549
* Close forum topic
550
* @param {number|string} chatId - Chat identifier
551
* @param {number} messageThreadId - Topic thread identifier
552
* @param {object} [options] - Additional options
553
* @returns {Promise<boolean>}
554
*/
555
closeForumTopic(chatId, messageThreadId, options): Promise<boolean>;
556
557
/**
558
* Reopen forum topic
559
* @param {number|string} chatId - Chat identifier
560
* @param {number} messageThreadId - Topic thread identifier
561
* @param {object} [options] - Additional options
562
* @returns {Promise<boolean>}
563
*/
564
reopenForumTopic(chatId, messageThreadId, options): Promise<boolean>;
565
566
/**
567
* Delete forum topic
568
* @param {number|string} chatId - Chat identifier
569
* @param {number} messageThreadId - Topic thread identifier
570
* @param {object} [options] - Additional options
571
* @returns {Promise<boolean>}
572
*/
573
deleteForumTopic(chatId, messageThreadId, options): Promise<boolean>;
574
575
/**
576
* Unpin all forum topic messages
577
* @param {number|string} chatId - Chat identifier
578
* @param {number} messageThreadId - Topic thread identifier
579
* @param {object} [options] - Additional options
580
* @returns {Promise<boolean>}
581
*/
582
unpinAllForumTopicMessages(chatId, messageThreadId, options): Promise<boolean>;
583
584
/**
585
* Edit general forum topic name
586
* @param {number|string} chatId - Chat identifier
587
* @param {string} name - New general topic name
588
* @param {object} [options] - Additional options
589
* @returns {Promise<boolean>}
590
*/
591
editGeneralForumTopic(chatId, name, options): Promise<boolean>;
592
593
/**
594
* Close general forum topic
595
* @param {number|string} chatId - Chat identifier
596
* @param {object} [options] - Additional options
597
* @returns {Promise<boolean>}
598
*/
599
closeGeneralForumTopic(chatId, options): Promise<boolean>;
600
601
/**
602
* Reopen general forum topic
603
* @param {number|string} chatId - Chat identifier
604
* @param {object} [options] - Additional options
605
* @returns {Promise<boolean>}
606
*/
607
reopenGeneralForumTopic(chatId, options): Promise<boolean>;
608
609
/**
610
* Hide general forum topic
611
* @param {number|string} chatId - Chat identifier
612
* @param {object} [options] - Additional options
613
* @returns {Promise<boolean>}
614
*/
615
hideGeneralForumTopic(chatId, options): Promise<boolean>;
616
617
/**
618
* Unhide general forum topic
619
* @param {number|string} chatId - Chat identifier
620
* @param {object} [options] - Additional options
621
* @returns {Promise<boolean>}
622
*/
623
unhideGeneralForumTopic(chatId, options): Promise<boolean>;
624
625
/**
626
* Unpin all general forum topic messages
627
* @param {number|string} chatId - Chat identifier
628
* @param {object} [options] - Additional options
629
* @returns {Promise<boolean>}
630
*/
631
unpinAllGeneralForumTopicMessages(chatId, options): Promise<boolean>;
632
```
633
634
**Usage Example:**
635
636
```javascript
637
// Get available forum icons
638
const iconStickers = await bot.getForumTopicIconStickers(forumChatId);
639
console.log(`Available ${iconStickers.length} forum icons`);
640
641
// Create new forum topic
642
const newTopic = await bot.createForumTopic(forumChatId, 'General Discussion', {
643
icon_color: 0x6FB9F0, // Blue color
644
icon_custom_emoji_id: iconStickers[0].custom_emoji_id
645
});
646
647
console.log('Created topic:', newTopic.name);
648
console.log('Thread ID:', newTopic.message_thread_id);
649
650
// Edit forum topic
651
await bot.editForumTopic(forumChatId, newTopic.message_thread_id, {
652
name: 'Updated Discussion Topic',
653
icon_custom_emoji_id: iconStickers[1].custom_emoji_id
654
});
655
656
// Send message to forum topic
657
await bot.sendMessage(forumChatId, 'Hello in the forum topic!', {
658
message_thread_id: newTopic.message_thread_id
659
});
660
661
// Close topic
662
await bot.closeForumTopic(forumChatId, newTopic.message_thread_id);
663
664
// Reopen topic
665
await bot.reopenForumTopic(forumChatId, newTopic.message_thread_id);
666
667
// Handle forum topic events
668
bot.on('forum_topic_created', (msg) => {
669
const topic = msg.forum_topic_created;
670
console.log(`New forum topic created: ${topic.name}`);
671
});
672
673
bot.on('forum_topic_closed', (msg) => {
674
console.log('Forum topic was closed');
675
});
676
```
677
678
### Business Features
679
680
Methods for handling business-related functionality.
681
682
```javascript { .api }
683
/**
684
* Get user's chat boosts
685
* @param {number|string} chatId - Chat identifier
686
* @param {number} userId - User identifier
687
* @param {object} [options] - Additional options
688
* @returns {Promise<UserChatBoosts>}
689
*/
690
getUserChatBoosts(chatId, userId, options): Promise<UserChatBoosts>;
691
692
/**
693
* Get business connection information
694
* @param {string} businessConnectionId - Business connection identifier
695
* @param {object} [options] - Additional options
696
* @returns {Promise<BusinessConnection>}
697
*/
698
getBusinessConnection(businessConnectionId, options): Promise<BusinessConnection>;
699
```
700
701
**Usage Example:**
702
703
```javascript
704
// Get user's boosts for a chat
705
const userBoosts = await bot.getUserChatBoosts(chatId, userId);
706
console.log(`User has ${userBoosts.boosts.length} active boosts`);
707
708
userBoosts.boosts.forEach(boost => {
709
console.log(`Boost expires: ${new Date(boost.expiration_date * 1000)}`);
710
console.log(`Boost source: ${boost.source.source}`);
711
});
712
713
// Handle business connection updates
714
bot.on('business_connection', (businessConnection) => {
715
console.log('Business connection updated:', businessConnection.id);
716
console.log('User:', businessConnection.user.first_name);
717
console.log('Can reply:', businessConnection.can_reply);
718
console.log('Is enabled:', businessConnection.is_enabled);
719
});
720
721
// Handle business messages
722
bot.on('business_message', (msg) => {
723
console.log('Business message received:', msg.text);
724
console.log('Business connection:', msg.business_connection_id);
725
726
// Reply to business message
727
bot.sendMessage(msg.chat.id, 'Thank you for your business message!', {
728
business_connection_id: msg.business_connection_id
729
});
730
});
731
```
732
733
## Types
734
735
```javascript { .api }
736
interface InlineQueryResult {
737
type: string;
738
id: string;
739
}
740
741
interface InlineQueryResultArticle extends InlineQueryResult {
742
type: 'article';
743
title: string;
744
input_message_content: InputMessageContent;
745
reply_markup?: InlineKeyboardMarkup;
746
url?: string;
747
hide_url?: boolean;
748
description?: string;
749
thumbnail_url?: string;
750
thumbnail_width?: number;
751
thumbnail_height?: number;
752
}
753
754
interface InlineQueryResultPhoto extends InlineQueryResult {
755
type: 'photo';
756
photo_url: string;
757
thumbnail_url: string;
758
photo_width?: number;
759
photo_height?: number;
760
title?: string;
761
description?: string;
762
caption?: string;
763
parse_mode?: string;
764
caption_entities?: MessageEntity[];
765
reply_markup?: InlineKeyboardMarkup;
766
input_message_content?: InputMessageContent;
767
}
768
769
interface LabeledPrice {
770
label: string;
771
amount: number;
772
}
773
774
interface ShippingOption {
775
id: string;
776
title: string;
777
prices: LabeledPrice[];
778
}
779
780
interface SuccessfulPayment {
781
currency: string;
782
total_amount: number;
783
invoice_payload: string;
784
shipping_option_id?: string;
785
order_info?: OrderInfo;
786
telegram_payment_charge_id: string;
787
provider_payment_charge_id: string;
788
}
789
790
interface GameHighScore {
791
position: number;
792
user: User;
793
score: number;
794
}
795
796
interface ForumTopic {
797
message_thread_id: number;
798
name: string;
799
icon_color: number;
800
icon_custom_emoji_id?: string;
801
}
802
803
interface UserChatBoosts {
804
boosts: ChatBoost[];
805
}
806
807
interface ChatBoost {
808
boost_id: string;
809
add_date: number;
810
expiration_date: number;
811
source: ChatBoostSource;
812
}
813
814
interface BusinessConnection {
815
id: string;
816
user: User;
817
user_chat_id: number;
818
date: number;
819
can_reply: boolean;
820
is_enabled: boolean;
821
}
822
823
interface SentWebAppMessage {
824
inline_message_id?: string;
825
}
826
827
interface InputMessageContent {
828
message_text: string;
829
parse_mode?: string;
830
entities?: MessageEntity[];
831
link_preview_options?: LinkPreviewOptions;
832
}
833
834
interface InputSticker {
835
sticker: string;
836
emoji_list: string[];
837
mask_position?: MaskPosition;
838
keywords?: string[];
839
}
840
```