@armatofik/tgsnake-core 1.0.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.
Files changed (171) hide show
  1. package/COPYING +674 -0
  2. package/COPYING.lesser +165 -0
  3. package/README.md +88 -0
  4. package/lib/package.json +46 -0
  5. package/lib/src/Logger.d.ts +3 -0
  6. package/lib/src/Logger.js +9 -0
  7. package/lib/src/Queue.d.ts +19 -0
  8. package/lib/src/Queue.js +52 -0
  9. package/lib/src/Timeout.d.ts +9 -0
  10. package/lib/src/Timeout.js +44 -0
  11. package/lib/src/Version.node.d.ts +4 -0
  12. package/lib/src/Version.node.js +26 -0
  13. package/lib/src/client/Auth.d.ts +40 -0
  14. package/lib/src/client/Auth.js +317 -0
  15. package/lib/src/client/Client.d.ts +83 -0
  16. package/lib/src/client/Client.js +461 -0
  17. package/lib/src/client/Session.d.ts +9 -0
  18. package/lib/src/client/Session.js +132 -0
  19. package/lib/src/client/index.d.ts +3 -0
  20. package/lib/src/client/index.js +39 -0
  21. package/lib/src/connection/TCP/TCPAbridged.d.ts +9 -0
  22. package/lib/src/connection/TCP/TCPAbridged.js +47 -0
  23. package/lib/src/connection/TCP/TCPAbridgedO.d.ts +12 -0
  24. package/lib/src/connection/TCP/TCPAbridgedO.js +140 -0
  25. package/lib/src/connection/TCP/TCPFull.d.ts +10 -0
  26. package/lib/src/connection/TCP/TCPFull.js +43 -0
  27. package/lib/src/connection/TCP/TCPIntermediate.d.ts +9 -0
  28. package/lib/src/connection/TCP/TCPIntermediate.js +31 -0
  29. package/lib/src/connection/TCP/TCPIntermediateO.d.ts +12 -0
  30. package/lib/src/connection/TCP/TCPIntermediateO.js +123 -0
  31. package/lib/src/connection/TCP/TCPPaddedIntermediate.d.ts +9 -0
  32. package/lib/src/connection/TCP/TCPPaddedIntermediate.js +38 -0
  33. package/lib/src/connection/TCP/index.d.ts +7 -0
  34. package/lib/src/connection/TCP/index.js +17 -0
  35. package/lib/src/connection/TCP/tcp.d.ts +17 -0
  36. package/lib/src/connection/TCP/tcp.js +98 -0
  37. package/lib/src/connection/WebSocket.d.ts +21 -0
  38. package/lib/src/connection/WebSocket.js +279 -0
  39. package/lib/src/connection/connection.d.ts +53 -0
  40. package/lib/src/connection/connection.js +189 -0
  41. package/lib/src/connection/index.d.ts +4 -0
  42. package/lib/src/connection/index.js +41 -0
  43. package/lib/src/crypto/Aes.d.ts +10 -0
  44. package/lib/src/crypto/Aes.js +135 -0
  45. package/lib/src/crypto/Mtproto.d.ts +5 -0
  46. package/lib/src/crypto/Mtproto.js +123 -0
  47. package/lib/src/crypto/Password.d.ts +5 -0
  48. package/lib/src/crypto/Password.js +92 -0
  49. package/lib/src/crypto/Prime.d.ts +4 -0
  50. package/lib/src/crypto/Prime.js +64 -0
  51. package/lib/src/crypto/RSA.d.ts +7 -0
  52. package/lib/src/crypto/RSA.js +99 -0
  53. package/lib/src/crypto/SecretChat.d.ts +5 -0
  54. package/lib/src/crypto/SecretChat.js +136 -0
  55. package/lib/src/crypto/index.d.ts +6 -0
  56. package/lib/src/crypto/index.js +42 -0
  57. package/lib/src/errors/Base.d.ts +9 -0
  58. package/lib/src/errors/Base.js +50 -0
  59. package/lib/src/errors/Client.d.ts +21 -0
  60. package/lib/src/errors/Client.js +29 -0
  61. package/lib/src/errors/File.d.ts +13 -0
  62. package/lib/src/errors/File.js +30 -0
  63. package/lib/src/errors/RpcError.d.ts +22 -0
  64. package/lib/src/errors/RpcError.js +120 -0
  65. package/lib/src/errors/SecretChat.d.ts +13 -0
  66. package/lib/src/errors/SecretChat.js +30 -0
  67. package/lib/src/errors/WebSocket.d.ts +13 -0
  68. package/lib/src/errors/WebSocket.js +30 -0
  69. package/lib/src/errors/exceptions/All.d.ts +774 -0
  70. package/lib/src/errors/exceptions/All.js +778 -0
  71. package/lib/src/errors/exceptions/BadRequest400.d.ts +2345 -0
  72. package/lib/src/errors/exceptions/BadRequest400.js +2945 -0
  73. package/lib/src/errors/exceptions/Flood420.d.ts +37 -0
  74. package/lib/src/errors/exceptions/Flood420.js +49 -0
  75. package/lib/src/errors/exceptions/Forbidden403.d.ts +205 -0
  76. package/lib/src/errors/exceptions/Forbidden403.js +260 -0
  77. package/lib/src/errors/exceptions/InternalServerError500.d.ts +221 -0
  78. package/lib/src/errors/exceptions/InternalServerError500.js +280 -0
  79. package/lib/src/errors/exceptions/NotAcceptable406.d.ts +117 -0
  80. package/lib/src/errors/exceptions/NotAcceptable406.js +149 -0
  81. package/lib/src/errors/exceptions/NotFound404.d.ts +9 -0
  82. package/lib/src/errors/exceptions/NotFound404.js +14 -0
  83. package/lib/src/errors/exceptions/SeeOther303.d.ts +25 -0
  84. package/lib/src/errors/exceptions/SeeOther303.js +34 -0
  85. package/lib/src/errors/exceptions/ServiceUnavailable503.d.ts +17 -0
  86. package/lib/src/errors/exceptions/ServiceUnavailable503.js +24 -0
  87. package/lib/src/errors/exceptions/Unauthorized401.d.ts +41 -0
  88. package/lib/src/errors/exceptions/Unauthorized401.js +54 -0
  89. package/lib/src/errors/exceptions/index.d.ts +10 -0
  90. package/lib/src/errors/exceptions/index.js +48 -0
  91. package/lib/src/errors/index.d.ts +31 -0
  92. package/lib/src/errors/index.js +111 -0
  93. package/lib/src/file/Download.d.ts +11 -0
  94. package/lib/src/file/Download.js +118 -0
  95. package/lib/src/file/File.d.ts +20 -0
  96. package/lib/src/file/File.js +82 -0
  97. package/lib/src/file/Upload.d.ts +19 -0
  98. package/lib/src/file/Upload.js +250 -0
  99. package/lib/src/file/index.d.ts +3 -0
  100. package/lib/src/file/index.js +11 -0
  101. package/lib/src/helpers.d.ts +34 -0
  102. package/lib/src/helpers.js +358 -0
  103. package/lib/src/index.d.ts +16 -0
  104. package/lib/src/index.js +56 -0
  105. package/lib/src/platform.node.d.ts +36 -0
  106. package/lib/src/platform.node.js +109 -0
  107. package/lib/src/raw/All.d.ts +2400 -0
  108. package/lib/src/raw/All.js +2403 -0
  109. package/lib/src/raw/Raw.d.ts +29195 -0
  110. package/lib/src/raw/Raw.js +97277 -0
  111. package/lib/src/raw/core/BytesIO.d.ts +33 -0
  112. package/lib/src/raw/core/BytesIO.js +145 -0
  113. package/lib/src/raw/core/GzipPacked.d.ts +10 -0
  114. package/lib/src/raw/core/GzipPacked.js +60 -0
  115. package/lib/src/raw/core/Message.d.ts +13 -0
  116. package/lib/src/raw/core/Message.js +81 -0
  117. package/lib/src/raw/core/MsgContainer.d.ts +11 -0
  118. package/lib/src/raw/core/MsgContainer.js +69 -0
  119. package/lib/src/raw/core/TLObject.d.ts +19 -0
  120. package/lib/src/raw/core/TLObject.js +108 -0
  121. package/lib/src/raw/core/UpdateSecretChat.d.ts +40 -0
  122. package/lib/src/raw/core/UpdateSecretChat.js +88 -0
  123. package/lib/src/raw/core/index.d.ts +8 -0
  124. package/lib/src/raw/core/index.js +52 -0
  125. package/lib/src/raw/core/primitive/Bool.d.ts +20 -0
  126. package/lib/src/raw/core/primitive/Bool.js +41 -0
  127. package/lib/src/raw/core/primitive/Bytes.d.ts +7 -0
  128. package/lib/src/raw/core/primitive/Bytes.js +41 -0
  129. package/lib/src/raw/core/primitive/Double.d.ts +7 -0
  130. package/lib/src/raw/core/primitive/Double.js +24 -0
  131. package/lib/src/raw/core/primitive/Float.d.ts +7 -0
  132. package/lib/src/raw/core/primitive/Float.js +24 -0
  133. package/lib/src/raw/core/primitive/Int.d.ts +23 -0
  134. package/lib/src/raw/core/primitive/Int.js +122 -0
  135. package/lib/src/raw/core/primitive/String.d.ts +7 -0
  136. package/lib/src/raw/core/primitive/String.js +15 -0
  137. package/lib/src/raw/core/primitive/Vector.d.ts +9 -0
  138. package/lib/src/raw/core/primitive/Vector.js +50 -0
  139. package/lib/src/raw/core/primitive/index.d.ts +7 -0
  140. package/lib/src/raw/core/primitive/index.js +22 -0
  141. package/lib/src/raw/index.d.ts +3 -0
  142. package/lib/src/raw/index.js +17 -0
  143. package/lib/src/session/Auth.d.ts +15 -0
  144. package/lib/src/session/Auth.js +254 -0
  145. package/lib/src/session/Session.d.ts +58 -0
  146. package/lib/src/session/Session.js +571 -0
  147. package/lib/src/session/index.d.ts +7 -0
  148. package/lib/src/session/index.js +49 -0
  149. package/lib/src/session/internals/DataCenter.d.ts +42 -0
  150. package/lib/src/session/internals/DataCenter.js +80 -0
  151. package/lib/src/session/internals/MsgFactory.d.ts +3 -0
  152. package/lib/src/session/internals/MsgFactory.js +23 -0
  153. package/lib/src/session/internals/MsgId.d.ts +9 -0
  154. package/lib/src/session/internals/MsgId.js +24 -0
  155. package/lib/src/session/internals/SeqNo.d.ts +6 -0
  156. package/lib/src/session/internals/SeqNo.js +18 -0
  157. package/lib/src/session/secretChats/SecretChat.d.ts +29 -0
  158. package/lib/src/session/secretChats/SecretChat.js +527 -0
  159. package/lib/src/session/secretChats/index.d.ts +1 -0
  160. package/lib/src/session/secretChats/index.js +5 -0
  161. package/lib/src/storage/Abstract.d.ts +68 -0
  162. package/lib/src/storage/Abstract.js +6 -0
  163. package/lib/src/storage/SecretChat.d.ts +42 -0
  164. package/lib/src/storage/SecretChat.js +99 -0
  165. package/lib/src/storage/Session.d.ts +63 -0
  166. package/lib/src/storage/Session.js +245 -0
  167. package/lib/src/storage/StringSession.d.ts +4 -0
  168. package/lib/src/storage/StringSession.js +77 -0
  169. package/lib/src/storage/index.d.ts +4 -0
  170. package/lib/src/storage/index.js +12 -0
  171. package/package.json +46 -0
@@ -0,0 +1,37 @@
1
+ import { RPCError } from '../RpcError.js';
2
+ export declare class Flood extends RPCError {
3
+ code: number;
4
+ name: string;
5
+ }
6
+ export declare class TwoFaConfirmWait extends Flood {
7
+ id: string;
8
+ message: string;
9
+ }
10
+ export declare class AddressInvalid extends Flood {
11
+ id: string;
12
+ message: string;
13
+ }
14
+ export declare class FloodPremiumWait extends Flood {
15
+ id: string;
16
+ message: string;
17
+ }
18
+ export declare class FloodTestPhoneWait extends Flood {
19
+ id: string;
20
+ message: string;
21
+ }
22
+ export declare class FloodWait extends Flood {
23
+ id: string;
24
+ message: string;
25
+ }
26
+ export declare class PremiumSubActiveUntil extends Flood {
27
+ id: string;
28
+ message: string;
29
+ }
30
+ export declare class SlowmodeWait extends Flood {
31
+ id: string;
32
+ message: string;
33
+ }
34
+ export declare class TakeoutInitDelay extends Flood {
35
+ id: string;
36
+ message: string;
37
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TakeoutInitDelay = exports.SlowmodeWait = exports.PremiumSubActiveUntil = exports.FloodWait = exports.FloodTestPhoneWait = exports.FloodPremiumWait = exports.AddressInvalid = exports.TwoFaConfirmWait = exports.Flood = void 0;
4
+ const RpcError_js_1 = require("../RpcError.js");
5
+ class Flood extends RpcError_js_1.RPCError {
6
+ code = 420;
7
+ name = 'FLOOD';
8
+ }
9
+ exports.Flood = Flood;
10
+ class TwoFaConfirmWait extends Flood {
11
+ id = '2FA_CONFIRM_WAIT_X';
12
+ message = "Since this account is active and protected by a 2FA password, we will delete it in 1 week for security purposes. You can cancel this process at any time, you'll be able to reset your account in {value} seconds.";
13
+ }
14
+ exports.TwoFaConfirmWait = TwoFaConfirmWait;
15
+ class AddressInvalid extends Flood {
16
+ id = 'ADDRESS_INVALID';
17
+ message = 'The specified geopoint address is invalid.';
18
+ }
19
+ exports.AddressInvalid = AddressInvalid;
20
+ class FloodPremiumWait extends Flood {
21
+ id = 'FLOOD_PREMIUM_WAIT_X';
22
+ message = 'Please wait {value} seconds before repeating the action, or purchase a [Telegram Premium subscription](https://core.telegram.org/api/premium) to remove this rate limit.';
23
+ }
24
+ exports.FloodPremiumWait = FloodPremiumWait;
25
+ class FloodTestPhoneWait extends Flood {
26
+ id = 'FLOOD_TEST_PHONE_WAIT_X';
27
+ message = 'A wait of {value} seconds is required in the test servers';
28
+ }
29
+ exports.FloodTestPhoneWait = FloodTestPhoneWait;
30
+ class FloodWait extends Flood {
31
+ id = 'FLOOD_WAIT_X';
32
+ message = 'Please wait {value} seconds before repeating the action.';
33
+ }
34
+ exports.FloodWait = FloodWait;
35
+ class PremiumSubActiveUntil extends Flood {
36
+ id = 'PREMIUM_SUB_ACTIVE_UNTIL_X';
37
+ message = 'You already have a premium subscription active until unixtime {value} .';
38
+ }
39
+ exports.PremiumSubActiveUntil = PremiumSubActiveUntil;
40
+ class SlowmodeWait extends Flood {
41
+ id = 'SLOWMODE_WAIT_X';
42
+ message = 'Slowmode is enabled in this chat: wait {value} seconds before sending another message to this chat.';
43
+ }
44
+ exports.SlowmodeWait = SlowmodeWait;
45
+ class TakeoutInitDelay extends Flood {
46
+ id = 'TAKEOUT_INIT_DELAY_X';
47
+ message = "Sorry, for security reasons, you will be able to begin downloading your data in {value} seconds. We have notified all your devices about the export request to make sure it's authorized and to give you time to react if it's not.";
48
+ }
49
+ exports.TakeoutInitDelay = TakeoutInitDelay;
@@ -0,0 +1,205 @@
1
+ import { RPCError } from '../RpcError.js';
2
+ export declare class Forbidden extends RPCError {
3
+ code: number;
4
+ name: string;
5
+ }
6
+ export declare class AnonymousReactionsDisabled extends Forbidden {
7
+ id: string;
8
+ message: string;
9
+ }
10
+ export declare class BroadcastForbidden extends Forbidden {
11
+ id: string;
12
+ message: string;
13
+ }
14
+ export declare class ChannelPublicGroupNa extends Forbidden {
15
+ id: string;
16
+ message: string;
17
+ }
18
+ export declare class ChatActionForbidden extends Forbidden {
19
+ id: string;
20
+ message: string;
21
+ }
22
+ export declare class ChatAdminInviteRequired extends Forbidden {
23
+ id: string;
24
+ message: string;
25
+ }
26
+ export declare class ChatAdminRequired extends Forbidden {
27
+ id: string;
28
+ message: string;
29
+ }
30
+ export declare class ChatForbidden extends Forbidden {
31
+ id: string;
32
+ message: string;
33
+ }
34
+ export declare class ChatGuestSendForbidden extends Forbidden {
35
+ id: string;
36
+ message: string;
37
+ }
38
+ export declare class ChatSendAudiosForbidden extends Forbidden {
39
+ id: string;
40
+ message: string;
41
+ }
42
+ export declare class ChatSendDocsForbidden extends Forbidden {
43
+ id: string;
44
+ message: string;
45
+ }
46
+ export declare class ChatSendGameForbidden extends Forbidden {
47
+ id: string;
48
+ message: string;
49
+ }
50
+ export declare class ChatSendGifsForbidden extends Forbidden {
51
+ id: string;
52
+ message: string;
53
+ }
54
+ export declare class ChatSendInlineForbidden extends Forbidden {
55
+ id: string;
56
+ message: string;
57
+ }
58
+ export declare class ChatSendMediaForbidden extends Forbidden {
59
+ id: string;
60
+ message: string;
61
+ }
62
+ export declare class ChatSendPhotosForbidden extends Forbidden {
63
+ id: string;
64
+ message: string;
65
+ }
66
+ export declare class ChatSendPlainForbidden extends Forbidden {
67
+ id: string;
68
+ message: string;
69
+ }
70
+ export declare class ChatSendPollForbidden extends Forbidden {
71
+ id: string;
72
+ message: string;
73
+ }
74
+ export declare class ChatSendRoundvideosForbidden extends Forbidden {
75
+ id: string;
76
+ message: string;
77
+ }
78
+ export declare class ChatSendStickersForbidden extends Forbidden {
79
+ id: string;
80
+ message: string;
81
+ }
82
+ export declare class ChatSendVideosForbidden extends Forbidden {
83
+ id: string;
84
+ message: string;
85
+ }
86
+ export declare class ChatSendVoicesForbidden extends Forbidden {
87
+ id: string;
88
+ message: string;
89
+ }
90
+ export declare class ChatTypeInvalid extends Forbidden {
91
+ id: string;
92
+ message: string;
93
+ }
94
+ export declare class ChatWriteForbidden extends Forbidden {
95
+ id: string;
96
+ message: string;
97
+ }
98
+ export declare class EditBotInviteForbidden extends Forbidden {
99
+ id: string;
100
+ message: string;
101
+ }
102
+ export declare class GroupcallAlreadyStarted extends Forbidden {
103
+ id: string;
104
+ message: string;
105
+ }
106
+ export declare class GroupcallForbidden extends Forbidden {
107
+ id: string;
108
+ message: string;
109
+ }
110
+ export declare class InlineBotRequired extends Forbidden {
111
+ id: string;
112
+ message: string;
113
+ }
114
+ export declare class MessageAuthorRequired extends Forbidden {
115
+ id: string;
116
+ message: string;
117
+ }
118
+ export declare class MessageDeleteForbidden extends Forbidden {
119
+ id: string;
120
+ message: string;
121
+ }
122
+ export declare class NotEligible extends Forbidden {
123
+ id: string;
124
+ message: string;
125
+ }
126
+ export declare class ParticipantJoinMissing extends Forbidden {
127
+ id: string;
128
+ message: string;
129
+ }
130
+ export declare class PeerIdInvalid extends Forbidden {
131
+ id: string;
132
+ message: string;
133
+ }
134
+ export declare class PollVoteRequired extends Forbidden {
135
+ id: string;
136
+ message: string;
137
+ }
138
+ export declare class PremiumAccountRequired extends Forbidden {
139
+ id: string;
140
+ message: string;
141
+ }
142
+ export declare class PrivacyPremiumRequired extends Forbidden {
143
+ id: string;
144
+ message: string;
145
+ }
146
+ export declare class PublicChannelMissing extends Forbidden {
147
+ id: string;
148
+ message: string;
149
+ }
150
+ export declare class RightForbidden extends Forbidden {
151
+ id: string;
152
+ message: string;
153
+ }
154
+ export declare class SensitiveChangeForbidden extends Forbidden {
155
+ id: string;
156
+ message: string;
157
+ }
158
+ export declare class TakeoutRequired extends Forbidden {
159
+ id: string;
160
+ message: string;
161
+ }
162
+ export declare class UserBotInvalid extends Forbidden {
163
+ id: string;
164
+ message: string;
165
+ }
166
+ export declare class UserChannelsTooMuch extends Forbidden {
167
+ id: string;
168
+ message: string;
169
+ }
170
+ export declare class UserDeleted extends Forbidden {
171
+ id: string;
172
+ message: string;
173
+ }
174
+ export declare class UserInvalid extends Forbidden {
175
+ id: string;
176
+ message: string;
177
+ }
178
+ export declare class UserIsBlocked extends Forbidden {
179
+ id: string;
180
+ message: string;
181
+ }
182
+ export declare class UserNotMutualContact extends Forbidden {
183
+ id: string;
184
+ message: string;
185
+ }
186
+ export declare class UserNotParticipant extends Forbidden {
187
+ id: string;
188
+ message: string;
189
+ }
190
+ export declare class UserPrivacyRestricted extends Forbidden {
191
+ id: string;
192
+ message: string;
193
+ }
194
+ export declare class UserRestricted extends Forbidden {
195
+ id: string;
196
+ message: string;
197
+ }
198
+ export declare class VoiceMessagesForbidden extends Forbidden {
199
+ id: string;
200
+ message: string;
201
+ }
202
+ export declare class YourPrivacyRestricted extends Forbidden {
203
+ id: string;
204
+ message: string;
205
+ }
@@ -0,0 +1,260 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VoiceMessagesForbidden = exports.UserRestricted = exports.UserPrivacyRestricted = exports.UserNotParticipant = exports.UserNotMutualContact = exports.UserIsBlocked = exports.UserInvalid = exports.UserDeleted = exports.UserChannelsTooMuch = exports.UserBotInvalid = exports.TakeoutRequired = exports.SensitiveChangeForbidden = exports.RightForbidden = exports.PublicChannelMissing = exports.PrivacyPremiumRequired = exports.PremiumAccountRequired = exports.PollVoteRequired = exports.PeerIdInvalid = exports.ParticipantJoinMissing = exports.NotEligible = exports.MessageDeleteForbidden = exports.MessageAuthorRequired = exports.InlineBotRequired = exports.GroupcallForbidden = exports.GroupcallAlreadyStarted = exports.EditBotInviteForbidden = exports.ChatWriteForbidden = exports.ChatTypeInvalid = exports.ChatSendVoicesForbidden = exports.ChatSendVideosForbidden = exports.ChatSendStickersForbidden = exports.ChatSendRoundvideosForbidden = exports.ChatSendPollForbidden = exports.ChatSendPlainForbidden = exports.ChatSendPhotosForbidden = exports.ChatSendMediaForbidden = exports.ChatSendInlineForbidden = exports.ChatSendGifsForbidden = exports.ChatSendGameForbidden = exports.ChatSendDocsForbidden = exports.ChatSendAudiosForbidden = exports.ChatGuestSendForbidden = exports.ChatForbidden = exports.ChatAdminRequired = exports.ChatAdminInviteRequired = exports.ChatActionForbidden = exports.ChannelPublicGroupNa = exports.BroadcastForbidden = exports.AnonymousReactionsDisabled = exports.Forbidden = void 0;
4
+ exports.YourPrivacyRestricted = void 0;
5
+ const RpcError_js_1 = require("../RpcError.js");
6
+ class Forbidden extends RpcError_js_1.RPCError {
7
+ code = 403;
8
+ name = 'FORBIDDEN';
9
+ }
10
+ exports.Forbidden = Forbidden;
11
+ class AnonymousReactionsDisabled extends Forbidden {
12
+ id = 'ANONYMOUS_REACTIONS_DISABLED';
13
+ message = 'Sorry, anonymous administrators cannot leave reactions or participate in polls.';
14
+ }
15
+ exports.AnonymousReactionsDisabled = AnonymousReactionsDisabled;
16
+ class BroadcastForbidden extends Forbidden {
17
+ id = 'BROADCAST_FORBIDDEN';
18
+ message = 'Channel poll voters and reactions cannot be fetched to prevent deanonymization.';
19
+ }
20
+ exports.BroadcastForbidden = BroadcastForbidden;
21
+ class ChannelPublicGroupNa extends Forbidden {
22
+ id = 'CHANNEL_PUBLIC_GROUP_NA';
23
+ message = 'channel/supergroup not available.';
24
+ }
25
+ exports.ChannelPublicGroupNa = ChannelPublicGroupNa;
26
+ class ChatActionForbidden extends Forbidden {
27
+ id = 'CHAT_ACTION_FORBIDDEN';
28
+ message = 'You cannot execute this action.';
29
+ }
30
+ exports.ChatActionForbidden = ChatActionForbidden;
31
+ class ChatAdminInviteRequired extends Forbidden {
32
+ id = 'CHAT_ADMIN_INVITE_REQUIRED';
33
+ message = 'You do not have the rights to do this.';
34
+ }
35
+ exports.ChatAdminInviteRequired = ChatAdminInviteRequired;
36
+ class ChatAdminRequired extends Forbidden {
37
+ id = 'CHAT_ADMIN_REQUIRED';
38
+ message = 'You must be an admin in this chat to do this.';
39
+ }
40
+ exports.ChatAdminRequired = ChatAdminRequired;
41
+ class ChatForbidden extends Forbidden {
42
+ id = 'CHAT_FORBIDDEN';
43
+ message = 'This chat is not available to the current user.';
44
+ }
45
+ exports.ChatForbidden = ChatForbidden;
46
+ class ChatGuestSendForbidden extends Forbidden {
47
+ id = 'CHAT_GUEST_SEND_FORBIDDEN';
48
+ message = 'You join the discussion group before commenting, see [here »](https://core.telegram.org/api/discussion#requiring-users-to-join-the-group) for more info.';
49
+ }
50
+ exports.ChatGuestSendForbidden = ChatGuestSendForbidden;
51
+ class ChatSendAudiosForbidden extends Forbidden {
52
+ id = 'CHAT_SEND_AUDIOS_FORBIDDEN';
53
+ message = "You can't send audio messages in this chat.";
54
+ }
55
+ exports.ChatSendAudiosForbidden = ChatSendAudiosForbidden;
56
+ class ChatSendDocsForbidden extends Forbidden {
57
+ id = 'CHAT_SEND_DOCS_FORBIDDEN';
58
+ message = "You can't send documents in this chat.";
59
+ }
60
+ exports.ChatSendDocsForbidden = ChatSendDocsForbidden;
61
+ class ChatSendGameForbidden extends Forbidden {
62
+ id = 'CHAT_SEND_GAME_FORBIDDEN';
63
+ message = "You can't send a game to this chat.";
64
+ }
65
+ exports.ChatSendGameForbidden = ChatSendGameForbidden;
66
+ class ChatSendGifsForbidden extends Forbidden {
67
+ id = 'CHAT_SEND_GIFS_FORBIDDEN';
68
+ message = "You can't send gifs in this chat.";
69
+ }
70
+ exports.ChatSendGifsForbidden = ChatSendGifsForbidden;
71
+ class ChatSendInlineForbidden extends Forbidden {
72
+ id = 'CHAT_SEND_INLINE_FORBIDDEN';
73
+ message = "You can't send inline messages in this group.";
74
+ }
75
+ exports.ChatSendInlineForbidden = ChatSendInlineForbidden;
76
+ class ChatSendMediaForbidden extends Forbidden {
77
+ id = 'CHAT_SEND_MEDIA_FORBIDDEN';
78
+ message = "You can't send media in this chat.";
79
+ }
80
+ exports.ChatSendMediaForbidden = ChatSendMediaForbidden;
81
+ class ChatSendPhotosForbidden extends Forbidden {
82
+ id = 'CHAT_SEND_PHOTOS_FORBIDDEN';
83
+ message = "You can't send photos in this chat.";
84
+ }
85
+ exports.ChatSendPhotosForbidden = ChatSendPhotosForbidden;
86
+ class ChatSendPlainForbidden extends Forbidden {
87
+ id = 'CHAT_SEND_PLAIN_FORBIDDEN';
88
+ message = "You can't send non-media (text) messages in this chat.";
89
+ }
90
+ exports.ChatSendPlainForbidden = ChatSendPlainForbidden;
91
+ class ChatSendPollForbidden extends Forbidden {
92
+ id = 'CHAT_SEND_POLL_FORBIDDEN';
93
+ message = "You can't send polls in this chat.";
94
+ }
95
+ exports.ChatSendPollForbidden = ChatSendPollForbidden;
96
+ class ChatSendRoundvideosForbidden extends Forbidden {
97
+ id = 'CHAT_SEND_ROUNDVIDEOS_FORBIDDEN';
98
+ message = "You can't send round videos to this chat.";
99
+ }
100
+ exports.ChatSendRoundvideosForbidden = ChatSendRoundvideosForbidden;
101
+ class ChatSendStickersForbidden extends Forbidden {
102
+ id = 'CHAT_SEND_STICKERS_FORBIDDEN';
103
+ message = "You can't send stickers in this chat.";
104
+ }
105
+ exports.ChatSendStickersForbidden = ChatSendStickersForbidden;
106
+ class ChatSendVideosForbidden extends Forbidden {
107
+ id = 'CHAT_SEND_VIDEOS_FORBIDDEN';
108
+ message = "You can't send videos in this chat.";
109
+ }
110
+ exports.ChatSendVideosForbidden = ChatSendVideosForbidden;
111
+ class ChatSendVoicesForbidden extends Forbidden {
112
+ id = 'CHAT_SEND_VOICES_FORBIDDEN';
113
+ message = "You can't send voice recordings in this chat.";
114
+ }
115
+ exports.ChatSendVoicesForbidden = ChatSendVoicesForbidden;
116
+ class ChatTypeInvalid extends Forbidden {
117
+ id = 'CHAT_TYPE_INVALID';
118
+ message = 'The specified user type is invalid.';
119
+ }
120
+ exports.ChatTypeInvalid = ChatTypeInvalid;
121
+ class ChatWriteForbidden extends Forbidden {
122
+ id = 'CHAT_WRITE_FORBIDDEN';
123
+ message = "You can't write in this chat.";
124
+ }
125
+ exports.ChatWriteForbidden = ChatWriteForbidden;
126
+ class EditBotInviteForbidden extends Forbidden {
127
+ id = 'EDIT_BOT_INVITE_FORBIDDEN';
128
+ message = "Normal users can't edit invites that were created by bots.";
129
+ }
130
+ exports.EditBotInviteForbidden = EditBotInviteForbidden;
131
+ class GroupcallAlreadyStarted extends Forbidden {
132
+ id = 'GROUPCALL_ALREADY_STARTED';
133
+ message = 'The groupcall has already started, you can join directly using [phone.joinGroupCall](https://core.telegram.org/method/phone.joinGroupCall).';
134
+ }
135
+ exports.GroupcallAlreadyStarted = GroupcallAlreadyStarted;
136
+ class GroupcallForbidden extends Forbidden {
137
+ id = 'GROUPCALL_FORBIDDEN';
138
+ message = 'The group call has already ended.';
139
+ }
140
+ exports.GroupcallForbidden = GroupcallForbidden;
141
+ class InlineBotRequired extends Forbidden {
142
+ id = 'INLINE_BOT_REQUIRED';
143
+ message = 'Only the inline bot can edit message.';
144
+ }
145
+ exports.InlineBotRequired = InlineBotRequired;
146
+ class MessageAuthorRequired extends Forbidden {
147
+ id = 'MESSAGE_AUTHOR_REQUIRED';
148
+ message = 'Message author required.';
149
+ }
150
+ exports.MessageAuthorRequired = MessageAuthorRequired;
151
+ class MessageDeleteForbidden extends Forbidden {
152
+ id = 'MESSAGE_DELETE_FORBIDDEN';
153
+ message = "You can't delete one of the messages you tried to delete, most likely because it is a service message.";
154
+ }
155
+ exports.MessageDeleteForbidden = MessageDeleteForbidden;
156
+ class NotEligible extends Forbidden {
157
+ id = 'NOT_ELIGIBLE';
158
+ message = 'The current user is not eligible to join the Peer-to-Peer Login Program.';
159
+ }
160
+ exports.NotEligible = NotEligible;
161
+ class ParticipantJoinMissing extends Forbidden {
162
+ id = 'PARTICIPANT_JOIN_MISSING';
163
+ message = "Trying to enable a presentation, when the user hasn't joined the Video Chat with [phone.joinGroupCall](https://core.telegram.org/method/phone.joinGroupCall).";
164
+ }
165
+ exports.ParticipantJoinMissing = ParticipantJoinMissing;
166
+ class PeerIdInvalid extends Forbidden {
167
+ id = 'PEER_ID_INVALID';
168
+ message = 'The provided peer id is invalid.';
169
+ }
170
+ exports.PeerIdInvalid = PeerIdInvalid;
171
+ class PollVoteRequired extends Forbidden {
172
+ id = 'POLL_VOTE_REQUIRED';
173
+ message = 'Cast a vote in the poll before calling this method.';
174
+ }
175
+ exports.PollVoteRequired = PollVoteRequired;
176
+ class PremiumAccountRequired extends Forbidden {
177
+ id = 'PREMIUM_ACCOUNT_REQUIRED';
178
+ message = 'A premium account is required to execute this action.';
179
+ }
180
+ exports.PremiumAccountRequired = PremiumAccountRequired;
181
+ class PrivacyPremiumRequired extends Forbidden {
182
+ id = 'PRIVACY_PREMIUM_REQUIRED';
183
+ message = 'You need a [Telegram Premium subscription](https://core.telegram.org/api/premium) to send a message to this user.';
184
+ }
185
+ exports.PrivacyPremiumRequired = PrivacyPremiumRequired;
186
+ class PublicChannelMissing extends Forbidden {
187
+ id = 'PUBLIC_CHANNEL_MISSING';
188
+ message = 'You can only export group call invite links for public chats or channels.';
189
+ }
190
+ exports.PublicChannelMissing = PublicChannelMissing;
191
+ class RightForbidden extends Forbidden {
192
+ id = 'RIGHT_FORBIDDEN';
193
+ message = 'Your admin rights do not allow you to do this.';
194
+ }
195
+ exports.RightForbidden = RightForbidden;
196
+ class SensitiveChangeForbidden extends Forbidden {
197
+ id = 'SENSITIVE_CHANGE_FORBIDDEN';
198
+ message = "You can't change your sensitive content settings.";
199
+ }
200
+ exports.SensitiveChangeForbidden = SensitiveChangeForbidden;
201
+ class TakeoutRequired extends Forbidden {
202
+ id = 'TAKEOUT_REQUIRED';
203
+ message = 'A [takeout](https://core.telegram.org/api/takeout) session needs to be initialized first, [see here » for more info](https://core.telegram.org/api/takeout).';
204
+ }
205
+ exports.TakeoutRequired = TakeoutRequired;
206
+ class UserBotInvalid extends Forbidden {
207
+ id = 'USER_BOT_INVALID';
208
+ message = 'User accounts must provide the `bot` method parameter when calling this method. If there is no such method parameter, this method can only be invoked by bot accounts.';
209
+ }
210
+ exports.UserBotInvalid = UserBotInvalid;
211
+ class UserChannelsTooMuch extends Forbidden {
212
+ id = 'USER_CHANNELS_TOO_MUCH';
213
+ message = 'One of the users you tried to add is already in too many channels/supergroups.';
214
+ }
215
+ exports.UserChannelsTooMuch = UserChannelsTooMuch;
216
+ class UserDeleted extends Forbidden {
217
+ id = 'USER_DELETED';
218
+ message = "You can't send this secret message because the other participant deleted their account.";
219
+ }
220
+ exports.UserDeleted = UserDeleted;
221
+ class UserInvalid extends Forbidden {
222
+ id = 'USER_INVALID';
223
+ message = 'Invalid user provided.';
224
+ }
225
+ exports.UserInvalid = UserInvalid;
226
+ class UserIsBlocked extends Forbidden {
227
+ id = 'USER_IS_BLOCKED';
228
+ message = 'You were blocked by this user.';
229
+ }
230
+ exports.UserIsBlocked = UserIsBlocked;
231
+ class UserNotMutualContact extends Forbidden {
232
+ id = 'USER_NOT_MUTUAL_CONTACT';
233
+ message = 'The provided user is not a mutual contact.';
234
+ }
235
+ exports.UserNotMutualContact = UserNotMutualContact;
236
+ class UserNotParticipant extends Forbidden {
237
+ id = 'USER_NOT_PARTICIPANT';
238
+ message = "You're not a member of this supergroup/channel.";
239
+ }
240
+ exports.UserNotParticipant = UserNotParticipant;
241
+ class UserPrivacyRestricted extends Forbidden {
242
+ id = 'USER_PRIVACY_RESTRICTED';
243
+ message = "The user's privacy settings do not allow you to do this.";
244
+ }
245
+ exports.UserPrivacyRestricted = UserPrivacyRestricted;
246
+ class UserRestricted extends Forbidden {
247
+ id = 'USER_RESTRICTED';
248
+ message = "You're spamreported, you can't create channels or chats.";
249
+ }
250
+ exports.UserRestricted = UserRestricted;
251
+ class VoiceMessagesForbidden extends Forbidden {
252
+ id = 'VOICE_MESSAGES_FORBIDDEN';
253
+ message = "This user's privacy settings forbid you from sending voice messages.";
254
+ }
255
+ exports.VoiceMessagesForbidden = VoiceMessagesForbidden;
256
+ class YourPrivacyRestricted extends Forbidden {
257
+ id = 'YOUR_PRIVACY_RESTRICTED';
258
+ message = 'You cannot fetch the read date of this message because you have disallowed other users to do so for *your* messages; to fix, allow other users to see *your* exact last online date OR purchase a [Telegram Premium](https://core.telegram.org/api/premium) subscription.';
259
+ }
260
+ exports.YourPrivacyRestricted = YourPrivacyRestricted;