@telegram.ts/types 1.15.1 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telegram.ts/types",
3
- "version": "1.15.1",
3
+ "version": "1.17.0",
4
4
  "description": "Comprehensive Type Declarations for Telegram Bot API with telegramsjs",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -11,7 +11,7 @@
11
11
  "api",
12
12
  "types"
13
13
  ],
14
- "homepage": "https://telegramsjs.vercel.app/",
14
+ "homepage": "https://docs-telegramsjs.vercel.app/",
15
15
  "license": "MIT",
16
16
  "bugs": {
17
17
  "url": "https://github.com/telegramsjs/types/issues"
@@ -1,9 +1,10 @@
1
1
  import type { ReadStream } from "node:fs";
2
2
  import type { Buffer } from "node:buffer";
3
+ import type { LanguageCode } from "./languageTypes";
3
4
  import type {
4
5
  InlineQueryResult,
5
6
  InlineQueryResultsButton,
6
- } from "./inlineTypes.ts";
7
+ } from "./inlineTypes";
7
8
  import type {
8
9
  BotCommand,
9
10
  BusinessConnection,
@@ -19,13 +20,13 @@ import type {
19
20
  UserFromGetMe,
20
21
  UserProfilePhotos,
21
22
  WebhookInfo,
22
- } from "./manageTypes.ts";
23
+ } from "./manageTypes";
23
24
  import type {
24
25
  ForceReply,
25
26
  InlineKeyboardMarkup,
26
27
  ReplyKeyboardMarkup,
27
28
  ReplyKeyboardRemove,
28
- } from "./markupTypes.ts";
29
+ } from "./markupTypes";
29
30
  import type {
30
31
  File,
31
32
  GameHighScore,
@@ -42,21 +43,21 @@ import type {
42
43
  SentWebAppMessage,
43
44
  Sticker,
44
45
  StickerSet,
45
- } from "./messageTypes.ts";
46
- import type { PassportElementError } from "./passportTypes.ts";
46
+ } from "./messageTypes";
47
+ import type { PassportElementError } from "./passportTypes";
47
48
  import type {
48
49
  LabeledPrice,
49
50
  ShippingOption,
50
51
  StarTransactions,
51
- } from "./invoiceTypes.ts";
52
+ } from "./invoiceTypes";
52
53
  import type {
53
54
  BotCommandScope,
54
55
  BotDescription,
55
56
  BotName,
56
57
  BotShortDescription,
57
58
  MenuButton,
58
- } from "./botCommandTypes.ts";
59
- import type { Update } from "./updateTypes.ts";
59
+ } from "./botCommandTypes";
60
+ import type { Update } from "./updateTypes";
60
61
 
61
62
  /** Wrapper type to bundle all methods of the Telegram Bot API */
62
63
  export type ApiMethods = {
@@ -145,6 +146,8 @@ export type ApiMethods = {
145
146
  disable_notification?: boolean;
146
147
  /** Protects the contents of the sent message from forwarding and saving */
147
148
  protect_content?: boolean;
149
+ /** 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 */
150
+ allow_paid_broadcast?: boolean;
148
151
  /** Unique identifier of the message effect to be added to the message; for private chats only */
149
152
  message_effect_id?: string;
150
153
  /** Description of the message to reply to */
@@ -209,6 +212,8 @@ export type ApiMethods = {
209
212
  show_caption_above_media?: boolean;
210
213
  /** Sends the message silently. Users will receive a notification with no sound. */
211
214
  disable_notification?: boolean;
215
+ /** 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 */
216
+ allow_paid_broadcast?: boolean;
212
217
  /** Protects the contents of the sent message from forwarding and saving */
213
218
  protect_content?: boolean;
214
219
  /** Description of the message to reply to */
@@ -263,6 +268,8 @@ export type ApiMethods = {
263
268
  disable_notification?: boolean;
264
269
  /** Protects the contents of the sent message from forwarding and saving */
265
270
  protect_content?: boolean;
271
+ /** 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 */
272
+ allow_paid_broadcast?: boolean;
266
273
  /** Unique identifier of the message effect to be added to the message; for private chats only */
267
274
  message_effect_id?: string;
268
275
  /** Description of the message to reply to */
@@ -305,6 +312,8 @@ export type ApiMethods = {
305
312
  disable_notification?: boolean;
306
313
  /** Protects the contents of the sent message from forwarding and saving */
307
314
  protect_content?: boolean;
315
+ /** 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 */
316
+ allow_paid_broadcast?: boolean;
308
317
  /** Unique identifier of the message effect to be added to the message; for private chats only */
309
318
  message_effect_id?: string;
310
319
  /** Description of the message to reply to */
@@ -341,6 +350,8 @@ export type ApiMethods = {
341
350
  disable_notification?: boolean;
342
351
  /** Protects the contents of the sent message from forwarding and saving */
343
352
  protect_content?: boolean;
353
+ /** 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 */
354
+ allow_paid_broadcast?: boolean;
344
355
  /** Unique identifier of the message effect to be added to the message; for private chats only */
345
356
  message_effect_id?: string;
346
357
  /** Description of the message to reply to */
@@ -387,6 +398,8 @@ export type ApiMethods = {
387
398
  disable_notification?: boolean;
388
399
  /** Protects the contents of the sent message from forwarding and saving */
389
400
  protect_content?: boolean;
401
+ /** 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 */
402
+ allow_paid_broadcast?: boolean;
390
403
  /** Unique identifier of the message effect to be added to the message; for private chats only */
391
404
  message_effect_id?: string;
392
405
  /** Description of the message to reply to */
@@ -431,6 +444,8 @@ export type ApiMethods = {
431
444
  disable_notification?: boolean;
432
445
  /** Protects the contents of the sent message from forwarding and saving */
433
446
  protect_content?: boolean;
447
+ /** 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 */
448
+ allow_paid_broadcast?: boolean;
434
449
  /** Unique identifier of the message effect to be added to the message; for private chats only */
435
450
  message_effect_id?: string;
436
451
  /** Description of the message to reply to */
@@ -465,6 +480,8 @@ export type ApiMethods = {
465
480
  disable_notification?: boolean;
466
481
  /** Protects the contents of the sent message from forwarding and saving */
467
482
  protect_content?: boolean;
483
+ /** 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 */
484
+ allow_paid_broadcast?: boolean;
468
485
  /** Unique identifier of the message effect to be added to the message; for private chats only */
469
486
  message_effect_id?: string;
470
487
  /** Description of the message to reply to */
@@ -498,6 +515,8 @@ export type ApiMethods = {
498
515
  disable_notification?: boolean;
499
516
  /** Protects the contents of the sent message from forwarding and saving */
500
517
  protect_content?: boolean;
518
+ /** 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 */
519
+ allow_paid_broadcast?: boolean;
501
520
  /** Unique identifier of the message effect to be added to the message; for private chats only */
502
521
  message_effect_id?: string;
503
522
  /** Description of the message to reply to */
@@ -516,9 +535,9 @@ export type ApiMethods = {
516
535
  business_connection_id?: string;
517
536
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
518
537
  chat_id: number | string;
519
- /** An array describing messages to be sent, must include 2-10 items */
520
538
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
521
539
  message_thread_id?: number;
540
+ /** An array describing messages to be sent, must include 2-10 items */
522
541
  media: ReadonlyArray<
523
542
  InputMediaAudio | InputMediaDocument | InputMediaPhoto | InputMediaVideo
524
543
  >;
@@ -526,6 +545,8 @@ export type ApiMethods = {
526
545
  disable_notification?: boolean;
527
546
  /** Protects the contents of the sent messages from forwarding and saving */
528
547
  protect_content?: boolean;
548
+ /** 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 */
549
+ allow_paid_broadcast?: boolean;
529
550
  /** Unique identifier of the message effect to be added to the message; for private chats only */
530
551
  message_effect_id?: string;
531
552
  /** Description of the message to reply to */
@@ -561,6 +582,8 @@ export type ApiMethods = {
561
582
  disable_notification?: boolean;
562
583
  /** Protects the contents of the sent message from forwarding and saving */
563
584
  protect_content?: boolean;
585
+ /** 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 */
586
+ allow_paid_broadcast?: boolean;
564
587
  /** Unique identifier of the message effect to be added to the message; for private chats only */
565
588
  message_effect_id?: string;
566
589
  /** Description of the message to reply to */
@@ -635,6 +658,8 @@ export type ApiMethods = {
635
658
  show_caption_above_media?: boolean;
636
659
  /** Sends the message silently. Users will receive a notification with no sound. */
637
660
  disable_notification?: boolean;
661
+ /** 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 */
662
+ allow_paid_broadcast?: boolean;
638
663
  /** Protects the contents of the sent message from forwarding and saving */
639
664
  protect_content?: boolean;
640
665
  /** Description of the message to reply to */
@@ -675,6 +700,8 @@ export type ApiMethods = {
675
700
  disable_notification?: boolean;
676
701
  /** Protects the contents of the sent message from forwarding and saving */
677
702
  protect_content?: boolean;
703
+ /** 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 */
704
+ allow_paid_broadcast?: boolean;
678
705
  /** Unique identifier of the message effect to be added to the message; for private chats only */
679
706
  message_effect_id?: string;
680
707
  /** Description of the message to reply to */
@@ -707,6 +734,8 @@ export type ApiMethods = {
707
734
  disable_notification?: boolean;
708
735
  /** Protects the contents of the sent message from forwarding and saving */
709
736
  protect_content?: boolean;
737
+ /** 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 */
738
+ allow_paid_broadcast?: boolean;
710
739
  /** Unique identifier of the message effect to be added to the message; for private chats only */
711
740
  message_effect_id?: string;
712
741
  /** Description of the message to reply to */
@@ -759,6 +788,8 @@ export type ApiMethods = {
759
788
  disable_notification?: boolean;
760
789
  /** Protects the contents of the sent message from forwarding and saving */
761
790
  protect_content?: boolean;
791
+ /** 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 */
792
+ allow_paid_broadcast?: boolean;
762
793
  /** Unique identifier of the message effect to be added to the message; for private chats only */
763
794
  message_effect_id?: string;
764
795
  /** Description of the message to reply to */
@@ -785,6 +816,8 @@ export type ApiMethods = {
785
816
  disable_notification?: boolean;
786
817
  /** Protects the contents of the sent message from forwarding */
787
818
  protect_content?: boolean;
819
+ /** 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 */
820
+ allow_paid_broadcast?: boolean;
788
821
  /** Unique identifier of the message effect to be added to the message; for private chats only */
789
822
  message_effect_id?: string;
790
823
  /** Description of the message to reply to */
@@ -1296,7 +1329,7 @@ export type ApiMethods = {
1296
1329
  /** An object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault. */
1297
1330
  scope?: BotCommandScope;
1298
1331
  /** A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands */
1299
- language_code?: string;
1332
+ language_code?: LanguageCode;
1300
1333
  }): true;
1301
1334
 
1302
1335
  /** Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, higher level commands will be shown to affected users. Returns True on success. */
@@ -1304,7 +1337,7 @@ export type ApiMethods = {
1304
1337
  /** An object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault. */
1305
1338
  scope?: BotCommandScope;
1306
1339
  /** A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands */
1307
- language_code?: string;
1340
+ language_code?: LanguageCode;
1308
1341
  }): true;
1309
1342
 
1310
1343
  /** Use this method to get the current list of the bot's commands for the given scope and user language. Returns an Array of BotCommand objects. If commands aren't set, an empty list is returned. */
@@ -1312,7 +1345,7 @@ export type ApiMethods = {
1312
1345
  /** An object, describing scope of users. Defaults to BotCommandScopeDefault. */
1313
1346
  scope?: BotCommandScope;
1314
1347
  /** A two-letter ISO 639-1 language code or an empty string */
1315
- language_code?: string;
1348
+ language_code?: LanguageCode;
1316
1349
  }): BotCommand[];
1317
1350
 
1318
1351
  /** Use this method to change the bot's name. Returns True on success. */
@@ -1320,13 +1353,13 @@ export type ApiMethods = {
1320
1353
  /** New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language. */
1321
1354
  name?: string;
1322
1355
  /** A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose language there is no dedicated name. */
1323
- language_code?: string;
1356
+ language_code?: LanguageCode;
1324
1357
  }): true;
1325
1358
 
1326
1359
  /** Use this method to get the current bot name for the given user language. Returns BotName on success. */
1327
1360
  getMyName(args: {
1328
1361
  /** A two-letter ISO 639-1 language code or an empty string */
1329
- language_code?: string;
1362
+ language_code?: LanguageCode;
1330
1363
  }): BotName;
1331
1364
 
1332
1365
  /** Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns True on success. */
@@ -1334,13 +1367,13 @@ export type ApiMethods = {
1334
1367
  /** New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language. */
1335
1368
  description?: string;
1336
1369
  /** A two-letter ISO 639-1 language code. If empty, the description will be applied to all users for whose language there is no dedicated description. */
1337
- language_code?: string;
1370
+ language_code?: LanguageCode;
1338
1371
  }): true;
1339
1372
 
1340
1373
  /** Use this method to get the current bot description for the given user language. Returns BotDescription on success. */
1341
1374
  getMyDescription(args: {
1342
1375
  /** A two-letter ISO 639-1 language code or an empty string */
1343
- language_code?: string;
1376
+ language_code?: LanguageCode;
1344
1377
  }): BotDescription;
1345
1378
 
1346
1379
  /** Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot. Returns True on success. */
@@ -1348,13 +1381,13 @@ export type ApiMethods = {
1348
1381
  /** New short description for the bot; 0-120 characters. Pass an empty string to remove the dedicated short description for the given language. */
1349
1382
  short_description?: string;
1350
1383
  /** A two-letter ISO 639-1 language code. If empty, the short description will be applied to all users for whose language there is no dedicated short description. */
1351
- language_code?: string;
1384
+ language_code?: LanguageCode;
1352
1385
  }): true;
1353
1386
 
1354
1387
  /** Use this method to get the current bot short description for the given user language. Returns BotShortDescription on success. */
1355
1388
  getMyShortDescription(args: {
1356
1389
  /** A two-letter ISO 639-1 language code or an empty string */
1357
- language_code?: string;
1390
+ language_code?: LanguageCode;
1358
1391
  }): BotShortDescription;
1359
1392
 
1360
1393
  /** Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success. */
@@ -1429,7 +1462,7 @@ export type ApiMethods = {
1429
1462
  reply_markup?: InlineKeyboardMarkup;
1430
1463
  }): (Update.Edited & Message.CaptionableMessage) | true;
1431
1464
 
1432
- /** Use this method to edit animation, audio, document, photo, or video 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. */
1465
+ /** 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. */
1433
1466
  editMessageMedia(args: {
1434
1467
  /** Unique identifier of the business connection on behalf of which the message to be edited was sent */
1435
1468
  business_connection_id?: string;
@@ -1512,6 +1545,8 @@ export type ApiMethods = {
1512
1545
  disable_notification?: boolean;
1513
1546
  /** Protects the contents of the sent message from forwarding and saving */
1514
1547
  protect_content?: boolean;
1548
+ /** 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 */
1549
+ allow_paid_broadcast?: boolean;
1515
1550
  /** Unique identifier of the message effect to be added to the message; for private chats only */
1516
1551
  message_effect_id?: string;
1517
1552
  /** Description of the message to reply to */
@@ -1735,6 +1770,8 @@ export type ApiMethods = {
1735
1770
  disable_notification?: boolean;
1736
1771
  /** Protects the contents of the sent message from forwarding and saving */
1737
1772
  protect_content?: boolean;
1773
+ /** 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 */
1774
+ allow_paid_broadcast?: boolean;
1738
1775
  /** Unique identifier of the message effect to be added to the message; for private chats only */
1739
1776
  message_effect_id?: string;
1740
1777
  /** Description of the message to reply to */
@@ -1849,6 +1886,8 @@ export type ApiMethods = {
1849
1886
  disable_notification?: boolean;
1850
1887
  /** Protects the contents of the sent message from forwarding and saving */
1851
1888
  protect_content?: boolean;
1889
+ /** 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 */
1890
+ allow_paid_broadcast?: boolean;
1852
1891
  /** Unique identifier of the message effect to be added to the message; for private chats only */
1853
1892
  message_effect_id?: string;
1854
1893
  /** Description of the message to reply to */
@@ -1,4 +1,4 @@
1
- import type { WebAppInfo } from "./markupTypes.js";
1
+ import type { WebAppInfo } from "./markupTypes";
2
2
 
3
3
  /**
4
4
  * This interface represents the name of the bot.
package/src/index.d.ts CHANGED
@@ -6,5 +6,6 @@ export * from "./messageTypes";
6
6
  export * from "./apiMethodsTypes";
7
7
  export * from "./passportTypes";
8
8
  export * from "./invoiceTypes";
9
+ export * from "./languageTypes";
9
10
  export * from "./botCommandTypes";
10
11
  export * from "./updateTypes";
@@ -160,11 +160,13 @@ export interface RevenueWithdrawalStateFailed {
160
160
  - TransactionPartnerUser
161
161
  - TransactionPartnerFragment
162
162
  - TransactionPartnerTelegramAds
163
+ - TransactionPartnerTelegramApi
163
164
  - TransactionPartnerOther */
164
165
  export type TransactionPartner =
165
166
  | TransactionPartnerUser
166
167
  | TransactionPartnerFragment
167
168
  | TransactionPartnerTelegramAds
169
+ | TransactionPartnerTelegramApi
168
170
  | TransactionPartnerOther;
169
171
 
170
172
  /** Describes a transaction with a user. */
@@ -189,6 +191,14 @@ export interface TransactionPartnerFragment {
189
191
  withdrawal_state?: RevenueWithdrawalState;
190
192
  }
191
193
 
194
+ /** Describes a transaction with payment for paid broadcasting. */
195
+ export interface TransactionPartnerTelegramApi {
196
+ /** Type of the transaction partner, always “telegram_api” */
197
+ type: "telegram_api";
198
+ /** The number of successful requests that exceeded regular limits and were therefore billed */
199
+ request_count: number;
200
+ }
201
+
192
202
  /** Describes a withdrawal transaction to the Telegram Ads platform. */
193
203
  export interface TransactionPartnerTelegramAds {
194
204
  /** Type of the transaction partner, always “telegram_ads” */
@@ -0,0 +1,194 @@
1
+ /** A two-letter ISO 639-1 language code.
2
+ * @see https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes
3
+ * @see https://www.loc.gov/standards/iso639-2/php/code_list.php
4
+ */
5
+ export type LanguageCode = (typeof LanguageCodes)[keyof typeof LanguageCodes];
6
+
7
+ /**
8
+ * @see {@link LanguageCode}
9
+ */
10
+ export declare const LanguageCodes: {
11
+ Abkhazian: "ab";
12
+ Afar: "aa";
13
+ Afrikaans: "af";
14
+ Akan: "ak";
15
+ Albanian: "sq";
16
+ Amharic: "am";
17
+ Arabic: "ar";
18
+ Aragonese: "an";
19
+ Armenian: "hy";
20
+ Assamese: "as";
21
+ Avaric: "av";
22
+ Avestan: "ae";
23
+ Aymara: "ay";
24
+ Azerbaijani: "az";
25
+ Bambara: "bm";
26
+ Bashkir: "ba";
27
+ Basque: "eu";
28
+ Belarusian: "be";
29
+ Bengali: "bn";
30
+ Bislama: "bi";
31
+ Bosnian: "bs";
32
+ Breton: "br";
33
+ Bulgarian: "bg";
34
+ Burmese: "my";
35
+ Catalan: "ca";
36
+ Chamorro: "ch";
37
+ Chechen: "ce";
38
+ Chichewa: "ny";
39
+ Chinese: "zh";
40
+ ChurchSlavonic: "cu";
41
+ Chuvash: "cv";
42
+ Cornish: "kw";
43
+ Corsican: "co";
44
+ Cree: "cr";
45
+ Croatian: "hr";
46
+ Czech: "cs";
47
+ Danish: "da";
48
+ Divehi: "dv";
49
+ Dutch: "nl";
50
+ Dzongkha: "dz";
51
+ English: "en";
52
+ Esperanto: "eo";
53
+ Estonian: "et";
54
+ Ewe: "ee";
55
+ Faroese: "fo";
56
+ Fijian: "fj";
57
+ Finnish: "fi";
58
+ French: "fr";
59
+ WesternFrisian: "fy";
60
+ Fulah: "ff";
61
+ Gaelic: "gd";
62
+ Galician: "gl";
63
+ Ganda: "lg";
64
+ Georgian: "ka";
65
+ German: "de";
66
+ Greek: "el";
67
+ Kalaallisut: "kl";
68
+ Guarani: "gn";
69
+ Gujarati: "gu";
70
+ Haitian: "ht";
71
+ Hausa: "ha";
72
+ Hebrew: "he";
73
+ Herero: "hz";
74
+ Hindi: "hi";
75
+ HiriMotu: "ho";
76
+ Hungarian: "hu";
77
+ Icelandic: "is";
78
+ Ido: "io";
79
+ Igbo: "ig";
80
+ Indonesian: "id";
81
+ Interlingua: "ia";
82
+ Interlingue: "ie";
83
+ Inuktitut: "iu";
84
+ Inupiaq: "ik";
85
+ Irish: "ga";
86
+ Italian: "it";
87
+ Japanese: "ja";
88
+ Javanese: "jv";
89
+ Kannada: "kn";
90
+ Kanuri: "kr";
91
+ Kashmiri: "ks";
92
+ Kazakh: "kk";
93
+ CentralKhmer: "km";
94
+ Kikuyu: "ki";
95
+ Kinyarwanda: "rw";
96
+ Kirghiz: "ky";
97
+ Komi: "kv";
98
+ Kongo: "kg";
99
+ Korean: "ko";
100
+ Kuanyama: "kj";
101
+ Kurdish: "ku";
102
+ Lao: "lo";
103
+ Latin: "la";
104
+ Latvian: "lv";
105
+ Limburgan: "li";
106
+ Lingala: "ln";
107
+ Lithuanian: "lt";
108
+ LubaKatanga: "lu";
109
+ Luxembourgish: "lb";
110
+ Macedonian: "mk";
111
+ Malagasy: "mg";
112
+ Malay: "ms";
113
+ Malayalam: "ml";
114
+ Maltese: "mt";
115
+ Manx: "gv";
116
+ Maori: "mi";
117
+ Marathi: "mr";
118
+ Marshallese: "mh";
119
+ Mongolian: "mn";
120
+ Nauru: "na";
121
+ Navajo: "nv";
122
+ NorthNdebele: "nd";
123
+ SouthNdebele: "nr";
124
+ Ndonga: "ng";
125
+ Nepali: "ne";
126
+ Norwegian: "no";
127
+ NorwegianBokmål: "nb";
128
+ NorwegianNynorsk: "nn";
129
+ SichuanYi: "ii";
130
+ Occitan: "oc";
131
+ Ojibwa: "oj";
132
+ Oriya: "or";
133
+ Oromo: "om";
134
+ Ossetian: "os";
135
+ Pali: "pi";
136
+ Pashto: "ps";
137
+ Persian: "fa";
138
+ Polish: "pl";
139
+ Portuguese: "pt";
140
+ Punjabi: "pa";
141
+ Quechua: "qu";
142
+ Romanian: "ro";
143
+ Romansh: "rm";
144
+ Rundi: "rn";
145
+ Russian: "ru";
146
+ NorthernSami: "se";
147
+ Samoan: "sm";
148
+ Sango: "sg";
149
+ Sanskrit: "sa";
150
+ Sardinian: "sc";
151
+ Serbian: "sr";
152
+ Shona: "sn";
153
+ Sindhi: "sd";
154
+ Sinhala: "si";
155
+ Slovak: "sk";
156
+ Slovenian: "sl";
157
+ Somali: "so";
158
+ SouthernSotho: "st";
159
+ Spanish: "es";
160
+ Sundanese: "su";
161
+ Swahili: "sw";
162
+ Swati: "ss";
163
+ Swedish: "sv";
164
+ Tagalog: "tl";
165
+ Tahitian: "ty";
166
+ Tajik: "tg";
167
+ Tamil: "ta";
168
+ Tatar: "tt";
169
+ Telugu: "te";
170
+ Thai: "th";
171
+ Tibetan: "bo";
172
+ Tigrinya: "ti";
173
+ Tonga: "to";
174
+ Tsonga: "ts";
175
+ Tswana: "tn";
176
+ Turkish: "tr";
177
+ Turkmen: "tk";
178
+ Twi: "tw";
179
+ Uighur: "ug";
180
+ Ukrainian: "uk";
181
+ Urdu: "ur";
182
+ Uzbek: "uz";
183
+ Venda: "ve";
184
+ Vietnamese: "vi";
185
+ Volapük: "vo";
186
+ Walloon: "wa";
187
+ Welsh: "cy";
188
+ Wolof: "wo";
189
+ Xhosa: "xh";
190
+ Yiddish: "yi";
191
+ Yoruba: "yo";
192
+ Zhuang: "za";
193
+ Zulu: "zu";
194
+ };
@@ -5,6 +5,7 @@ import type {
5
5
  ReactionType,
6
6
  Sticker,
7
7
  } from "./messageTypes";
8
+ import type { LanguageCode } from "./languageTypes";
8
9
  import type { Update } from "./updateTypes";
9
10
 
10
11
  /** Describes the current status of a webhook. */
@@ -42,7 +43,7 @@ export interface User {
42
43
  /** User's or bot's username */
43
44
  username?: string;
44
45
  /** IETF language tag of the user's language */
45
- language_code?: string;
46
+ language_code?: LanguageCode;
46
47
  /** True, if this user is a Telegram Premium user */
47
48
  is_premium?: true;
48
49
  /** True, if this user added the bot to the attachment menu */
@@ -44,6 +44,10 @@ export declare namespace InlineKeyboardButton {
44
44
  /** If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent on behalf of a Telegram Business account. */
45
45
  switch_inline_query_chosen_chat: SwitchInlineQueryChosenChat;
46
46
  }
47
+ export interface CopyTextButton extends AbstractInlineKeyboardButton {
48
+ /** Description of the button that copies the specified text to the clipboard. */
49
+ copy_text: CopyTextButton;
50
+ }
47
51
  export interface GameButton extends AbstractInlineKeyboardButton {
48
52
  /** Description of the game that will be launched when the user presses the button.
49
53
 
@@ -67,6 +71,7 @@ export type InlineKeyboardButton =
67
71
  | InlineKeyboardButton.SwitchInlineButton
68
72
  | InlineKeyboardButton.SwitchInlineCurrentChatButton
69
73
  | InlineKeyboardButton.SwitchInlineChosenChatButton
74
+ | InlineKeyboardButton.CopyTextButton
70
75
  | InlineKeyboardButton.UrlButton
71
76
  | InlineKeyboardButton.WebAppButton;
72
77
 
@@ -216,6 +221,12 @@ export interface ForceReply {
216
221
  selective?: boolean;
217
222
  }
218
223
 
224
+ /** This object represents an inline keyboard button that copies specified text to the clipboard. */
225
+ export interface CopyTextButton {
226
+ /** The text to be copied to the clipboard; 1-256 characters */
227
+ text: string;
228
+ }
229
+
219
230
  /** Describes a Web App. */
220
231
  export interface WebAppInfo {
221
232
  /** An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps */
@@ -1,4 +1,5 @@
1
1
  import type { Chat, User } from "./manageTypes";
2
+ import type { LanguageCode } from "./languageTypes";
2
3
  import type { InlineKeyboardMarkup } from "./markupTypes";
3
4
  import type { PassportData } from "./passportTypes";
4
5
  import type {
@@ -11,7 +12,7 @@ type MsgWith<P extends keyof Message> = Record<P, NonNullable<Message[P]>>;
11
12
 
12
13
  export declare namespace Message {
13
14
  interface ServiceMessage {
14
- /** Unique message identifier inside this chat */
15
+ /** Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent */
15
16
  message_id: number;
16
17
  /** Unique identifier of a message thread or a forum topic to which the message belongs; for supergroups only */
17
18
  message_thread_id?: number;
@@ -281,7 +282,7 @@ export interface Message extends Message.MediaMessage {
281
282
 
282
283
  /** This object represents a unique message identifier. */
283
284
  export interface MessageId {
284
- /** Unique message identifier */
285
+ /** Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent */
285
286
  message_id: number;
286
287
  }
287
288
 
@@ -430,7 +431,7 @@ export type ParseMode = "Markdown" | "MarkdownV2" | "HTML";
430
431
 
431
432
  export declare namespace MessageEntity {
432
433
  interface AbstractMessageEntity {
433
- /** Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers) */
434
+ /** Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers) */
434
435
  type: string;
435
436
  /** Offset in UTF-16 code units to the start of the entity */
436
437
  offset: number;
@@ -458,7 +459,7 @@ export declare namespace MessageEntity {
458
459
  export interface PreMessageEntity extends AbstractMessageEntity {
459
460
  type: "pre";
460
461
  /** For “pre” only, the programming language of the entity text */
461
- language?: string;
462
+ language?: LanguageCode;
462
463
  }
463
464
  export interface TextLinkMessageEntity extends AbstractMessageEntity {
464
465
  type: "text_link";