@tgsnake/skema 3.1.0 → 3.2.1-browser.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 (74) hide show
  1. package/README.md +1 -1
  2. package/dist/src/deps.d.ts +4 -3
  3. package/dist/src/deps.js +4 -4
  4. package/dist/src/errors/RpcError.js +3 -1
  5. package/dist/src/helpers.js +19 -34
  6. package/dist/src/raw/class/All.d.ts +49 -5
  7. package/dist/src/raw/class/All.js +2783 -2739
  8. package/dist/src/raw/class/Raw.d.ts +7856 -7518
  9. package/dist/src/raw/class/Raw.js +27367 -20433
  10. package/dist/src/raw/class/tl/account.d.ts +841 -841
  11. package/dist/src/raw/class/tl/account.js +1983 -1813
  12. package/dist/src/raw/class/tl/aicompose.d.ts +51 -51
  13. package/dist/src/raw/class/tl/aicompose.js +128 -117
  14. package/dist/src/raw/class/tl/auth.d.ts +296 -296
  15. package/dist/src/raw/class/tl/auth.js +849 -714
  16. package/dist/src/raw/class/tl/bots.d.ts +353 -232
  17. package/dist/src/raw/class/tl/bots.js +871 -504
  18. package/dist/src/raw/class/tl/channels.d.ts +351 -331
  19. package/dist/src/raw/class/tl/channels.js +873 -735
  20. package/dist/src/raw/class/tl/chatlists.d.ts +81 -81
  21. package/dist/src/raw/class/tl/chatlists.js +196 -183
  22. package/dist/src/raw/class/tl/communities.d.ts +56 -56
  23. package/dist/src/raw/class/tl/communities.js +159 -138
  24. package/dist/src/raw/class/tl/contacts.d.ts +216 -216
  25. package/dist/src/raw/class/tl/contacts.js +537 -492
  26. package/dist/src/raw/class/tl/ephemeral.d.ts +51 -51
  27. package/dist/src/raw/class/tl/ephemeral.js +204 -152
  28. package/dist/src/raw/class/tl/feed.d.ts +278 -0
  29. package/dist/src/raw/class/tl/feed.js +671 -0
  30. package/dist/src/raw/class/tl/folders.d.ts +6 -6
  31. package/dist/src/raw/class/tl/folders.js +11 -11
  32. package/dist/src/raw/class/tl/fragment.d.ts +11 -11
  33. package/dist/src/raw/class/tl/fragment.js +32 -25
  34. package/dist/src/raw/class/tl/help.d.ts +286 -286
  35. package/dist/src/raw/class/tl/help.js +686 -618
  36. package/dist/src/raw/class/tl/langpack.d.ts +26 -26
  37. package/dist/src/raw/class/tl/langpack.js +57 -57
  38. package/dist/src/raw/class/tl/messages.d.ts +1901 -1851
  39. package/dist/src/raw/class/tl/messages.js +6043 -4855
  40. package/dist/src/raw/class/tl/payments.d.ts +677 -641
  41. package/dist/src/raw/class/tl/payments.js +2312 -1734
  42. package/dist/src/raw/class/tl/phone.d.ts +256 -256
  43. package/dist/src/raw/class/tl/phone.js +779 -644
  44. package/dist/src/raw/class/tl/photos.d.ts +41 -41
  45. package/dist/src/raw/class/tl/photos.js +139 -116
  46. package/dist/src/raw/class/tl/premium.d.ts +41 -41
  47. package/dist/src/raw/class/tl/premium.js +133 -111
  48. package/dist/src/raw/class/tl/smsjobs.d.ts +46 -46
  49. package/dist/src/raw/class/tl/smsjobs.js +115 -97
  50. package/dist/src/raw/class/tl/stats.d.ts +71 -71
  51. package/dist/src/raw/class/tl/stats.js +268 -169
  52. package/dist/src/raw/class/tl/stickers.d.ts +61 -61
  53. package/dist/src/raw/class/tl/stickers.js +173 -144
  54. package/dist/src/raw/class/tl/storage.d.ts +51 -51
  55. package/dist/src/raw/class/tl/storage.js +71 -71
  56. package/dist/src/raw/class/tl/stories.d.ts +221 -221
  57. package/dist/src/raw/class/tl/stories.js +781 -622
  58. package/dist/src/raw/class/tl/toncenter.d.ts +21 -21
  59. package/dist/src/raw/class/tl/toncenter.js +52 -47
  60. package/dist/src/raw/class/tl/updates.d.ts +56 -56
  61. package/dist/src/raw/class/tl/updates.js +246 -175
  62. package/dist/src/raw/class/tl/upload.d.ts +66 -66
  63. package/dist/src/raw/class/tl/upload.js +178 -155
  64. package/dist/src/raw/class/tl/users.d.ts +61 -61
  65. package/dist/src/raw/class/tl/users.js +124 -124
  66. package/dist/src/raw/class/tl/wallet.d.ts +257 -206
  67. package/dist/src/raw/class/tl/wallet.js +701 -525
  68. package/dist/src/raw/class/types.d.ts +3 -2
  69. package/dist/src/raw/class/types.js +1 -1
  70. package/dist/src/raw/core/GzipPacked.d.ts +4 -0
  71. package/dist/src/raw/core/GzipPacked.js +9 -1
  72. package/dist/src/raw/core/primitive/Bytes.js +26 -4
  73. package/dist/src/raw/core/primitive/Vector.js +11 -3
  74. package/package.json +7 -5
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * tgsnake is a free software: you can redistribute it and/or modify
8
8
  * it under the terms of the MIT License as published.
9
- */
9
+ */
10
10
  // This file is auto generate. All change made in this file will be lost!
11
11
  import { TLObject, Primitive } from '../../core/index.js';
12
12
  import { BytesIO } from '../../../deps.js';
@@ -18,11 +18,11 @@ export class State extends TLObject {
18
18
  unreadCount;
19
19
  constructor(params) {
20
20
  super();
21
- this.classType = "types";
22
- this.className = "updates.State";
21
+ this.classType = 'types';
22
+ this.className = 'updates.State';
23
23
  this.constructorId = 0xa56c2a3e;
24
24
  this.subclassOfId = 0x23df1a01;
25
- this._slots = ["pts", "qts", "date", "seq", "unreadCount"];
25
+ this._slots = ['pts', 'qts', 'date', 'seq', 'unreadCount'];
26
26
  this.pts = params.pts;
27
27
  this.qts = params.qts;
28
28
  this.date = params.date;
@@ -30,9 +30,9 @@ export class State extends TLObject {
30
30
  this.unreadCount = params.unreadCount;
31
31
  }
32
32
  /**
33
- * Generate the TLObject from buffer.
34
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
35
- */
33
+ * Generate the TLObject from buffer.
34
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
35
+ */
36
36
  static async read(_data, ..._args) {
37
37
  // no flags
38
38
  let pts = await Primitive.Int.read(_data);
@@ -40,29 +40,29 @@ export class State extends TLObject {
40
40
  let date = await Primitive.Int.read(_data);
41
41
  let seq = await Primitive.Int.read(_data);
42
42
  let unreadCount = await Primitive.Int.read(_data);
43
- return new State({ "pts": pts, "qts": qts, "date": date, "seq": seq, "unreadCount": unreadCount });
43
+ return new State({ pts: pts, qts: qts, date: date, seq: seq, unreadCount: unreadCount });
44
44
  }
45
45
  /**
46
- * Generate buffer from TLObject.
47
- */
46
+ * Generate buffer from TLObject.
47
+ */
48
48
  write() {
49
49
  const b = new BytesIO();
50
50
  b.write(Primitive.Int.write(this.constructorId, false));
51
51
  // no flags
52
52
  if (this.pts !== undefined) {
53
- b.write((Primitive.Int.write(this.pts)));
53
+ b.write(Primitive.Int.write(this.pts));
54
54
  }
55
55
  if (this.qts !== undefined) {
56
- b.write((Primitive.Int.write(this.qts)));
56
+ b.write(Primitive.Int.write(this.qts));
57
57
  }
58
58
  if (this.date !== undefined) {
59
- b.write((Primitive.Int.write(this.date)));
59
+ b.write(Primitive.Int.write(this.date));
60
60
  }
61
61
  if (this.seq !== undefined) {
62
- b.write((Primitive.Int.write(this.seq)));
62
+ b.write(Primitive.Int.write(this.seq));
63
63
  }
64
64
  if (this.unreadCount !== undefined) {
65
- b.write((Primitive.Int.write(this.unreadCount)));
65
+ b.write(Primitive.Int.write(this.unreadCount));
66
66
  }
67
67
  return b.buffer;
68
68
  }
@@ -72,36 +72,36 @@ export class DifferenceEmpty extends TLObject {
72
72
  seq;
73
73
  constructor(params) {
74
74
  super();
75
- this.classType = "types";
76
- this.className = "updates.DifferenceEmpty";
75
+ this.classType = 'types';
76
+ this.className = 'updates.DifferenceEmpty';
77
77
  this.constructorId = 0x5d75a138;
78
78
  this.subclassOfId = 0x20482874;
79
- this._slots = ["date", "seq"];
79
+ this._slots = ['date', 'seq'];
80
80
  this.date = params.date;
81
81
  this.seq = params.seq;
82
82
  }
83
83
  /**
84
- * Generate the TLObject from buffer.
85
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
86
- */
84
+ * Generate the TLObject from buffer.
85
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
86
+ */
87
87
  static async read(_data, ..._args) {
88
88
  // no flags
89
89
  let date = await Primitive.Int.read(_data);
90
90
  let seq = await Primitive.Int.read(_data);
91
- return new DifferenceEmpty({ "date": date, "seq": seq });
91
+ return new DifferenceEmpty({ date: date, seq: seq });
92
92
  }
93
93
  /**
94
- * Generate buffer from TLObject.
95
- */
94
+ * Generate buffer from TLObject.
95
+ */
96
96
  write() {
97
97
  const b = new BytesIO();
98
98
  b.write(Primitive.Int.write(this.constructorId, false));
99
99
  // no flags
100
100
  if (this.date !== undefined) {
101
- b.write((Primitive.Int.write(this.date)));
101
+ b.write(Primitive.Int.write(this.date));
102
102
  }
103
103
  if (this.seq !== undefined) {
104
- b.write((Primitive.Int.write(this.seq)));
104
+ b.write(Primitive.Int.write(this.seq));
105
105
  }
106
106
  return b.buffer;
107
107
  }
@@ -116,11 +116,19 @@ export class Difference extends TLObject {
116
116
  state;
117
117
  constructor(params) {
118
118
  super();
119
- this.classType = "types";
120
- this.className = "updates.Difference";
119
+ this.classType = 'types';
120
+ this.className = 'updates.Difference';
121
121
  this.constructorId = 0xb78fca40;
122
122
  this.subclassOfId = 0x20482874;
123
- this._slots = ["topics", "newMessages", "newEncryptedMessages", "otherUpdates", "chats", "users", "state"];
123
+ this._slots = [
124
+ 'topics',
125
+ 'newMessages',
126
+ 'newEncryptedMessages',
127
+ 'otherUpdates',
128
+ 'chats',
129
+ 'users',
130
+ 'state',
131
+ ];
124
132
  this.topics = params.topics;
125
133
  this.newMessages = params.newMessages;
126
134
  this.newEncryptedMessages = params.newEncryptedMessages;
@@ -130,48 +138,56 @@ export class Difference extends TLObject {
130
138
  this.state = params.state;
131
139
  }
132
140
  /**
133
- * Generate the TLObject from buffer.
134
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
135
- */
141
+ * Generate the TLObject from buffer.
142
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
143
+ */
136
144
  static async read(_data, ..._args) {
137
145
  // @ts-ignore
138
146
  let flags = await Primitive.Int.read(_data);
139
- let topics = (flags & (1 << 0)) ? await TLObject.read(_data) : [];
147
+ let topics = flags & (1 << 0) ? await TLObject.read(_data) : [];
140
148
  let newMessages = await TLObject.read(_data);
141
149
  let newEncryptedMessages = await TLObject.read(_data);
142
150
  let otherUpdates = await TLObject.read(_data);
143
151
  let chats = await TLObject.read(_data);
144
152
  let users = await TLObject.read(_data);
145
153
  let state = await TLObject.read(_data);
146
- return new Difference({ "topics": topics, "newMessages": newMessages, "newEncryptedMessages": newEncryptedMessages, "otherUpdates": otherUpdates, "chats": chats, "users": users, "state": state });
154
+ return new Difference({
155
+ topics: topics,
156
+ newMessages: newMessages,
157
+ newEncryptedMessages: newEncryptedMessages,
158
+ otherUpdates: otherUpdates,
159
+ chats: chats,
160
+ users: users,
161
+ state: state,
162
+ });
147
163
  }
148
164
  /**
149
- * Generate buffer from TLObject.
150
- */
165
+ * Generate buffer from TLObject.
166
+ */
151
167
  write() {
152
168
  const b = new BytesIO();
153
169
  b.write(Primitive.Int.write(this.constructorId, false));
154
170
  // @ts-ignore
155
171
  let flags = 0;
156
- flags |= this.topics ? (1 << 0) : 0;
157
- b.write((Primitive.Int.write(flags)));
172
+ flags |= this.topics ? 1 << 0 : 0;
173
+ b.write(Primitive.Int.write(flags));
158
174
  if (this.topics) {
159
- b.write((Primitive.Vector.write(this.topics)));
175
+ b.write(Primitive.Vector.write(this.topics));
160
176
  }
161
177
  if (this.newMessages) {
162
- b.write((Primitive.Vector.write(this.newMessages)));
178
+ b.write(Primitive.Vector.write(this.newMessages));
163
179
  }
164
180
  if (this.newEncryptedMessages) {
165
- b.write((Primitive.Vector.write(this.newEncryptedMessages)));
181
+ b.write(Primitive.Vector.write(this.newEncryptedMessages));
166
182
  }
167
183
  if (this.otherUpdates) {
168
- b.write((Primitive.Vector.write(this.otherUpdates)));
184
+ b.write(Primitive.Vector.write(this.otherUpdates));
169
185
  }
170
186
  if (this.chats) {
171
- b.write((Primitive.Vector.write(this.chats)));
187
+ b.write(Primitive.Vector.write(this.chats));
172
188
  }
173
189
  if (this.users) {
174
- b.write((Primitive.Vector.write(this.users)));
190
+ b.write(Primitive.Vector.write(this.users));
175
191
  }
176
192
  if (this.state !== undefined) {
177
193
  b.write(this.state.write());
@@ -189,11 +205,19 @@ export class DifferenceSlice extends TLObject {
189
205
  intermediateState;
190
206
  constructor(params) {
191
207
  super();
192
- this.classType = "types";
193
- this.className = "updates.DifferenceSlice";
208
+ this.classType = 'types';
209
+ this.className = 'updates.DifferenceSlice';
194
210
  this.constructorId = 0x7c52f53;
195
211
  this.subclassOfId = 0x20482874;
196
- this._slots = ["topics", "newMessages", "newEncryptedMessages", "otherUpdates", "chats", "users", "intermediateState"];
212
+ this._slots = [
213
+ 'topics',
214
+ 'newMessages',
215
+ 'newEncryptedMessages',
216
+ 'otherUpdates',
217
+ 'chats',
218
+ 'users',
219
+ 'intermediateState',
220
+ ];
197
221
  this.topics = params.topics;
198
222
  this.newMessages = params.newMessages;
199
223
  this.newEncryptedMessages = params.newEncryptedMessages;
@@ -203,48 +227,56 @@ export class DifferenceSlice extends TLObject {
203
227
  this.intermediateState = params.intermediateState;
204
228
  }
205
229
  /**
206
- * Generate the TLObject from buffer.
207
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
208
- */
230
+ * Generate the TLObject from buffer.
231
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
232
+ */
209
233
  static async read(_data, ..._args) {
210
234
  // @ts-ignore
211
235
  let flags = await Primitive.Int.read(_data);
212
- let topics = (flags & (1 << 0)) ? await TLObject.read(_data) : [];
236
+ let topics = flags & (1 << 0) ? await TLObject.read(_data) : [];
213
237
  let newMessages = await TLObject.read(_data);
214
238
  let newEncryptedMessages = await TLObject.read(_data);
215
239
  let otherUpdates = await TLObject.read(_data);
216
240
  let chats = await TLObject.read(_data);
217
241
  let users = await TLObject.read(_data);
218
242
  let intermediateState = await TLObject.read(_data);
219
- return new DifferenceSlice({ "topics": topics, "newMessages": newMessages, "newEncryptedMessages": newEncryptedMessages, "otherUpdates": otherUpdates, "chats": chats, "users": users, "intermediateState": intermediateState });
243
+ return new DifferenceSlice({
244
+ topics: topics,
245
+ newMessages: newMessages,
246
+ newEncryptedMessages: newEncryptedMessages,
247
+ otherUpdates: otherUpdates,
248
+ chats: chats,
249
+ users: users,
250
+ intermediateState: intermediateState,
251
+ });
220
252
  }
221
253
  /**
222
- * Generate buffer from TLObject.
223
- */
254
+ * Generate buffer from TLObject.
255
+ */
224
256
  write() {
225
257
  const b = new BytesIO();
226
258
  b.write(Primitive.Int.write(this.constructorId, false));
227
259
  // @ts-ignore
228
260
  let flags = 0;
229
- flags |= this.topics ? (1 << 0) : 0;
230
- b.write((Primitive.Int.write(flags)));
261
+ flags |= this.topics ? 1 << 0 : 0;
262
+ b.write(Primitive.Int.write(flags));
231
263
  if (this.topics) {
232
- b.write((Primitive.Vector.write(this.topics)));
264
+ b.write(Primitive.Vector.write(this.topics));
233
265
  }
234
266
  if (this.newMessages) {
235
- b.write((Primitive.Vector.write(this.newMessages)));
267
+ b.write(Primitive.Vector.write(this.newMessages));
236
268
  }
237
269
  if (this.newEncryptedMessages) {
238
- b.write((Primitive.Vector.write(this.newEncryptedMessages)));
270
+ b.write(Primitive.Vector.write(this.newEncryptedMessages));
239
271
  }
240
272
  if (this.otherUpdates) {
241
- b.write((Primitive.Vector.write(this.otherUpdates)));
273
+ b.write(Primitive.Vector.write(this.otherUpdates));
242
274
  }
243
275
  if (this.chats) {
244
- b.write((Primitive.Vector.write(this.chats)));
276
+ b.write(Primitive.Vector.write(this.chats));
245
277
  }
246
278
  if (this.users) {
247
- b.write((Primitive.Vector.write(this.users)));
279
+ b.write(Primitive.Vector.write(this.users));
248
280
  }
249
281
  if (this.intermediateState !== undefined) {
250
282
  b.write(this.intermediateState.write());
@@ -256,31 +288,31 @@ export class DifferenceTooLong extends TLObject {
256
288
  pts;
257
289
  constructor(params) {
258
290
  super();
259
- this.classType = "types";
260
- this.className = "updates.DifferenceTooLong";
291
+ this.classType = 'types';
292
+ this.className = 'updates.DifferenceTooLong';
261
293
  this.constructorId = 0x4afe8f6d;
262
294
  this.subclassOfId = 0x20482874;
263
- this._slots = ["pts"];
295
+ this._slots = ['pts'];
264
296
  this.pts = params.pts;
265
297
  }
266
298
  /**
267
- * Generate the TLObject from buffer.
268
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
269
- */
299
+ * Generate the TLObject from buffer.
300
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
301
+ */
270
302
  static async read(_data, ..._args) {
271
303
  // no flags
272
304
  let pts = await Primitive.Int.read(_data);
273
- return new DifferenceTooLong({ "pts": pts });
305
+ return new DifferenceTooLong({ pts: pts });
274
306
  }
275
307
  /**
276
- * Generate buffer from TLObject.
277
- */
308
+ * Generate buffer from TLObject.
309
+ */
278
310
  write() {
279
311
  const b = new BytesIO();
280
312
  b.write(Primitive.Int.write(this.constructorId, false));
281
313
  // no flags
282
314
  if (this.pts !== undefined) {
283
- b.write((Primitive.Int.write(this.pts)));
315
+ b.write(Primitive.Int.write(this.pts));
284
316
  }
285
317
  return b.buffer;
286
318
  }
@@ -291,43 +323,43 @@ export class ChannelDifferenceEmpty extends TLObject {
291
323
  timeout;
292
324
  constructor(params) {
293
325
  super();
294
- this.classType = "types";
295
- this.className = "updates.ChannelDifferenceEmpty";
326
+ this.classType = 'types';
327
+ this.className = 'updates.ChannelDifferenceEmpty';
296
328
  this.constructorId = 0x3e11affb;
297
329
  this.subclassOfId = 0x29896f5d;
298
- this._slots = ["final", "pts", "timeout"];
330
+ this._slots = ['final', 'pts', 'timeout'];
299
331
  this.final = params.final;
300
332
  this.pts = params.pts;
301
333
  this.timeout = params.timeout;
302
334
  }
303
335
  /**
304
- * Generate the TLObject from buffer.
305
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
306
- */
336
+ * Generate the TLObject from buffer.
337
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
338
+ */
307
339
  static async read(_data, ..._args) {
308
340
  // @ts-ignore
309
341
  let flags = await Primitive.Int.read(_data);
310
- let final = (flags & (1 << 0)) ? true : false;
342
+ let final = flags & (1 << 0) ? true : false;
311
343
  let pts = await Primitive.Int.read(_data);
312
- let timeout = (flags & (1 << 1)) ? await Primitive.Int.read(_data) : undefined;
313
- return new ChannelDifferenceEmpty({ "final": final, "pts": pts, "timeout": timeout });
344
+ let timeout = flags & (1 << 1) ? await Primitive.Int.read(_data) : undefined;
345
+ return new ChannelDifferenceEmpty({ final: final, pts: pts, timeout: timeout });
314
346
  }
315
347
  /**
316
- * Generate buffer from TLObject.
317
- */
348
+ * Generate buffer from TLObject.
349
+ */
318
350
  write() {
319
351
  const b = new BytesIO();
320
352
  b.write(Primitive.Int.write(this.constructorId, false));
321
353
  // @ts-ignore
322
354
  let flags = 0;
323
- flags |= this.final ? (1 << 0) : 0;
324
- flags |= this.timeout !== undefined ? (1 << 1) : 0;
325
- b.write((Primitive.Int.write(flags)));
355
+ flags |= this.final ? 1 << 0 : 0;
356
+ flags |= this.timeout !== undefined ? 1 << 1 : 0;
357
+ b.write(Primitive.Int.write(flags));
326
358
  if (this.pts !== undefined) {
327
- b.write((Primitive.Int.write(this.pts)));
359
+ b.write(Primitive.Int.write(this.pts));
328
360
  }
329
361
  if (this.timeout !== undefined) {
330
- b.write((Primitive.Int.write(this.timeout)));
362
+ b.write(Primitive.Int.write(this.timeout));
331
363
  }
332
364
  return b.buffer;
333
365
  }
@@ -342,11 +374,11 @@ export class ChannelDifferenceTooLong extends TLObject {
342
374
  users;
343
375
  constructor(params) {
344
376
  super();
345
- this.classType = "types";
346
- this.className = "updates.ChannelDifferenceTooLong";
377
+ this.classType = 'types';
378
+ this.className = 'updates.ChannelDifferenceTooLong';
347
379
  this.constructorId = 0x15b37781;
348
380
  this.subclassOfId = 0x29896f5d;
349
- this._slots = ["final", "timeout", "topics", "dialog", "messages", "chats", "users"];
381
+ this._slots = ['final', 'timeout', 'topics', 'dialog', 'messages', 'chats', 'users'];
350
382
  this.final = params.final;
351
383
  this.timeout = params.timeout;
352
384
  this.topics = params.topics;
@@ -356,50 +388,58 @@ export class ChannelDifferenceTooLong extends TLObject {
356
388
  this.users = params.users;
357
389
  }
358
390
  /**
359
- * Generate the TLObject from buffer.
360
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
361
- */
391
+ * Generate the TLObject from buffer.
392
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
393
+ */
362
394
  static async read(_data, ..._args) {
363
395
  // @ts-ignore
364
396
  let flags = await Primitive.Int.read(_data);
365
- let final = (flags & (1 << 0)) ? true : false;
366
- let timeout = (flags & (1 << 1)) ? await Primitive.Int.read(_data) : undefined;
367
- let topics = (flags & (1 << 2)) ? await TLObject.read(_data) : [];
397
+ let final = flags & (1 << 0) ? true : false;
398
+ let timeout = flags & (1 << 1) ? await Primitive.Int.read(_data) : undefined;
399
+ let topics = flags & (1 << 2) ? await TLObject.read(_data) : [];
368
400
  let dialog = await TLObject.read(_data);
369
401
  let messages = await TLObject.read(_data);
370
402
  let chats = await TLObject.read(_data);
371
403
  let users = await TLObject.read(_data);
372
- return new ChannelDifferenceTooLong({ "final": final, "timeout": timeout, "topics": topics, "dialog": dialog, "messages": messages, "chats": chats, "users": users });
404
+ return new ChannelDifferenceTooLong({
405
+ final: final,
406
+ timeout: timeout,
407
+ topics: topics,
408
+ dialog: dialog,
409
+ messages: messages,
410
+ chats: chats,
411
+ users: users,
412
+ });
373
413
  }
374
414
  /**
375
- * Generate buffer from TLObject.
376
- */
415
+ * Generate buffer from TLObject.
416
+ */
377
417
  write() {
378
418
  const b = new BytesIO();
379
419
  b.write(Primitive.Int.write(this.constructorId, false));
380
420
  // @ts-ignore
381
421
  let flags = 0;
382
- flags |= this.final ? (1 << 0) : 0;
383
- flags |= this.timeout !== undefined ? (1 << 1) : 0;
384
- flags |= this.topics ? (1 << 2) : 0;
385
- b.write((Primitive.Int.write(flags)));
422
+ flags |= this.final ? 1 << 0 : 0;
423
+ flags |= this.timeout !== undefined ? 1 << 1 : 0;
424
+ flags |= this.topics ? 1 << 2 : 0;
425
+ b.write(Primitive.Int.write(flags));
386
426
  if (this.timeout !== undefined) {
387
- b.write((Primitive.Int.write(this.timeout)));
427
+ b.write(Primitive.Int.write(this.timeout));
388
428
  }
389
429
  if (this.topics) {
390
- b.write((Primitive.Vector.write(this.topics)));
430
+ b.write(Primitive.Vector.write(this.topics));
391
431
  }
392
432
  if (this.dialog !== undefined) {
393
433
  b.write(this.dialog.write());
394
434
  }
395
435
  if (this.messages) {
396
- b.write((Primitive.Vector.write(this.messages)));
436
+ b.write(Primitive.Vector.write(this.messages));
397
437
  }
398
438
  if (this.chats) {
399
- b.write((Primitive.Vector.write(this.chats)));
439
+ b.write(Primitive.Vector.write(this.chats));
400
440
  }
401
441
  if (this.users) {
402
- b.write((Primitive.Vector.write(this.users)));
442
+ b.write(Primitive.Vector.write(this.users));
403
443
  }
404
444
  return b.buffer;
405
445
  }
@@ -415,11 +455,20 @@ export class ChannelDifference extends TLObject {
415
455
  users;
416
456
  constructor(params) {
417
457
  super();
418
- this.classType = "types";
419
- this.className = "updates.ChannelDifference";
458
+ this.classType = 'types';
459
+ this.className = 'updates.ChannelDifference';
420
460
  this.constructorId = 0xd29de13d;
421
461
  this.subclassOfId = 0x29896f5d;
422
- this._slots = ["final", "pts", "timeout", "topics", "newMessages", "otherUpdates", "chats", "users"];
462
+ this._slots = [
463
+ 'final',
464
+ 'pts',
465
+ 'timeout',
466
+ 'topics',
467
+ 'newMessages',
468
+ 'otherUpdates',
469
+ 'chats',
470
+ 'users',
471
+ ];
423
472
  this.final = params.final;
424
473
  this.pts = params.pts;
425
474
  this.timeout = params.timeout;
@@ -430,54 +479,63 @@ export class ChannelDifference extends TLObject {
430
479
  this.users = params.users;
431
480
  }
432
481
  /**
433
- * Generate the TLObject from buffer.
434
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
435
- */
482
+ * Generate the TLObject from buffer.
483
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
484
+ */
436
485
  static async read(_data, ..._args) {
437
486
  // @ts-ignore
438
487
  let flags = await Primitive.Int.read(_data);
439
- let final = (flags & (1 << 0)) ? true : false;
488
+ let final = flags & (1 << 0) ? true : false;
440
489
  let pts = await Primitive.Int.read(_data);
441
- let timeout = (flags & (1 << 1)) ? await Primitive.Int.read(_data) : undefined;
442
- let topics = (flags & (1 << 2)) ? await TLObject.read(_data) : [];
490
+ let timeout = flags & (1 << 1) ? await Primitive.Int.read(_data) : undefined;
491
+ let topics = flags & (1 << 2) ? await TLObject.read(_data) : [];
443
492
  let newMessages = await TLObject.read(_data);
444
493
  let otherUpdates = await TLObject.read(_data);
445
494
  let chats = await TLObject.read(_data);
446
495
  let users = await TLObject.read(_data);
447
- return new ChannelDifference({ "final": final, "pts": pts, "timeout": timeout, "topics": topics, "newMessages": newMessages, "otherUpdates": otherUpdates, "chats": chats, "users": users });
496
+ return new ChannelDifference({
497
+ final: final,
498
+ pts: pts,
499
+ timeout: timeout,
500
+ topics: topics,
501
+ newMessages: newMessages,
502
+ otherUpdates: otherUpdates,
503
+ chats: chats,
504
+ users: users,
505
+ });
448
506
  }
449
507
  /**
450
- * Generate buffer from TLObject.
451
- */
508
+ * Generate buffer from TLObject.
509
+ */
452
510
  write() {
453
511
  const b = new BytesIO();
454
512
  b.write(Primitive.Int.write(this.constructorId, false));
455
513
  // @ts-ignore
456
514
  let flags = 0;
457
- flags |= this.final ? (1 << 0) : 0;
458
- flags |= this.timeout !== undefined ? (1 << 1) : 0;
459
- flags |= this.topics ? (1 << 2) : 0;
460
- b.write((Primitive.Int.write(flags)));
515
+ flags |= this.final ? 1 << 0 : 0;
516
+ flags |= this.timeout !== undefined ? 1 << 1 : 0;
517
+ flags |= this.topics ? 1 << 2 : 0;
518
+ b.write(Primitive.Int.write(flags));
461
519
  if (this.pts !== undefined) {
462
- b.write((Primitive.Int.write(this.pts)));
520
+ b.write(Primitive.Int.write(this.pts));
463
521
  }
464
522
  if (this.timeout !== undefined) {
465
- b.write((Primitive.Int.write(this.timeout)));
523
+ b.write(Primitive.Int.write(this.timeout));
466
524
  }
467
525
  if (this.topics) {
468
- b.write((Primitive.Vector.write(this.topics)));
526
+ b.write(Primitive.Vector.write(this.topics));
469
527
  }
470
528
  if (this.newMessages) {
471
- b.write((Primitive.Vector.write(this.newMessages)));
529
+ b.write(Primitive.Vector.write(this.newMessages));
472
530
  }
473
531
  if (this.otherUpdates) {
474
- b.write((Primitive.Vector.write(this.otherUpdates)));
532
+ b.write(Primitive.Vector.write(this.otherUpdates));
475
533
  }
476
534
  if (this.chats) {
477
- b.write((Primitive.Vector.write(this.chats)));
535
+ b.write(Primitive.Vector.write(this.chats));
478
536
  }
479
537
  if (this.users) {
480
- b.write((Primitive.Vector.write(this.users)));
538
+ b.write(Primitive.Vector.write(this.users));
481
539
  }
482
540
  return b.buffer;
483
541
  }
@@ -486,23 +544,23 @@ export class GetState extends TLObject {
486
544
  __response__;
487
545
  constructor() {
488
546
  super();
489
- this.classType = "functions";
490
- this.className = "updates.GetState";
547
+ this.classType = 'functions';
548
+ this.className = 'updates.GetState';
491
549
  this.constructorId = 0xedd4882a;
492
550
  this.subclassOfId = 0x23df1a01;
493
551
  this._slots = [];
494
552
  }
495
553
  /**
496
- * Generate the TLObject from buffer.
497
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
498
- */
554
+ * Generate the TLObject from buffer.
555
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
556
+ */
499
557
  static async read(_data, ..._args) {
500
558
  // no flags
501
559
  return new GetState();
502
560
  }
503
561
  /**
504
- * Generate buffer from TLObject.
505
- */
562
+ * Generate buffer from TLObject.
563
+ */
506
564
  write() {
507
565
  const b = new BytesIO();
508
566
  b.write(Primitive.Int.write(this.constructorId, false));
@@ -520,11 +578,11 @@ export class GetDifference extends TLObject {
520
578
  qtsLimit;
521
579
  constructor(params) {
522
580
  super();
523
- this.classType = "functions";
524
- this.className = "updates.GetDifference";
581
+ this.classType = 'functions';
582
+ this.className = 'updates.GetDifference';
525
583
  this.constructorId = 0x19c2f763;
526
584
  this.subclassOfId = 0x20482874;
527
- this._slots = ["pts", "ptsLimit", "ptsTotalLimit", "date", "qts", "qtsLimit"];
585
+ this._slots = ['pts', 'ptsLimit', 'ptsTotalLimit', 'date', 'qts', 'qtsLimit'];
528
586
  this.pts = params.pts;
529
587
  this.ptsLimit = params.ptsLimit;
530
588
  this.ptsTotalLimit = params.ptsTotalLimit;
@@ -533,49 +591,56 @@ export class GetDifference extends TLObject {
533
591
  this.qtsLimit = params.qtsLimit;
534
592
  }
535
593
  /**
536
- * Generate the TLObject from buffer.
537
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
538
- */
594
+ * Generate the TLObject from buffer.
595
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
596
+ */
539
597
  static async read(_data, ..._args) {
540
598
  // @ts-ignore
541
599
  let flags = await Primitive.Int.read(_data);
542
600
  let pts = await Primitive.Int.read(_data);
543
- let ptsLimit = (flags & (1 << 1)) ? await Primitive.Int.read(_data) : undefined;
544
- let ptsTotalLimit = (flags & (1 << 0)) ? await Primitive.Int.read(_data) : undefined;
601
+ let ptsLimit = flags & (1 << 1) ? await Primitive.Int.read(_data) : undefined;
602
+ let ptsTotalLimit = flags & (1 << 0) ? await Primitive.Int.read(_data) : undefined;
545
603
  let date = await Primitive.Int.read(_data);
546
604
  let qts = await Primitive.Int.read(_data);
547
- let qtsLimit = (flags & (1 << 2)) ? await Primitive.Int.read(_data) : undefined;
548
- return new GetDifference({ "pts": pts, "ptsLimit": ptsLimit, "ptsTotalLimit": ptsTotalLimit, "date": date, "qts": qts, "qtsLimit": qtsLimit });
605
+ let qtsLimit = flags & (1 << 2) ? await Primitive.Int.read(_data) : undefined;
606
+ return new GetDifference({
607
+ pts: pts,
608
+ ptsLimit: ptsLimit,
609
+ ptsTotalLimit: ptsTotalLimit,
610
+ date: date,
611
+ qts: qts,
612
+ qtsLimit: qtsLimit,
613
+ });
549
614
  }
550
615
  /**
551
- * Generate buffer from TLObject.
552
- */
616
+ * Generate buffer from TLObject.
617
+ */
553
618
  write() {
554
619
  const b = new BytesIO();
555
620
  b.write(Primitive.Int.write(this.constructorId, false));
556
621
  // @ts-ignore
557
622
  let flags = 0;
558
- flags |= this.ptsLimit !== undefined ? (1 << 1) : 0;
559
- flags |= this.ptsTotalLimit !== undefined ? (1 << 0) : 0;
560
- flags |= this.qtsLimit !== undefined ? (1 << 2) : 0;
561
- b.write((Primitive.Int.write(flags)));
623
+ flags |= this.ptsLimit !== undefined ? 1 << 1 : 0;
624
+ flags |= this.ptsTotalLimit !== undefined ? 1 << 0 : 0;
625
+ flags |= this.qtsLimit !== undefined ? 1 << 2 : 0;
626
+ b.write(Primitive.Int.write(flags));
562
627
  if (this.pts !== undefined) {
563
- b.write((Primitive.Int.write(this.pts)));
628
+ b.write(Primitive.Int.write(this.pts));
564
629
  }
565
630
  if (this.ptsLimit !== undefined) {
566
- b.write((Primitive.Int.write(this.ptsLimit)));
631
+ b.write(Primitive.Int.write(this.ptsLimit));
567
632
  }
568
633
  if (this.ptsTotalLimit !== undefined) {
569
- b.write((Primitive.Int.write(this.ptsTotalLimit)));
634
+ b.write(Primitive.Int.write(this.ptsTotalLimit));
570
635
  }
571
636
  if (this.date !== undefined) {
572
- b.write((Primitive.Int.write(this.date)));
637
+ b.write(Primitive.Int.write(this.date));
573
638
  }
574
639
  if (this.qts !== undefined) {
575
- b.write((Primitive.Int.write(this.qts)));
640
+ b.write(Primitive.Int.write(this.qts));
576
641
  }
577
642
  if (this.qtsLimit !== undefined) {
578
- b.write((Primitive.Int.write(this.qtsLimit)));
643
+ b.write(Primitive.Int.write(this.qtsLimit));
579
644
  }
580
645
  return b.buffer;
581
646
  }
@@ -589,11 +654,11 @@ export class GetChannelDifference extends TLObject {
589
654
  limit;
590
655
  constructor(params) {
591
656
  super();
592
- this.classType = "functions";
593
- this.className = "updates.GetChannelDifference";
657
+ this.classType = 'functions';
658
+ this.className = 'updates.GetChannelDifference';
594
659
  this.constructorId = 0x3173d78;
595
660
  this.subclassOfId = 0x29896f5d;
596
- this._slots = ["force", "channel", "filter", "pts", "limit"];
661
+ this._slots = ['force', 'channel', 'filter', 'pts', 'limit'];
597
662
  this.force = params.force;
598
663
  this.channel = params.channel;
599
664
  this.filter = params.filter;
@@ -601,29 +666,35 @@ export class GetChannelDifference extends TLObject {
601
666
  this.limit = params.limit;
602
667
  }
603
668
  /**
604
- * Generate the TLObject from buffer.
605
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
606
- */
669
+ * Generate the TLObject from buffer.
670
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
671
+ */
607
672
  static async read(_data, ..._args) {
608
673
  // @ts-ignore
609
674
  let flags = await Primitive.Int.read(_data);
610
- let force = (flags & (1 << 0)) ? true : false;
675
+ let force = flags & (1 << 0) ? true : false;
611
676
  let channel = await TLObject.read(_data);
612
677
  let filter = await TLObject.read(_data);
613
678
  let pts = await Primitive.Int.read(_data);
614
679
  let limit = await Primitive.Int.read(_data);
615
- return new GetChannelDifference({ "force": force, "channel": channel, "filter": filter, "pts": pts, "limit": limit });
680
+ return new GetChannelDifference({
681
+ force: force,
682
+ channel: channel,
683
+ filter: filter,
684
+ pts: pts,
685
+ limit: limit,
686
+ });
616
687
  }
617
688
  /**
618
- * Generate buffer from TLObject.
619
- */
689
+ * Generate buffer from TLObject.
690
+ */
620
691
  write() {
621
692
  const b = new BytesIO();
622
693
  b.write(Primitive.Int.write(this.constructorId, false));
623
694
  // @ts-ignore
624
695
  let flags = 0;
625
- flags |= this.force ? (1 << 0) : 0;
626
- b.write((Primitive.Int.write(flags)));
696
+ flags |= this.force ? 1 << 0 : 0;
697
+ b.write(Primitive.Int.write(flags));
627
698
  if (this.channel !== undefined) {
628
699
  b.write(this.channel.write());
629
700
  }
@@ -631,10 +702,10 @@ export class GetChannelDifference extends TLObject {
631
702
  b.write(this.filter.write());
632
703
  }
633
704
  if (this.pts !== undefined) {
634
- b.write((Primitive.Int.write(this.pts)));
705
+ b.write(Primitive.Int.write(this.pts));
635
706
  }
636
707
  if (this.limit !== undefined) {
637
- b.write((Primitive.Int.write(this.limit)));
708
+ b.write(Primitive.Int.write(this.limit));
638
709
  }
639
710
  return b.buffer;
640
711
  }