@tgsnake/skema 2.7.0 → 2.8.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/dist/src/deps.js CHANGED
@@ -15,7 +15,7 @@ import { inspect as nodeInspect } from 'node:util';
15
15
  import bigInt from 'big-integer';
16
16
  // Other platform compatibility
17
17
  // After this line, we will provide some compatibility for Deno, Bun, and Browser so that the same code can run in both environments without modification.
18
- const isDeno = 'Deno' in globalThis;
18
+ const isDeno = 'Deno' in globalThis; // Further Notes: Reffering to Cloudflare acquired Deno and it will end development of the Deno runtime, the Deno platform may will be deprecated in the future, but we will still provide compatibility for it for now. We will see what happens in the future, but for now, we will still provide compatibility for Deno.
19
19
  const isBun = 'Bun' in globalThis;
20
20
  const isBrowser = !isDeno && !isBun && typeof window !== 'undefined'; // browser compatibility
21
21
  /**
@@ -12,7 +12,7 @@
12
12
  * This file is auto generate. *
13
13
  * All change made in this file will be lost! *
14
14
  ***********************************************************/
15
- declare const count = 884;
15
+ declare const count = 888;
16
16
  declare const Exceptions: {
17
17
  303: {
18
18
  _: string;
@@ -34,6 +34,7 @@ declare const Exceptions: {
34
34
  ADMIN_RANK_INVALID: string;
35
35
  ADMIN_RIGHTS_EMPTY: string;
36
36
  AD_EXPIRED: string;
37
+ AICOMPOSE_FLOOD_PREMIUM: string;
37
38
  AICOMPOSE_TONE_INVALID: string;
38
39
  AICOMPOSE_TONE_TITLE_INVALID: string;
39
40
  AI_COMPOSE_TASK_MISSING: string;
@@ -477,6 +478,7 @@ declare const Exceptions: {
477
478
  QUIZ_MULTIPLE_INVALID: string;
478
479
  QUOTE_TEXT_INVALID: string;
479
480
  RAISE_HAND_FORBIDDEN: string;
481
+ RANDOM_ID_DUPLICATE: string;
480
482
  RANDOM_ID_EMPTY: string;
481
483
  RANDOM_ID_EXPIRED: string;
482
484
  RANDOM_ID_INVALID: string;
@@ -815,6 +817,7 @@ declare const Exceptions: {
815
817
  CHANNEL_PRIVATE: string;
816
818
  CHANNEL_TOO_LARGE: string;
817
819
  CHAT_FORWARDS_RESTRICTED: string;
820
+ EDIT_MESSAGE_TEMP_RESTRICTED: string;
818
821
  FILEREF_UPGRADE_NEEDED: string;
819
822
  FRESH_CHANGE_ADMINS_FORBIDDEN: string;
820
823
  FRESH_CHANGE_PHONE_FORBIDDEN: string;
@@ -825,6 +828,7 @@ declare const Exceptions: {
825
828
  PEER_ID_INVALID: string;
826
829
  PHONE_NUMBER_INVALID: string;
827
830
  PHONE_PASSWORD_FLOOD: string;
831
+ POLL_COUNTRY_RESTRICTED: string;
828
832
  POLL_MEMBER_RESTRICTED: string;
829
833
  PRECHECKOUT_FAILED: string;
830
834
  PREMIUM_CURRENTLY_UNAVAILABLE: string;
@@ -12,7 +12,7 @@
12
12
  * This file is auto generate. *
13
13
  * All change made in this file will be lost! *
14
14
  ***********************************************************/
15
- const count = 884;
15
+ const count = 888;
16
16
  const Exceptions = {
17
17
  303: {
18
18
  _: 'SeeOther.SeeOther',
@@ -34,6 +34,7 @@ const Exceptions = {
34
34
  ADMIN_RANK_INVALID: 'BadRequest.AdminRankInvalid',
35
35
  ADMIN_RIGHTS_EMPTY: 'BadRequest.AdminRightsEmpty',
36
36
  AD_EXPIRED: 'BadRequest.AdExpired',
37
+ AICOMPOSE_FLOOD_PREMIUM: 'BadRequest.AicomposeFloodPremium',
37
38
  AICOMPOSE_TONE_INVALID: 'BadRequest.AicomposeToneInvalid',
38
39
  AICOMPOSE_TONE_TITLE_INVALID: 'BadRequest.AicomposeToneTitleInvalid',
39
40
  AI_COMPOSE_TASK_MISSING: 'BadRequest.AiComposeTaskMissing',
@@ -477,6 +478,7 @@ const Exceptions = {
477
478
  QUIZ_MULTIPLE_INVALID: 'BadRequest.QuizMultipleInvalid',
478
479
  QUOTE_TEXT_INVALID: 'BadRequest.QuoteTextInvalid',
479
480
  RAISE_HAND_FORBIDDEN: 'BadRequest.RaiseHandForbidden',
481
+ RANDOM_ID_DUPLICATE: 'BadRequest.RandomIdDuplicate',
480
482
  RANDOM_ID_EMPTY: 'BadRequest.RandomIdEmpty',
481
483
  RANDOM_ID_EXPIRED: 'BadRequest.RandomIdExpired',
482
484
  RANDOM_ID_INVALID: 'BadRequest.RandomIdInvalid',
@@ -815,6 +817,7 @@ const Exceptions = {
815
817
  CHANNEL_PRIVATE: 'NotAcceptable.ChannelPrivate',
816
818
  CHANNEL_TOO_LARGE: 'NotAcceptable.ChannelTooLarge',
817
819
  CHAT_FORWARDS_RESTRICTED: 'NotAcceptable.ChatForwardsRestricted',
820
+ EDIT_MESSAGE_TEMP_RESTRICTED: 'NotAcceptable.EditMessageTempRestricted',
818
821
  FILEREF_UPGRADE_NEEDED: 'NotAcceptable.FilerefUpgradeNeeded',
819
822
  FRESH_CHANGE_ADMINS_FORBIDDEN: 'NotAcceptable.FreshChangeAdminsForbidden',
820
823
  FRESH_CHANGE_PHONE_FORBIDDEN: 'NotAcceptable.FreshChangePhoneForbidden',
@@ -825,6 +828,7 @@ const Exceptions = {
825
828
  PEER_ID_INVALID: 'NotAcceptable.PeerIdInvalid',
826
829
  PHONE_NUMBER_INVALID: 'NotAcceptable.PhoneNumberInvalid',
827
830
  PHONE_PASSWORD_FLOOD: 'NotAcceptable.PhonePasswordFlood',
831
+ POLL_COUNTRY_RESTRICTED: 'NotAcceptable.PollCountryRestricted',
828
832
  POLL_MEMBER_RESTRICTED: 'NotAcceptable.PollMemberRestricted',
829
833
  PRECHECKOUT_FAILED: 'NotAcceptable.PrecheckoutFailed',
830
834
  PREMIUM_CURRENTLY_UNAVAILABLE: 'NotAcceptable.PremiumCurrentlyUnavailable',
@@ -57,6 +57,10 @@ export declare class AdExpired extends BadRequest {
57
57
  id: string;
58
58
  message: string;
59
59
  }
60
+ export declare class AicomposeFloodPremium extends BadRequest {
61
+ id: string;
62
+ message: string;
63
+ }
60
64
  export declare class AicomposeToneInvalid extends BadRequest {
61
65
  id: string;
62
66
  message: string;
@@ -1829,6 +1833,10 @@ export declare class RaiseHandForbidden extends BadRequest {
1829
1833
  id: string;
1830
1834
  message: string;
1831
1835
  }
1836
+ export declare class RandomIdDuplicate extends BadRequest {
1837
+ id: string;
1838
+ message: string;
1839
+ }
1832
1840
  export declare class RandomIdEmpty extends BadRequest {
1833
1841
  id: string;
1834
1842
  message: string;
@@ -57,6 +57,10 @@ export class AdExpired extends BadRequest {
57
57
  id = 'AD_EXPIRED';
58
58
  message = 'The ad has expired (too old or not found).';
59
59
  }
60
+ export class AicomposeFloodPremium extends BadRequest {
61
+ id = 'AICOMPOSE_FLOOD_PREMIUM';
62
+ message = "You've reached the daily limit of AI text transformations, upgrade to [Telegram Premium](https://core.telegram.org/api/premium) to get **50x** times more AI text transformations per day!";
63
+ }
60
64
  export class AicomposeToneInvalid extends BadRequest {
61
65
  id = 'AICOMPOSE_TONE_INVALID';
62
66
  message = 'The specified tone is invalid.';
@@ -67,7 +71,7 @@ export class AicomposeToneTitleInvalid extends BadRequest {
67
71
  }
68
72
  export class AiComposeTaskMissing extends BadRequest {
69
73
  id = 'AI_COMPOSE_TASK_MISSING';
70
- message = '';
74
+ message = 'No AI task was specified. The caller must provide at least one of: proofread, translate (with a target language), tone, or emojify.';
71
75
  }
72
76
  export class AlbumPhotosTooMany extends BadRequest {
73
77
  id = 'ALBUM_PHOTOS_TOO_MANY';
@@ -199,7 +203,7 @@ export class BotCommandInvalid extends BadRequest {
199
203
  }
200
204
  export class BotCreateLimitExceeded extends BadRequest {
201
205
  id = 'BOT_CREATE_LIMIT_EXCEEDED';
202
- message = "The current user already owns the maximum allowed number of owned bots, as specified by [`bots_create_limit_default` »](https://core.telegram.org/api/config#bots-create-limit-default) and [`bots_create_limit_premium` »](https://core.telegram.org/api/config#bots-create-limit-premium); if the current user doesn't have Telegram Premium, upgrading to Premium will allow them to create more bots. .";
206
+ message = "The current user already owns the maximum allowed number of owned bots, as specified by [`bots_create_limit_default` »](https://core.telegram.org/api/config#bots-create-limit-default) and [`bots_create_limit_premium` »](https://core.telegram.org/api/config#bots-create-limit-premium); if the current user doesn't have Telegram Premium, upgrading to Premium will allow them to create more bots.";
203
207
  }
204
208
  export class BotDomainInvalid extends BadRequest {
205
209
  id = 'BOT_DOMAIN_INVALID';
@@ -675,7 +679,7 @@ export class DocumentInvalid extends BadRequest {
675
679
  }
676
680
  export class EffectChatInvalid extends BadRequest {
677
681
  id = 'EFFECT_CHAT_INVALID';
678
- message = '';
682
+ message = 'Message [effects](https://core.telegram.org/api/effects) can only be used in private 1-on-1 chats, but the caller tried to send a message with an effect to a group or channel.';
679
683
  }
680
684
  export class EffectIdInvalid extends BadRequest {
681
685
  id = 'EFFECT_ID_INVALID';
@@ -775,7 +779,7 @@ export class EntityDateInvalid extends BadRequest {
775
779
  }
776
780
  export class EntityDateTooLong extends BadRequest {
777
781
  id = 'ENTITY_DATE_TOO_LONG';
778
- message = '';
782
+ message = 'The maximum text span that can be covered by a date entity is 31 UTF-16 code units if any of the date formatting flags is set, or 127 UTF-16 code units without. .';
779
783
  }
780
784
  export class EntityMentionUserInvalid extends BadRequest {
781
785
  id = 'ENTITY_MENTION_USER_INVALID';
@@ -811,7 +815,7 @@ export class ExtendedMediaInvalid extends BadRequest {
811
815
  }
812
816
  export class ExtendedMediaPeerInvalid extends BadRequest {
813
817
  id = 'EXTENDED_MEDIA_PEER_INVALID';
814
- message = '';
818
+ message = 'Paid media is not allowed for the target peer.';
815
819
  }
816
820
  export class ExternalUrlInvalid extends BadRequest {
817
821
  id = 'EXTERNAL_URL_INVALID';
@@ -1031,7 +1035,7 @@ export class GroupcallAlreadyDiscarded extends BadRequest {
1031
1035
  }
1032
1036
  export class GroupcallForbidden extends BadRequest {
1033
1037
  id = 'GROUPCALL_FORBIDDEN';
1034
- message = 'The group call has already ended.';
1038
+ message = 'The specified group call cannot be used in this context.';
1035
1039
  }
1036
1040
  export class GroupcallInvalid extends BadRequest {
1037
1041
  id = 'GROUPCALL_INVALID';
@@ -1431,7 +1435,7 @@ export class NameInvalid extends BadRequest {
1431
1435
  }
1432
1436
  export class NeedActionMissing extends BadRequest {
1433
1437
  id = 'NEED_ACTION_MISSING';
1434
- message = '';
1438
+ message = "The caller didn't specify a valid action (either save or suggest) for the contact profile photo upload.";
1435
1439
  }
1436
1440
  export class NewSaltInvalid extends BadRequest {
1437
1441
  id = 'NEW_SALT_INVALID';
@@ -1829,6 +1833,10 @@ export class RaiseHandForbidden extends BadRequest {
1829
1833
  id = 'RAISE_HAND_FORBIDDEN';
1830
1834
  message = 'You cannot raise your hand.';
1831
1835
  }
1836
+ export class RandomIdDuplicate extends BadRequest {
1837
+ id = 'RANDOM_ID_DUPLICATE';
1838
+ message = 'You provided a random ID that was already used.';
1839
+ }
1832
1840
  export class RandomIdEmpty extends BadRequest {
1833
1841
  id = 'RANDOM_ID_EMPTY';
1834
1842
  message = 'Random ID empty.';
@@ -2399,7 +2407,7 @@ export class TermsUrlInvalid extends BadRequest {
2399
2407
  }
2400
2408
  export class TextdraftPeerInvalid extends BadRequest {
2401
2409
  id = 'TEXTDRAFT_PEER_INVALID';
2402
- message = '';
2410
+ message = 'sendMessageTextDraftAction can only be used in private 1-on-1 chats.';
2403
2411
  }
2404
2412
  export class ThemeFileInvalid extends BadRequest {
2405
2413
  id = 'THEME_FILE_INVALID';
@@ -2639,7 +2647,7 @@ export class UserBotRequired extends BadRequest {
2639
2647
  }
2640
2648
  export class UserBotToBotDisabled extends BadRequest {
2641
2649
  id = 'USER_BOT_TO_BOT_DISABLED';
2642
- message = '';
2650
+ message = "Bot-to-bot messaging is disabled because one of the two bots hasn't enabled the Bot to Bot setting in @BotFather.";
2643
2651
  }
2644
2652
  export class UserChannelsTooMuch extends BadRequest {
2645
2653
  id = 'USER_CHANNELS_TOO_MUCH';
@@ -19,7 +19,7 @@ export class Forbidden extends RPCError {
19
19
  }
20
20
  export class AccessDenied extends Forbidden {
21
21
  id = 'ACCESS_DENIED';
22
- message = '';
22
+ message = 'The account was deactivated, or is a bot/service account.';
23
23
  }
24
24
  export class AllowPaymentRequired extends Forbidden {
25
25
  id = 'ALLOW_PAYMENT_REQUIRED_X';
@@ -39,7 +39,7 @@ export class BotForumCreateForbidden extends Forbidden {
39
39
  }
40
40
  export class BotGuardNotSupported extends Forbidden {
41
41
  id = 'BOT_GUARD_NOT_SUPPORTED';
42
- message = '';
42
+ message = 'This bot is not designated as a "join guard" bot. This method is only available to bots that mediate user joins to chats. .';
43
43
  }
44
44
  export class BotVerifierForbidden extends Forbidden {
45
45
  id = 'BOT_VERIFIER_FORBIDDEN';
@@ -155,7 +155,7 @@ export class GroupcallChangeForbidden extends Forbidden {
155
155
  }
156
156
  export class GroupcallForbidden extends Forbidden {
157
157
  id = 'GROUPCALL_FORBIDDEN';
158
- message = 'The group call has already ended.';
158
+ message = 'The specified group call cannot be used in this context.';
159
159
  }
160
160
  export class InlineBotRequired extends Forbidden {
161
161
  id = 'INLINE_BOT_REQUIRED';
@@ -227,7 +227,7 @@ export class UserDeleted extends Forbidden {
227
227
  }
228
228
  export class UserDisallowedStargifts extends Forbidden {
229
229
  id = 'USER_DISALLOWED_STARGIFTS';
230
- message = '';
230
+ message = "The recipient user has configured restrictions on which categories of star gifts they're willing to accept (unique, limited, or unlimited): the sender attempted to get a payment form for a gift that falls into a category the recipient has blocked.";
231
231
  }
232
232
  export class UserInvalid extends Forbidden {
233
233
  id = 'USER_INVALID';
@@ -53,6 +53,10 @@ export declare class ChatForwardsRestricted extends NotAcceptable {
53
53
  id: string;
54
54
  message: string;
55
55
  }
56
+ export declare class EditMessageTempRestricted extends NotAcceptable {
57
+ id: string;
58
+ message: string;
59
+ }
56
60
  export declare class FilerefUpgradeNeeded extends NotAcceptable {
57
61
  id: string;
58
62
  message: string;
@@ -93,6 +97,10 @@ export declare class PhonePasswordFlood extends NotAcceptable {
93
97
  id: string;
94
98
  message: string;
95
99
  }
100
+ export declare class PollCountryRestricted extends NotAcceptable {
101
+ id: string;
102
+ message: string;
103
+ }
96
104
  export declare class PollMemberRestricted extends NotAcceptable {
97
105
  id: string;
98
106
  message: string;
@@ -53,6 +53,10 @@ export class ChatForwardsRestricted extends NotAcceptable {
53
53
  id = 'CHAT_FORWARDS_RESTRICTED';
54
54
  message = "You can't forward messages from a protected chat.";
55
55
  }
56
+ export class EditMessageTempRestricted extends NotAcceptable {
57
+ id = 'EDIT_MESSAGE_TEMP_RESTRICTED';
58
+ message = 'Message editing is temporarily forbidden for this user due to regulatory restrictions.';
59
+ }
56
60
  export class FilerefUpgradeNeeded extends NotAcceptable {
57
61
  id = 'FILEREF_UPGRADE_NEEDED';
58
62
  message = 'The client has to be updated in order to support [file references](https://core.telegram.org/api/file-references).';
@@ -93,6 +97,10 @@ export class PhonePasswordFlood extends NotAcceptable {
93
97
  id = 'PHONE_PASSWORD_FLOOD';
94
98
  message = 'You have tried logging in too many times.';
95
99
  }
100
+ export class PollCountryRestricted extends NotAcceptable {
101
+ id = 'POLL_COUNTRY_RESTRICTED';
102
+ message = "Users from the current user's country cannot vote in this [country-restricted poll »](https://core.telegram.org/api/poll#country-restricted-polls).";
103
+ }
96
104
  export class PollMemberRestricted extends NotAcceptable {
97
105
  id = 'POLL_MEMBER_RESTRICTED';
98
106
  message = 'Only channel subscribers can vote in this poll.';
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@tgsnake/skema",
3
- "version": "2.7.0",
3
+ "version": "2.8.0",
4
4
  "description": "A compiled Telegram TL Schema and Telegram errors Schema into usable JavaScript classes with full TypeScript support",
5
5
  "main": "dist/mod.js",
6
6
  "types": "dist/mod.d.ts",
7
7
  "type": "module",
8
- "packageManager": "yarn@4.9.2",
8
+ "packageManager": "yarn@4.18.1",
9
9
  "homepage": "https://tgsnake.js.org",
10
10
  "keywords": [
11
11
  "tgsnake",
@@ -38,11 +38,11 @@
38
38
  "prettier": "NODE_OPTIONS=--max_old_space_size=4096 prettier -w ."
39
39
  },
40
40
  "devDependencies": {
41
- "@types/bun": "^1.3.14",
42
- "@types/node": "^25.9.3",
43
- "prettier": "^3.8.4",
44
- "typedoc": "^0.28.19",
45
- "typescript": "^6.0.3"
41
+ "@types/bun": "^1.4.4",
42
+ "@types/node": "^26.6.6",
43
+ "prettier": "^3.9.10",
44
+ "typedoc": "^0.28.20",
45
+ "typescript": "^7.0.2"
46
46
  },
47
47
  "dependencies": {
48
48
  "@tgsnake/bytesio": "^2.0.1",