@tgsnake/skema 3.2.1-browser.0 → 3.2.1

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 (67) hide show
  1. package/dist/src/deps.d.ts +3 -4
  2. package/dist/src/deps.js +4 -4
  3. package/dist/src/raw/class/All.d.ts +1 -1
  4. package/dist/src/raw/class/All.js +2783 -2783
  5. package/dist/src/raw/class/Raw.d.ts +7601 -7601
  6. package/dist/src/raw/class/Raw.js +20676 -26781
  7. package/dist/src/raw/class/tl/account.d.ts +841 -841
  8. package/dist/src/raw/class/tl/account.js +1813 -1983
  9. package/dist/src/raw/class/tl/aicompose.d.ts +51 -51
  10. package/dist/src/raw/class/tl/aicompose.js +117 -128
  11. package/dist/src/raw/class/tl/auth.d.ts +296 -296
  12. package/dist/src/raw/class/tl/auth.js +714 -849
  13. package/dist/src/raw/class/tl/bots.d.ts +256 -256
  14. package/dist/src/raw/class/tl/bots.js +607 -661
  15. package/dist/src/raw/class/tl/channels.d.ts +336 -336
  16. package/dist/src/raw/class/tl/channels.js +745 -836
  17. package/dist/src/raw/class/tl/chatlists.d.ts +81 -81
  18. package/dist/src/raw/class/tl/chatlists.js +183 -196
  19. package/dist/src/raw/class/tl/communities.d.ts +56 -56
  20. package/dist/src/raw/class/tl/communities.js +138 -159
  21. package/dist/src/raw/class/tl/contacts.d.ts +216 -216
  22. package/dist/src/raw/class/tl/contacts.js +492 -537
  23. package/dist/src/raw/class/tl/ephemeral.d.ts +51 -51
  24. package/dist/src/raw/class/tl/ephemeral.js +152 -204
  25. package/dist/src/raw/class/tl/feed.d.ts +71 -71
  26. package/dist/src/raw/class/tl/feed.js +179 -214
  27. package/dist/src/raw/class/tl/folders.d.ts +6 -6
  28. package/dist/src/raw/class/tl/folders.js +11 -11
  29. package/dist/src/raw/class/tl/fragment.d.ts +11 -11
  30. package/dist/src/raw/class/tl/fragment.js +25 -32
  31. package/dist/src/raw/class/tl/help.d.ts +286 -286
  32. package/dist/src/raw/class/tl/help.js +618 -686
  33. package/dist/src/raw/class/tl/langpack.d.ts +26 -26
  34. package/dist/src/raw/class/tl/langpack.js +57 -57
  35. package/dist/src/raw/class/tl/messages.d.ts +1866 -1866
  36. package/dist/src/raw/class/tl/messages.js +4886 -5965
  37. package/dist/src/raw/class/tl/payments.d.ts +646 -646
  38. package/dist/src/raw/class/tl/payments.js +1766 -2254
  39. package/dist/src/raw/class/tl/phone.d.ts +256 -256
  40. package/dist/src/raw/class/tl/phone.js +644 -779
  41. package/dist/src/raw/class/tl/photos.d.ts +41 -41
  42. package/dist/src/raw/class/tl/photos.js +116 -139
  43. package/dist/src/raw/class/tl/premium.d.ts +41 -41
  44. package/dist/src/raw/class/tl/premium.js +111 -133
  45. package/dist/src/raw/class/tl/smsjobs.d.ts +46 -46
  46. package/dist/src/raw/class/tl/smsjobs.js +97 -115
  47. package/dist/src/raw/class/tl/stats.d.ts +71 -71
  48. package/dist/src/raw/class/tl/stats.js +169 -268
  49. package/dist/src/raw/class/tl/stickers.d.ts +61 -61
  50. package/dist/src/raw/class/tl/stickers.js +144 -173
  51. package/dist/src/raw/class/tl/storage.d.ts +51 -51
  52. package/dist/src/raw/class/tl/storage.js +71 -71
  53. package/dist/src/raw/class/tl/stories.d.ts +221 -221
  54. package/dist/src/raw/class/tl/stories.js +622 -781
  55. package/dist/src/raw/class/tl/toncenter.d.ts +21 -21
  56. package/dist/src/raw/class/tl/toncenter.js +47 -52
  57. package/dist/src/raw/class/tl/updates.d.ts +56 -56
  58. package/dist/src/raw/class/tl/updates.js +175 -246
  59. package/dist/src/raw/class/tl/upload.d.ts +66 -66
  60. package/dist/src/raw/class/tl/upload.js +155 -178
  61. package/dist/src/raw/class/tl/users.d.ts +61 -61
  62. package/dist/src/raw/class/tl/users.js +124 -124
  63. package/dist/src/raw/class/tl/wallet.d.ts +221 -221
  64. package/dist/src/raw/class/tl/wallet.js +558 -624
  65. package/dist/src/raw/class/types.d.ts +1 -1
  66. package/dist/src/raw/class/types.js +1 -1
  67. package/package.json +4 -6
@@ -6,30 +6,30 @@
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';
13
13
  export class FeedMessagesNotModified extends TLObject {
14
14
  constructor() {
15
15
  super();
16
- this.classType = 'types';
17
- this.className = 'feed.FeedMessagesNotModified';
16
+ this.classType = "types";
17
+ this.className = "feed.FeedMessagesNotModified";
18
18
  this.constructorId = 0xdb1a3503;
19
19
  this.subclassOfId = 0x7cbc696a;
20
20
  this._slots = [];
21
21
  }
22
22
  /**
23
- * Generate the TLObject from buffer.
24
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
25
- */
23
+ * Generate the TLObject from buffer.
24
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
25
+ */
26
26
  static async read(_data, ..._args) {
27
27
  // no flags
28
28
  return new FeedMessagesNotModified();
29
29
  }
30
30
  /**
31
- * Generate buffer from TLObject.
32
- */
31
+ * Generate buffer from TLObject.
32
+ */
33
33
  write() {
34
34
  const b = new BytesIO();
35
35
  b.write(Primitive.Int.write(this.constructorId, false));
@@ -46,11 +46,11 @@ export class FeedMessages extends TLObject {
46
46
  users;
47
47
  constructor(params) {
48
48
  super();
49
- this.classType = 'types';
50
- this.className = 'feed.FeedMessages';
49
+ this.classType = "types";
50
+ this.className = "feed.FeedMessages";
51
51
  this.constructorId = 0xdcf754b9;
52
52
  this.subclassOfId = 0x7cbc696a;
53
- this._slots = ['maxPosition', 'minPosition', 'readMaxPosition', 'messages', 'chats', 'users'];
53
+ this._slots = ["maxPosition", "minPosition", "readMaxPosition", "messages", "chats", "users"];
54
54
  this.maxPosition = params.maxPosition;
55
55
  this.minPosition = params.minPosition;
56
56
  this.readMaxPosition = params.readMaxPosition;
@@ -59,39 +59,32 @@ export class FeedMessages extends TLObject {
59
59
  this.users = params.users;
60
60
  }
61
61
  /**
62
- * Generate the TLObject from buffer.
63
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
64
- */
62
+ * Generate the TLObject from buffer.
63
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
64
+ */
65
65
  static async read(_data, ..._args) {
66
66
  // @ts-ignore
67
67
  let flags = await Primitive.Int.read(_data);
68
- let maxPosition = flags & (1 << 0) ? await TLObject.read(_data) : undefined;
69
- let minPosition = flags & (1 << 1) ? await TLObject.read(_data) : undefined;
70
- let readMaxPosition = flags & (1 << 2) ? await TLObject.read(_data) : undefined;
68
+ let maxPosition = (flags & (1 << 0)) ? await TLObject.read(_data) : undefined;
69
+ let minPosition = (flags & (1 << 1)) ? await TLObject.read(_data) : undefined;
70
+ let readMaxPosition = (flags & (1 << 2)) ? await TLObject.read(_data) : undefined;
71
71
  let messages = await TLObject.read(_data);
72
72
  let chats = await TLObject.read(_data);
73
73
  let users = await TLObject.read(_data);
74
- return new FeedMessages({
75
- maxPosition: maxPosition,
76
- minPosition: minPosition,
77
- readMaxPosition: readMaxPosition,
78
- messages: messages,
79
- chats: chats,
80
- users: users,
81
- });
74
+ return new FeedMessages({ "maxPosition": maxPosition, "minPosition": minPosition, "readMaxPosition": readMaxPosition, "messages": messages, "chats": chats, "users": users });
82
75
  }
83
76
  /**
84
- * Generate buffer from TLObject.
85
- */
77
+ * Generate buffer from TLObject.
78
+ */
86
79
  write() {
87
80
  const b = new BytesIO();
88
81
  b.write(Primitive.Int.write(this.constructorId, false));
89
82
  // @ts-ignore
90
83
  let flags = 0;
91
- flags |= this.maxPosition !== undefined ? 1 << 0 : 0;
92
- flags |= this.minPosition !== undefined ? 1 << 1 : 0;
93
- flags |= this.readMaxPosition !== undefined ? 1 << 2 : 0;
94
- b.write(Primitive.Int.write(flags));
84
+ flags |= this.maxPosition !== undefined ? (1 << 0) : 0;
85
+ flags |= this.minPosition !== undefined ? (1 << 1) : 0;
86
+ flags |= this.readMaxPosition !== undefined ? (1 << 2) : 0;
87
+ b.write((Primitive.Int.write(flags)));
95
88
  if (this.maxPosition !== undefined) {
96
89
  b.write(this.maxPosition.write());
97
90
  }
@@ -102,13 +95,13 @@ export class FeedMessages extends TLObject {
102
95
  b.write(this.readMaxPosition.write());
103
96
  }
104
97
  if (this.messages) {
105
- b.write(Primitive.Vector.write(this.messages));
98
+ b.write((Primitive.Vector.write(this.messages)));
106
99
  }
107
100
  if (this.chats) {
108
- b.write(Primitive.Vector.write(this.chats));
101
+ b.write((Primitive.Vector.write(this.chats)));
109
102
  }
110
103
  if (this.users) {
111
- b.write(Primitive.Vector.write(this.users));
104
+ b.write((Primitive.Vector.write(this.users)));
112
105
  }
113
106
  return b.buffer;
114
107
  }
@@ -120,55 +113,50 @@ export class ForYouFeed extends TLObject {
120
113
  recommendationId;
121
114
  constructor(params) {
122
115
  super();
123
- this.classType = 'types';
124
- this.className = 'feed.ForYouFeed';
116
+ this.classType = "types";
117
+ this.className = "feed.ForYouFeed";
125
118
  this.constructorId = 0xbea16ebd;
126
119
  this.subclassOfId = 0x71eb0cfb;
127
- this._slots = ['items', 'chats', 'users', 'recommendationId'];
120
+ this._slots = ["items", "chats", "users", "recommendationId"];
128
121
  this.items = params.items;
129
122
  this.chats = params.chats;
130
123
  this.users = params.users;
131
124
  this.recommendationId = params.recommendationId;
132
125
  }
133
126
  /**
134
- * Generate the TLObject from buffer.
135
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
136
- */
127
+ * Generate the TLObject from buffer.
128
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
129
+ */
137
130
  static async read(_data, ..._args) {
138
131
  // @ts-ignore
139
132
  let flags = await Primitive.Int.read(_data);
140
133
  let items = await TLObject.read(_data);
141
134
  let chats = await TLObject.read(_data);
142
135
  let users = await TLObject.read(_data);
143
- let recommendationId = flags & (1 << 0) ? await Primitive.Long.read(_data) : undefined;
144
- return new ForYouFeed({
145
- items: items,
146
- chats: chats,
147
- users: users,
148
- recommendationId: recommendationId,
149
- });
136
+ let recommendationId = (flags & (1 << 0)) ? await Primitive.Long.read(_data) : undefined;
137
+ return new ForYouFeed({ "items": items, "chats": chats, "users": users, "recommendationId": recommendationId });
150
138
  }
151
139
  /**
152
- * Generate buffer from TLObject.
153
- */
140
+ * Generate buffer from TLObject.
141
+ */
154
142
  write() {
155
143
  const b = new BytesIO();
156
144
  b.write(Primitive.Int.write(this.constructorId, false));
157
145
  // @ts-ignore
158
146
  let flags = 0;
159
- flags |= this.recommendationId !== undefined ? 1 << 0 : 0;
160
- b.write(Primitive.Int.write(flags));
147
+ flags |= this.recommendationId !== undefined ? (1 << 0) : 0;
148
+ b.write((Primitive.Int.write(flags)));
161
149
  if (this.items) {
162
- b.write(Primitive.Vector.write(this.items));
150
+ b.write((Primitive.Vector.write(this.items)));
163
151
  }
164
152
  if (this.chats) {
165
- b.write(Primitive.Vector.write(this.chats));
153
+ b.write((Primitive.Vector.write(this.chats)));
166
154
  }
167
155
  if (this.users) {
168
- b.write(Primitive.Vector.write(this.users));
156
+ b.write((Primitive.Vector.write(this.users)));
169
157
  }
170
158
  if (this.recommendationId !== undefined) {
171
- b.write(Primitive.Long.write(this.recommendationId));
159
+ b.write((Primitive.Long.write(this.recommendationId)));
172
160
  }
173
161
  return b.buffer;
174
162
  }
@@ -180,56 +168,51 @@ export class InterestCategory extends TLObject {
180
168
  emojiDocumentId;
181
169
  constructor(params) {
182
170
  super();
183
- this.classType = 'types';
184
- this.className = 'feed.InterestCategory';
171
+ this.classType = "types";
172
+ this.className = "feed.InterestCategory";
185
173
  this.constructorId = 0x6c4666e3;
186
174
  this.subclassOfId = 0x79f097d6;
187
- this._slots = ['id', 'title', 'emoji', 'emojiDocumentId'];
175
+ this._slots = ["id", "title", "emoji", "emojiDocumentId"];
188
176
  this.id = params.id;
189
177
  this.title = params.title;
190
178
  this.emoji = params.emoji;
191
179
  this.emojiDocumentId = params.emojiDocumentId;
192
180
  }
193
181
  /**
194
- * Generate the TLObject from buffer.
195
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
196
- */
182
+ * Generate the TLObject from buffer.
183
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
184
+ */
197
185
  static async read(_data, ..._args) {
198
186
  // @ts-ignore
199
187
  let flags = await Primitive.Int.read(_data);
200
188
  let id = await Primitive.Int.read(_data);
201
189
  let title = await Primitive.String.read(_data);
202
- let emoji = flags & (1 << 0) ? await Primitive.String.read(_data) : undefined;
203
- let emojiDocumentId = flags & (1 << 1) ? await Primitive.Long.read(_data) : undefined;
204
- return new InterestCategory({
205
- id: id,
206
- title: title,
207
- emoji: emoji,
208
- emojiDocumentId: emojiDocumentId,
209
- });
190
+ let emoji = (flags & (1 << 0)) ? await Primitive.String.read(_data) : undefined;
191
+ let emojiDocumentId = (flags & (1 << 1)) ? await Primitive.Long.read(_data) : undefined;
192
+ return new InterestCategory({ "id": id, "title": title, "emoji": emoji, "emojiDocumentId": emojiDocumentId });
210
193
  }
211
194
  /**
212
- * Generate buffer from TLObject.
213
- */
195
+ * Generate buffer from TLObject.
196
+ */
214
197
  write() {
215
198
  const b = new BytesIO();
216
199
  b.write(Primitive.Int.write(this.constructorId, false));
217
200
  // @ts-ignore
218
201
  let flags = 0;
219
- flags |= this.emoji !== undefined ? 1 << 0 : 0;
220
- flags |= this.emojiDocumentId !== undefined ? 1 << 1 : 0;
221
- b.write(Primitive.Int.write(flags));
202
+ flags |= this.emoji !== undefined ? (1 << 0) : 0;
203
+ flags |= this.emojiDocumentId !== undefined ? (1 << 1) : 0;
204
+ b.write((Primitive.Int.write(flags)));
222
205
  if (this.id !== undefined) {
223
- b.write(Primitive.Int.write(this.id));
206
+ b.write((Primitive.Int.write(this.id)));
224
207
  }
225
208
  if (this.title !== undefined) {
226
- b.write(Primitive.String.write(this.title));
209
+ b.write((Primitive.String.write(this.title)));
227
210
  }
228
211
  if (this.emoji !== undefined) {
229
- b.write(Primitive.String.write(this.emoji));
212
+ b.write((Primitive.String.write(this.emoji)));
230
213
  }
231
214
  if (this.emojiDocumentId !== undefined) {
232
- b.write(Primitive.Long.write(this.emojiDocumentId));
215
+ b.write((Primitive.Long.write(this.emojiDocumentId)));
233
216
  }
234
217
  return b.buffer;
235
218
  }
@@ -237,23 +220,23 @@ export class InterestCategory extends TLObject {
237
220
  export class InterestCategoriesNotModified extends TLObject {
238
221
  constructor() {
239
222
  super();
240
- this.classType = 'types';
241
- this.className = 'feed.InterestCategoriesNotModified';
223
+ this.classType = "types";
224
+ this.className = "feed.InterestCategoriesNotModified";
242
225
  this.constructorId = 0x79cf2195;
243
226
  this.subclassOfId = 0x35701365;
244
227
  this._slots = [];
245
228
  }
246
229
  /**
247
- * Generate the TLObject from buffer.
248
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
249
- */
230
+ * Generate the TLObject from buffer.
231
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
232
+ */
250
233
  static async read(_data, ..._args) {
251
234
  // no flags
252
235
  return new InterestCategoriesNotModified();
253
236
  }
254
237
  /**
255
- * Generate buffer from TLObject.
256
- */
238
+ * Generate buffer from TLObject.
239
+ */
257
240
  write() {
258
241
  const b = new BytesIO();
259
242
  b.write(Primitive.Int.write(this.constructorId, false));
@@ -266,36 +249,36 @@ export class InterestCategories extends TLObject {
266
249
  selected;
267
250
  constructor(params) {
268
251
  super();
269
- this.classType = 'types';
270
- this.className = 'feed.InterestCategories';
252
+ this.classType = "types";
253
+ this.className = "feed.InterestCategories";
271
254
  this.constructorId = 0xecb62fa0;
272
255
  this.subclassOfId = 0x35701365;
273
- this._slots = ['categories', 'selected'];
256
+ this._slots = ["categories", "selected"];
274
257
  this.categories = params.categories;
275
258
  this.selected = params.selected;
276
259
  }
277
260
  /**
278
- * Generate the TLObject from buffer.
279
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
280
- */
261
+ * Generate the TLObject from buffer.
262
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
263
+ */
281
264
  static async read(_data, ..._args) {
282
265
  // no flags
283
266
  let categories = await TLObject.read(_data);
284
267
  let selected = await TLObject.read(_data, Primitive.Int);
285
- return new InterestCategories({ categories: categories, selected: selected });
268
+ return new InterestCategories({ "categories": categories, "selected": selected });
286
269
  }
287
270
  /**
288
- * Generate buffer from TLObject.
289
- */
271
+ * Generate buffer from TLObject.
272
+ */
290
273
  write() {
291
274
  const b = new BytesIO();
292
275
  b.write(Primitive.Int.write(this.constructorId, false));
293
276
  // no flags
294
277
  if (this.categories) {
295
- b.write(Primitive.Vector.write(this.categories));
278
+ b.write((Primitive.Vector.write(this.categories)));
296
279
  }
297
280
  if (this.selected) {
298
- b.write(Primitive.Vector.write(this.selected, Primitive.Int));
281
+ b.write((Primitive.Vector.write(this.selected, Primitive.Int)));
299
282
  }
300
283
  return b.buffer;
301
284
  }
@@ -312,20 +295,11 @@ export class GetFeed extends TLObject {
312
295
  hash;
313
296
  constructor(params) {
314
297
  super();
315
- this.classType = 'functions';
316
- this.className = 'feed.GetFeed';
298
+ this.classType = "functions";
299
+ this.className = "feed.GetFeed";
317
300
  this.constructorId = 0x7e76d7d3;
318
301
  this.subclassOfId = 0x7cbc696a;
319
- this._slots = [
320
- 'offsetToMaxRead',
321
- 'filterId',
322
- 'offsetPosition',
323
- 'addOffset',
324
- 'limit',
325
- 'maxPosition',
326
- 'minPosition',
327
- 'hash',
328
- ];
302
+ this._slots = ["offsetToMaxRead", "filterId", "offsetPosition", "addOffset", "limit", "maxPosition", "minPosition", "hash"];
329
303
  this.offsetToMaxRead = params.offsetToMaxRead;
330
304
  this.filterId = params.filterId;
331
305
  this.offsetPosition = params.offsetPosition;
@@ -336,55 +310,46 @@ export class GetFeed extends TLObject {
336
310
  this.hash = params.hash;
337
311
  }
338
312
  /**
339
- * Generate the TLObject from buffer.
340
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
341
- */
313
+ * Generate the TLObject from buffer.
314
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
315
+ */
342
316
  static async read(_data, ..._args) {
343
317
  // @ts-ignore
344
318
  let flags = await Primitive.Int.read(_data);
345
- let offsetToMaxRead = flags & (1 << 3) ? true : false;
319
+ let offsetToMaxRead = (flags & (1 << 3)) ? true : false;
346
320
  let filterId = await Primitive.Int.read(_data);
347
- let offsetPosition = flags & (1 << 0) ? await TLObject.read(_data) : undefined;
321
+ let offsetPosition = (flags & (1 << 0)) ? await TLObject.read(_data) : undefined;
348
322
  let addOffset = await Primitive.Int.read(_data);
349
323
  let limit = await Primitive.Int.read(_data);
350
- let maxPosition = flags & (1 << 1) ? await TLObject.read(_data) : undefined;
351
- let minPosition = flags & (1 << 2) ? await TLObject.read(_data) : undefined;
324
+ let maxPosition = (flags & (1 << 1)) ? await TLObject.read(_data) : undefined;
325
+ let minPosition = (flags & (1 << 2)) ? await TLObject.read(_data) : undefined;
352
326
  let hash = await Primitive.Long.read(_data);
353
- return new GetFeed({
354
- offsetToMaxRead: offsetToMaxRead,
355
- filterId: filterId,
356
- offsetPosition: offsetPosition,
357
- addOffset: addOffset,
358
- limit: limit,
359
- maxPosition: maxPosition,
360
- minPosition: minPosition,
361
- hash: hash,
362
- });
327
+ return new GetFeed({ "offsetToMaxRead": offsetToMaxRead, "filterId": filterId, "offsetPosition": offsetPosition, "addOffset": addOffset, "limit": limit, "maxPosition": maxPosition, "minPosition": minPosition, "hash": hash });
363
328
  }
364
329
  /**
365
- * Generate buffer from TLObject.
366
- */
330
+ * Generate buffer from TLObject.
331
+ */
367
332
  write() {
368
333
  const b = new BytesIO();
369
334
  b.write(Primitive.Int.write(this.constructorId, false));
370
335
  // @ts-ignore
371
336
  let flags = 0;
372
- flags |= this.offsetToMaxRead ? 1 << 3 : 0;
373
- flags |= this.offsetPosition !== undefined ? 1 << 0 : 0;
374
- flags |= this.maxPosition !== undefined ? 1 << 1 : 0;
375
- flags |= this.minPosition !== undefined ? 1 << 2 : 0;
376
- b.write(Primitive.Int.write(flags));
337
+ flags |= this.offsetToMaxRead ? (1 << 3) : 0;
338
+ flags |= this.offsetPosition !== undefined ? (1 << 0) : 0;
339
+ flags |= this.maxPosition !== undefined ? (1 << 1) : 0;
340
+ flags |= this.minPosition !== undefined ? (1 << 2) : 0;
341
+ b.write((Primitive.Int.write(flags)));
377
342
  if (this.filterId !== undefined) {
378
- b.write(Primitive.Int.write(this.filterId));
343
+ b.write((Primitive.Int.write(this.filterId)));
379
344
  }
380
345
  if (this.offsetPosition !== undefined) {
381
346
  b.write(this.offsetPosition.write());
382
347
  }
383
348
  if (this.addOffset !== undefined) {
384
- b.write(Primitive.Int.write(this.addOffset));
349
+ b.write((Primitive.Int.write(this.addOffset)));
385
350
  }
386
351
  if (this.limit !== undefined) {
387
- b.write(Primitive.Int.write(this.limit));
352
+ b.write((Primitive.Int.write(this.limit)));
388
353
  }
389
354
  if (this.maxPosition !== undefined) {
390
355
  b.write(this.maxPosition.write());
@@ -393,7 +358,7 @@ export class GetFeed extends TLObject {
393
358
  b.write(this.minPosition.write());
394
359
  }
395
360
  if (this.hash !== undefined) {
396
- b.write(Primitive.Long.write(this.hash));
361
+ b.write((Primitive.Long.write(this.hash)));
397
362
  }
398
363
  return b.buffer;
399
364
  }
@@ -404,33 +369,33 @@ export class ReadFeed extends TLObject {
404
369
  maxPosition;
405
370
  constructor(params) {
406
371
  super();
407
- this.classType = 'functions';
408
- this.className = 'feed.ReadFeed';
372
+ this.classType = "functions";
373
+ this.className = "feed.ReadFeed";
409
374
  this.constructorId = 0xb436c1ff;
410
375
  this.subclassOfId = 0x8af52aac;
411
- this._slots = ['filterId', 'maxPosition'];
376
+ this._slots = ["filterId", "maxPosition"];
412
377
  this.filterId = params.filterId;
413
378
  this.maxPosition = params.maxPosition;
414
379
  }
415
380
  /**
416
- * Generate the TLObject from buffer.
417
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
418
- */
381
+ * Generate the TLObject from buffer.
382
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
383
+ */
419
384
  static async read(_data, ..._args) {
420
385
  // no flags
421
386
  let filterId = await Primitive.Int.read(_data);
422
387
  let maxPosition = await TLObject.read(_data);
423
- return new ReadFeed({ filterId: filterId, maxPosition: maxPosition });
388
+ return new ReadFeed({ "filterId": filterId, "maxPosition": maxPosition });
424
389
  }
425
390
  /**
426
- * Generate buffer from TLObject.
427
- */
391
+ * Generate buffer from TLObject.
392
+ */
428
393
  write() {
429
394
  const b = new BytesIO();
430
395
  b.write(Primitive.Int.write(this.constructorId, false));
431
396
  // no flags
432
397
  if (this.filterId !== undefined) {
433
- b.write(Primitive.Int.write(this.filterId));
398
+ b.write((Primitive.Int.write(this.filterId)));
434
399
  }
435
400
  if (this.maxPosition !== undefined) {
436
401
  b.write(this.maxPosition.write());
@@ -445,43 +410,43 @@ export class GetForYou extends TLObject {
445
410
  limit;
446
411
  constructor(params) {
447
412
  super();
448
- this.classType = 'functions';
449
- this.className = 'feed.GetForYou';
413
+ this.classType = "functions";
414
+ this.className = "feed.GetForYou";
450
415
  this.constructorId = 0x33b8e5eb;
451
416
  this.subclassOfId = 0x71eb0cfb;
452
- this._slots = ['refresh', 'query', 'limit'];
417
+ this._slots = ["refresh", "query", "limit"];
453
418
  this.refresh = params.refresh;
454
419
  this.query = params.query;
455
420
  this.limit = params.limit;
456
421
  }
457
422
  /**
458
- * Generate the TLObject from buffer.
459
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
460
- */
423
+ * Generate the TLObject from buffer.
424
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
425
+ */
461
426
  static async read(_data, ..._args) {
462
427
  // @ts-ignore
463
428
  let flags = await Primitive.Int.read(_data);
464
- let refresh = flags & (1 << 1) ? true : false;
465
- let query = flags & (1 << 0) ? await Primitive.String.read(_data) : undefined;
429
+ let refresh = (flags & (1 << 1)) ? true : false;
430
+ let query = (flags & (1 << 0)) ? await Primitive.String.read(_data) : undefined;
466
431
  let limit = await Primitive.Int.read(_data);
467
- return new GetForYou({ refresh: refresh, query: query, limit: limit });
432
+ return new GetForYou({ "refresh": refresh, "query": query, "limit": limit });
468
433
  }
469
434
  /**
470
- * Generate buffer from TLObject.
471
- */
435
+ * Generate buffer from TLObject.
436
+ */
472
437
  write() {
473
438
  const b = new BytesIO();
474
439
  b.write(Primitive.Int.write(this.constructorId, false));
475
440
  // @ts-ignore
476
441
  let flags = 0;
477
- flags |= this.refresh ? 1 << 1 : 0;
478
- flags |= this.query !== undefined ? 1 << 0 : 0;
479
- b.write(Primitive.Int.write(flags));
442
+ flags |= this.refresh ? (1 << 1) : 0;
443
+ flags |= this.query !== undefined ? (1 << 0) : 0;
444
+ b.write((Primitive.Int.write(flags)));
480
445
  if (this.query !== undefined) {
481
- b.write(Primitive.String.write(this.query));
446
+ b.write((Primitive.String.write(this.query)));
482
447
  }
483
448
  if (this.limit !== undefined) {
484
- b.write(Primitive.Int.write(this.limit));
449
+ b.write((Primitive.Int.write(this.limit)));
485
450
  }
486
451
  return b.buffer;
487
452
  }
@@ -491,31 +456,31 @@ export class GetInterestCategories extends TLObject {
491
456
  hash;
492
457
  constructor(params) {
493
458
  super();
494
- this.classType = 'functions';
495
- this.className = 'feed.GetInterestCategories';
459
+ this.classType = "functions";
460
+ this.className = "feed.GetInterestCategories";
496
461
  this.constructorId = 0xba7a1dba;
497
462
  this.subclassOfId = 0x35701365;
498
- this._slots = ['hash'];
463
+ this._slots = ["hash"];
499
464
  this.hash = params.hash;
500
465
  }
501
466
  /**
502
- * Generate the TLObject from buffer.
503
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
504
- */
467
+ * Generate the TLObject from buffer.
468
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
469
+ */
505
470
  static async read(_data, ..._args) {
506
471
  // no flags
507
472
  let hash = await Primitive.Long.read(_data);
508
- return new GetInterestCategories({ hash: hash });
473
+ return new GetInterestCategories({ "hash": hash });
509
474
  }
510
475
  /**
511
- * Generate buffer from TLObject.
512
- */
476
+ * Generate buffer from TLObject.
477
+ */
513
478
  write() {
514
479
  const b = new BytesIO();
515
480
  b.write(Primitive.Int.write(this.constructorId, false));
516
481
  // no flags
517
482
  if (this.hash !== undefined) {
518
- b.write(Primitive.Long.write(this.hash));
483
+ b.write((Primitive.Long.write(this.hash)));
519
484
  }
520
485
  return b.buffer;
521
486
  }
@@ -525,31 +490,31 @@ export class SetInterestCategories extends TLObject {
525
490
  categoryIds;
526
491
  constructor(params) {
527
492
  super();
528
- this.classType = 'functions';
529
- this.className = 'feed.SetInterestCategories';
493
+ this.classType = "functions";
494
+ this.className = "feed.SetInterestCategories";
530
495
  this.constructorId = 0x9f2958dc;
531
496
  this.subclassOfId = 0xf5b399ac;
532
- this._slots = ['categoryIds'];
497
+ this._slots = ["categoryIds"];
533
498
  this.categoryIds = params.categoryIds;
534
499
  }
535
500
  /**
536
- * Generate the TLObject from buffer.
537
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
538
- */
501
+ * Generate the TLObject from buffer.
502
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
503
+ */
539
504
  static async read(_data, ..._args) {
540
505
  // no flags
541
506
  let categoryIds = await TLObject.read(_data, Primitive.Int);
542
- return new SetInterestCategories({ categoryIds: categoryIds });
507
+ return new SetInterestCategories({ "categoryIds": categoryIds });
543
508
  }
544
509
  /**
545
- * Generate buffer from TLObject.
546
- */
510
+ * Generate buffer from TLObject.
511
+ */
547
512
  write() {
548
513
  const b = new BytesIO();
549
514
  b.write(Primitive.Int.write(this.constructorId, false));
550
515
  // no flags
551
516
  if (this.categoryIds) {
552
- b.write(Primitive.Vector.write(this.categoryIds, Primitive.Int));
517
+ b.write((Primitive.Vector.write(this.categoryIds, Primitive.Int)));
553
518
  }
554
519
  return b.buffer;
555
520
  }
@@ -560,27 +525,27 @@ export class LikePost extends TLObject {
560
525
  msgId;
561
526
  constructor(params) {
562
527
  super();
563
- this.classType = 'functions';
564
- this.className = 'feed.LikePost';
528
+ this.classType = "functions";
529
+ this.className = "feed.LikePost";
565
530
  this.constructorId = 0x1b4b627e;
566
531
  this.subclassOfId = 0xf5b399ac;
567
- this._slots = ['peer', 'msgId'];
532
+ this._slots = ["peer", "msgId"];
568
533
  this.peer = params.peer;
569
534
  this.msgId = params.msgId;
570
535
  }
571
536
  /**
572
- * Generate the TLObject from buffer.
573
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
574
- */
537
+ * Generate the TLObject from buffer.
538
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
539
+ */
575
540
  static async read(_data, ..._args) {
576
541
  // no flags
577
542
  let peer = await TLObject.read(_data);
578
543
  let msgId = await Primitive.Int.read(_data);
579
- return new LikePost({ peer: peer, msgId: msgId });
544
+ return new LikePost({ "peer": peer, "msgId": msgId });
580
545
  }
581
546
  /**
582
- * Generate buffer from TLObject.
583
- */
547
+ * Generate buffer from TLObject.
548
+ */
584
549
  write() {
585
550
  const b = new BytesIO();
586
551
  b.write(Primitive.Int.write(this.constructorId, false));
@@ -589,7 +554,7 @@ export class LikePost extends TLObject {
589
554
  b.write(this.peer.write());
590
555
  }
591
556
  if (this.msgId !== undefined) {
592
- b.write(Primitive.Int.write(this.msgId));
557
+ b.write((Primitive.Int.write(this.msgId)));
593
558
  }
594
559
  return b.buffer;
595
560
  }
@@ -600,27 +565,27 @@ export class DislikePost extends TLObject {
600
565
  msgId;
601
566
  constructor(params) {
602
567
  super();
603
- this.classType = 'functions';
604
- this.className = 'feed.DislikePost';
568
+ this.classType = "functions";
569
+ this.className = "feed.DislikePost";
605
570
  this.constructorId = 0x4d70175c;
606
571
  this.subclassOfId = 0xf5b399ac;
607
- this._slots = ['peer', 'msgId'];
572
+ this._slots = ["peer", "msgId"];
608
573
  this.peer = params.peer;
609
574
  this.msgId = params.msgId;
610
575
  }
611
576
  /**
612
- * Generate the TLObject from buffer.
613
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
614
- */
577
+ * Generate the TLObject from buffer.
578
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
579
+ */
615
580
  static async read(_data, ..._args) {
616
581
  // no flags
617
582
  let peer = await TLObject.read(_data);
618
583
  let msgId = await Primitive.Int.read(_data);
619
- return new DislikePost({ peer: peer, msgId: msgId });
584
+ return new DislikePost({ "peer": peer, "msgId": msgId });
620
585
  }
621
586
  /**
622
- * Generate buffer from TLObject.
623
- */
587
+ * Generate buffer from TLObject.
588
+ */
624
589
  write() {
625
590
  const b = new BytesIO();
626
591
  b.write(Primitive.Int.write(this.constructorId, false));
@@ -629,7 +594,7 @@ export class DislikePost extends TLObject {
629
594
  b.write(this.peer.write());
630
595
  }
631
596
  if (this.msgId !== undefined) {
632
- b.write(Primitive.Int.write(this.msgId));
597
+ b.write((Primitive.Int.write(this.msgId)));
633
598
  }
634
599
  return b.buffer;
635
600
  }
@@ -639,33 +604,33 @@ export class GetSponsoredMessages extends TLObject {
639
604
  forYou;
640
605
  constructor(params) {
641
606
  super();
642
- this.classType = 'functions';
643
- this.className = 'feed.GetSponsoredMessages';
607
+ this.classType = "functions";
608
+ this.className = "feed.GetSponsoredMessages";
644
609
  this.constructorId = 0x87af16d4;
645
610
  this.subclassOfId = 0x7f4169e0;
646
- this._slots = ['forYou'];
611
+ this._slots = ["forYou"];
647
612
  this.forYou = params.forYou;
648
613
  }
649
614
  /**
650
- * Generate the TLObject from buffer.
651
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
652
- */
615
+ * Generate the TLObject from buffer.
616
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
617
+ */
653
618
  static async read(_data, ..._args) {
654
619
  // @ts-ignore
655
620
  let flags = await Primitive.Int.read(_data);
656
- let forYou = flags & (1 << 0) ? true : false;
657
- return new GetSponsoredMessages({ forYou: forYou });
621
+ let forYou = (flags & (1 << 0)) ? true : false;
622
+ return new GetSponsoredMessages({ "forYou": forYou });
658
623
  }
659
624
  /**
660
- * Generate buffer from TLObject.
661
- */
625
+ * Generate buffer from TLObject.
626
+ */
662
627
  write() {
663
628
  const b = new BytesIO();
664
629
  b.write(Primitive.Int.write(this.constructorId, false));
665
630
  // @ts-ignore
666
631
  let flags = 0;
667
- flags |= this.forYou ? 1 << 0 : 0;
668
- b.write(Primitive.Int.write(flags));
632
+ flags |= this.forYou ? (1 << 0) : 0;
633
+ b.write((Primitive.Int.write(flags)));
669
634
  return b.buffer;
670
635
  }
671
636
  }