@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,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 WelcomeMessagesNotModified extends TLObject {
14
14
  constructor() {
15
15
  super();
16
- this.classType = "types";
17
- this.className = "ephemeral.WelcomeMessagesNotModified";
16
+ this.classType = 'types';
17
+ this.className = 'ephemeral.WelcomeMessagesNotModified';
18
18
  this.constructorId = 0x59ffdb31;
19
19
  this.subclassOfId = 0x6f749a2d;
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 WelcomeMessagesNotModified();
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));
@@ -42,36 +42,36 @@ export class WelcomeMessages extends TLObject {
42
42
  messages;
43
43
  constructor(params) {
44
44
  super();
45
- this.classType = "types";
46
- this.className = "ephemeral.WelcomeMessages";
45
+ this.classType = 'types';
46
+ this.className = 'ephemeral.WelcomeMessages';
47
47
  this.constructorId = 0x104fc872;
48
48
  this.subclassOfId = 0x6f749a2d;
49
- this._slots = ["hash", "messages"];
49
+ this._slots = ['hash', 'messages'];
50
50
  this.hash = params.hash;
51
51
  this.messages = params.messages;
52
52
  }
53
53
  /**
54
- * Generate the TLObject from buffer.
55
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
56
- */
54
+ * Generate the TLObject from buffer.
55
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
56
+ */
57
57
  static async read(_data, ..._args) {
58
58
  // no flags
59
59
  let hash = await Primitive.Long.read(_data);
60
60
  let messages = await TLObject.read(_data);
61
- return new WelcomeMessages({ "hash": hash, "messages": messages });
61
+ return new WelcomeMessages({ hash: hash, messages: messages });
62
62
  }
63
63
  /**
64
- * Generate buffer from TLObject.
65
- */
64
+ * Generate buffer from TLObject.
65
+ */
66
66
  write() {
67
67
  const b = new BytesIO();
68
68
  b.write(Primitive.Int.write(this.constructorId, false));
69
69
  // no flags
70
70
  if (this.hash !== undefined) {
71
- b.write((Primitive.Long.write(this.hash)));
71
+ b.write(Primitive.Long.write(this.hash));
72
72
  }
73
73
  if (this.messages) {
74
- b.write((Primitive.Vector.write(this.messages)));
74
+ b.write(Primitive.Vector.write(this.messages));
75
75
  }
76
76
  return b.buffer;
77
77
  }
@@ -94,11 +94,26 @@ export class SendMessage extends TLObject {
94
94
  replyTo;
95
95
  constructor(params) {
96
96
  super();
97
- this.classType = "functions";
98
- this.className = "ephemeral.SendMessage";
97
+ this.classType = 'functions';
98
+ this.className = 'ephemeral.SendMessage';
99
99
  this.constructorId = 0xba8d5f35;
100
100
  this.subclassOfId = 0x8af52aac;
101
- this._slots = ["invertMedia", "welcome", "anchor", "noforwards", "peer", "receiverId", "queryId", "message", "entities", "media", "replyMarkup", "richMessage", "randomId", "replyTo"];
101
+ this._slots = [
102
+ 'invertMedia',
103
+ 'welcome',
104
+ 'anchor',
105
+ 'noforwards',
106
+ 'peer',
107
+ 'receiverId',
108
+ 'queryId',
109
+ 'message',
110
+ 'entities',
111
+ 'media',
112
+ 'replyMarkup',
113
+ 'richMessage',
114
+ 'randomId',
115
+ 'replyTo',
116
+ ];
102
117
  this.invertMedia = params.invertMedia;
103
118
  this.welcome = params.welcome;
104
119
  this.anchor = params.anchor;
@@ -115,48 +130,63 @@ export class SendMessage extends TLObject {
115
130
  this.replyTo = params.replyTo;
116
131
  }
117
132
  /**
118
- * Generate the TLObject from buffer.
119
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
120
- */
133
+ * Generate the TLObject from buffer.
134
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
135
+ */
121
136
  static async read(_data, ..._args) {
122
137
  // @ts-ignore
123
138
  let flags = await Primitive.Int.read(_data);
124
- let invertMedia = (flags & (1 << 6)) ? true : false;
125
- let welcome = (flags & (1 << 7)) ? true : false;
126
- let anchor = (flags & (1 << 9)) ? true : false;
127
- let noforwards = (flags & (1 << 10)) ? true : false;
128
- let peer = (flags & (1 << 8)) ? await TLObject.read(_data) : undefined;
139
+ let invertMedia = flags & (1 << 6) ? true : false;
140
+ let welcome = flags & (1 << 7) ? true : false;
141
+ let anchor = flags & (1 << 9) ? true : false;
142
+ let noforwards = flags & (1 << 10) ? true : false;
143
+ let peer = flags & (1 << 8) ? await TLObject.read(_data) : undefined;
129
144
  let receiverId = await TLObject.read(_data);
130
- let queryId = (flags & (1 << 0)) ? await Primitive.Long.read(_data) : undefined;
145
+ let queryId = flags & (1 << 0) ? await Primitive.Long.read(_data) : undefined;
131
146
  let message = await Primitive.String.read(_data);
132
- let entities = (flags & (1 << 1)) ? await TLObject.read(_data) : [];
133
- let media = (flags & (1 << 2)) ? await TLObject.read(_data) : undefined;
134
- let replyMarkup = (flags & (1 << 3)) ? await TLObject.read(_data) : undefined;
135
- let richMessage = (flags & (1 << 4)) ? await TLObject.read(_data) : undefined;
147
+ let entities = flags & (1 << 1) ? await TLObject.read(_data) : [];
148
+ let media = flags & (1 << 2) ? await TLObject.read(_data) : undefined;
149
+ let replyMarkup = flags & (1 << 3) ? await TLObject.read(_data) : undefined;
150
+ let richMessage = flags & (1 << 4) ? await TLObject.read(_data) : undefined;
136
151
  let randomId = await Primitive.Long.read(_data);
137
- let replyTo = (flags & (1 << 5)) ? await TLObject.read(_data) : undefined;
138
- return new SendMessage({ "invertMedia": invertMedia, "welcome": welcome, "anchor": anchor, "noforwards": noforwards, "peer": peer, "receiverId": receiverId, "queryId": queryId, "message": message, "entities": entities, "media": media, "replyMarkup": replyMarkup, "richMessage": richMessage, "randomId": randomId, "replyTo": replyTo });
152
+ let replyTo = flags & (1 << 5) ? await TLObject.read(_data) : undefined;
153
+ return new SendMessage({
154
+ invertMedia: invertMedia,
155
+ welcome: welcome,
156
+ anchor: anchor,
157
+ noforwards: noforwards,
158
+ peer: peer,
159
+ receiverId: receiverId,
160
+ queryId: queryId,
161
+ message: message,
162
+ entities: entities,
163
+ media: media,
164
+ replyMarkup: replyMarkup,
165
+ richMessage: richMessage,
166
+ randomId: randomId,
167
+ replyTo: replyTo,
168
+ });
139
169
  }
140
170
  /**
141
- * Generate buffer from TLObject.
142
- */
171
+ * Generate buffer from TLObject.
172
+ */
143
173
  write() {
144
174
  const b = new BytesIO();
145
175
  b.write(Primitive.Int.write(this.constructorId, false));
146
176
  // @ts-ignore
147
177
  let flags = 0;
148
- flags |= this.invertMedia ? (1 << 6) : 0;
149
- flags |= this.welcome ? (1 << 7) : 0;
150
- flags |= this.anchor ? (1 << 9) : 0;
151
- flags |= this.noforwards ? (1 << 10) : 0;
152
- flags |= this.peer !== undefined ? (1 << 8) : 0;
153
- flags |= this.queryId !== undefined ? (1 << 0) : 0;
154
- flags |= this.entities ? (1 << 1) : 0;
155
- flags |= this.media !== undefined ? (1 << 2) : 0;
156
- flags |= this.replyMarkup !== undefined ? (1 << 3) : 0;
157
- flags |= this.richMessage !== undefined ? (1 << 4) : 0;
158
- flags |= this.replyTo !== undefined ? (1 << 5) : 0;
159
- b.write((Primitive.Int.write(flags)));
178
+ flags |= this.invertMedia ? 1 << 6 : 0;
179
+ flags |= this.welcome ? 1 << 7 : 0;
180
+ flags |= this.anchor ? 1 << 9 : 0;
181
+ flags |= this.noforwards ? 1 << 10 : 0;
182
+ flags |= this.peer !== undefined ? 1 << 8 : 0;
183
+ flags |= this.queryId !== undefined ? 1 << 0 : 0;
184
+ flags |= this.entities ? 1 << 1 : 0;
185
+ flags |= this.media !== undefined ? 1 << 2 : 0;
186
+ flags |= this.replyMarkup !== undefined ? 1 << 3 : 0;
187
+ flags |= this.richMessage !== undefined ? 1 << 4 : 0;
188
+ flags |= this.replyTo !== undefined ? 1 << 5 : 0;
189
+ b.write(Primitive.Int.write(flags));
160
190
  if (this.peer !== undefined) {
161
191
  b.write(this.peer.write());
162
192
  }
@@ -164,13 +194,13 @@ export class SendMessage extends TLObject {
164
194
  b.write(this.receiverId.write());
165
195
  }
166
196
  if (this.queryId !== undefined) {
167
- b.write((Primitive.Long.write(this.queryId)));
197
+ b.write(Primitive.Long.write(this.queryId));
168
198
  }
169
199
  if (this.message !== undefined) {
170
- b.write((Primitive.String.write(this.message)));
200
+ b.write(Primitive.String.write(this.message));
171
201
  }
172
202
  if (this.entities) {
173
- b.write((Primitive.Vector.write(this.entities)));
203
+ b.write(Primitive.Vector.write(this.entities));
174
204
  }
175
205
  if (this.media !== undefined) {
176
206
  b.write(this.media.write());
@@ -182,7 +212,7 @@ export class SendMessage extends TLObject {
182
212
  b.write(this.richMessage.write());
183
213
  }
184
214
  if (this.randomId !== undefined) {
185
- b.write((Primitive.Long.write(this.randomId)));
215
+ b.write(Primitive.Long.write(this.randomId));
186
216
  }
187
217
  if (this.replyTo !== undefined) {
188
218
  b.write(this.replyTo.write());
@@ -197,37 +227,37 @@ export class DeleteMessage extends TLObject {
197
227
  id;
198
228
  constructor(params) {
199
229
  super();
200
- this.classType = "functions";
201
- this.className = "ephemeral.DeleteMessage";
230
+ this.classType = 'functions';
231
+ this.className = 'ephemeral.DeleteMessage';
202
232
  this.constructorId = 0x92f6e797;
203
233
  this.subclassOfId = 0xf5b399ac;
204
- this._slots = ["peer", "receiverId", "id"];
234
+ this._slots = ['peer', 'receiverId', 'id'];
205
235
  this.peer = params.peer;
206
236
  this.receiverId = params.receiverId;
207
237
  this.id = params.id;
208
238
  }
209
239
  /**
210
- * Generate the TLObject from buffer.
211
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
212
- */
240
+ * Generate the TLObject from buffer.
241
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
242
+ */
213
243
  static async read(_data, ..._args) {
214
244
  // @ts-ignore
215
245
  let flags = await Primitive.Int.read(_data);
216
- let peer = (flags & (1 << 0)) ? await TLObject.read(_data) : undefined;
246
+ let peer = flags & (1 << 0) ? await TLObject.read(_data) : undefined;
217
247
  let receiverId = await TLObject.read(_data);
218
248
  let id = await Primitive.Int.read(_data);
219
- return new DeleteMessage({ "peer": peer, "receiverId": receiverId, "id": id });
249
+ return new DeleteMessage({ peer: peer, receiverId: receiverId, id: id });
220
250
  }
221
251
  /**
222
- * Generate buffer from TLObject.
223
- */
252
+ * Generate buffer from TLObject.
253
+ */
224
254
  write() {
225
255
  const b = new BytesIO();
226
256
  b.write(Primitive.Int.write(this.constructorId, false));
227
257
  // @ts-ignore
228
258
  let flags = 0;
229
- flags |= this.peer !== undefined ? (1 << 0) : 0;
230
- b.write((Primitive.Int.write(flags)));
259
+ flags |= this.peer !== undefined ? 1 << 0 : 0;
260
+ b.write(Primitive.Int.write(flags));
231
261
  if (this.peer !== undefined) {
232
262
  b.write(this.peer.write());
233
263
  }
@@ -235,7 +265,7 @@ export class DeleteMessage extends TLObject {
235
265
  b.write(this.receiverId.write());
236
266
  }
237
267
  if (this.id !== undefined) {
238
- b.write((Primitive.Int.write(this.id)));
268
+ b.write(Primitive.Int.write(this.id));
239
269
  }
240
270
  return b.buffer;
241
271
  }
@@ -248,31 +278,31 @@ export class ReportMessage extends TLObject {
248
278
  message;
249
279
  constructor(params) {
250
280
  super();
251
- this.classType = "functions";
252
- this.className = "ephemeral.ReportMessage";
281
+ this.classType = 'functions';
282
+ this.className = 'ephemeral.ReportMessage';
253
283
  this.constructorId = 0x8704f2bf;
254
284
  this.subclassOfId = 0xacd3f438;
255
- this._slots = ["peer", "id", "option", "message"];
285
+ this._slots = ['peer', 'id', 'option', 'message'];
256
286
  this.peer = params.peer;
257
287
  this.id = params.id;
258
288
  this.option = params.option;
259
289
  this.message = params.message;
260
290
  }
261
291
  /**
262
- * Generate the TLObject from buffer.
263
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
264
- */
292
+ * Generate the TLObject from buffer.
293
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
294
+ */
265
295
  static async read(_data, ..._args) {
266
296
  // no flags
267
297
  let peer = await TLObject.read(_data);
268
298
  let id = await Primitive.Int.read(_data);
269
299
  let option = await Primitive.Bytes.read(_data);
270
300
  let message = await Primitive.String.read(_data);
271
- return new ReportMessage({ "peer": peer, "id": id, "option": option, "message": message });
301
+ return new ReportMessage({ peer: peer, id: id, option: option, message: message });
272
302
  }
273
303
  /**
274
- * Generate buffer from TLObject.
275
- */
304
+ * Generate buffer from TLObject.
305
+ */
276
306
  write() {
277
307
  const b = new BytesIO();
278
308
  b.write(Primitive.Int.write(this.constructorId, false));
@@ -281,13 +311,13 @@ export class ReportMessage extends TLObject {
281
311
  b.write(this.peer.write());
282
312
  }
283
313
  if (this.id !== undefined) {
284
- b.write((Primitive.Int.write(this.id)));
314
+ b.write(Primitive.Int.write(this.id));
285
315
  }
286
316
  if (this.option !== undefined) {
287
- b.write((Primitive.Bytes.write(this.option)));
317
+ b.write(Primitive.Bytes.write(this.option));
288
318
  }
289
319
  if (this.message !== undefined) {
290
- b.write((Primitive.String.write(this.message)));
320
+ b.write(Primitive.String.write(this.message));
291
321
  }
292
322
  return b.buffer;
293
323
  }
@@ -299,45 +329,45 @@ export class GetCallbackAnswer extends TLObject {
299
329
  data;
300
330
  constructor(params) {
301
331
  super();
302
- this.classType = "functions";
303
- this.className = "ephemeral.GetCallbackAnswer";
332
+ this.classType = 'functions';
333
+ this.className = 'ephemeral.GetCallbackAnswer';
304
334
  this.constructorId = 0x3fa464c8;
305
335
  this.subclassOfId = 0x6c4dd18c;
306
- this._slots = ["peer", "id", "data"];
336
+ this._slots = ['peer', 'id', 'data'];
307
337
  this.peer = params.peer;
308
338
  this.id = params.id;
309
339
  this.data = params.data;
310
340
  }
311
341
  /**
312
- * Generate the TLObject from buffer.
313
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
314
- */
342
+ * Generate the TLObject from buffer.
343
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
344
+ */
315
345
  static async read(_data, ..._args) {
316
346
  // @ts-ignore
317
347
  let flags = await Primitive.Int.read(_data);
318
348
  let peer = await TLObject.read(_data);
319
349
  let id = await Primitive.Int.read(_data);
320
- let data = (flags & (1 << 1)) ? await Primitive.Bytes.read(_data) : undefined;
321
- return new GetCallbackAnswer({ "peer": peer, "id": id, "data": data });
350
+ let data = flags & (1 << 1) ? await Primitive.Bytes.read(_data) : undefined;
351
+ return new GetCallbackAnswer({ peer: peer, id: id, data: data });
322
352
  }
323
353
  /**
324
- * Generate buffer from TLObject.
325
- */
354
+ * Generate buffer from TLObject.
355
+ */
326
356
  write() {
327
357
  const b = new BytesIO();
328
358
  b.write(Primitive.Int.write(this.constructorId, false));
329
359
  // @ts-ignore
330
360
  let flags = 0;
331
- flags |= this.data !== undefined ? (1 << 1) : 0;
332
- b.write((Primitive.Int.write(flags)));
361
+ flags |= this.data !== undefined ? 1 << 1 : 0;
362
+ b.write(Primitive.Int.write(flags));
333
363
  if (this.peer !== undefined) {
334
364
  b.write(this.peer.write());
335
365
  }
336
366
  if (this.id !== undefined) {
337
- b.write((Primitive.Int.write(this.id)));
367
+ b.write(Primitive.Int.write(this.id));
338
368
  }
339
369
  if (this.data !== undefined) {
340
- b.write((Primitive.Bytes.write(this.data)));
370
+ b.write(Primitive.Bytes.write(this.data));
341
371
  }
342
372
  return b.buffer;
343
373
  }
@@ -356,11 +386,22 @@ export class EditMessage extends TLObject {
356
386
  richMessage;
357
387
  constructor(params) {
358
388
  super();
359
- this.classType = "functions";
360
- this.className = "ephemeral.EditMessage";
389
+ this.classType = 'functions';
390
+ this.className = 'ephemeral.EditMessage';
361
391
  this.constructorId = 0xcf9c725b;
362
392
  this.subclassOfId = 0x8af52aac;
363
- this._slots = ["invertMedia", "welcome", "peer", "receiverId", "id", "message", "media", "entities", "replyMarkup", "richMessage"];
393
+ this._slots = [
394
+ 'invertMedia',
395
+ 'welcome',
396
+ 'peer',
397
+ 'receiverId',
398
+ 'id',
399
+ 'message',
400
+ 'media',
401
+ 'entities',
402
+ 'replyMarkup',
403
+ 'richMessage',
404
+ ];
364
405
  this.invertMedia = params.invertMedia;
365
406
  this.welcome = params.welcome;
366
407
  this.peer = params.peer;
@@ -373,41 +414,52 @@ export class EditMessage extends TLObject {
373
414
  this.richMessage = params.richMessage;
374
415
  }
375
416
  /**
376
- * Generate the TLObject from buffer.
377
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
378
- */
417
+ * Generate the TLObject from buffer.
418
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
419
+ */
379
420
  static async read(_data, ..._args) {
380
421
  // @ts-ignore
381
422
  let flags = await Primitive.Int.read(_data);
382
- let invertMedia = (flags & (1 << 5)) ? true : false;
383
- let welcome = (flags & (1 << 6)) ? true : false;
384
- let peer = (flags & (1 << 7)) ? await TLObject.read(_data) : undefined;
423
+ let invertMedia = flags & (1 << 5) ? true : false;
424
+ let welcome = flags & (1 << 6) ? true : false;
425
+ let peer = flags & (1 << 7) ? await TLObject.read(_data) : undefined;
385
426
  let receiverId = await TLObject.read(_data);
386
427
  let id = await Primitive.Int.read(_data);
387
- let message = (flags & (1 << 0)) ? await Primitive.String.read(_data) : undefined;
388
- let media = (flags & (1 << 3)) ? await TLObject.read(_data) : undefined;
389
- let entities = (flags & (1 << 1)) ? await TLObject.read(_data) : [];
390
- let replyMarkup = (flags & (1 << 2)) ? await TLObject.read(_data) : undefined;
391
- let richMessage = (flags & (1 << 4)) ? await TLObject.read(_data) : undefined;
392
- return new EditMessage({ "invertMedia": invertMedia, "welcome": welcome, "peer": peer, "receiverId": receiverId, "id": id, "message": message, "media": media, "entities": entities, "replyMarkup": replyMarkup, "richMessage": richMessage });
428
+ let message = flags & (1 << 0) ? await Primitive.String.read(_data) : undefined;
429
+ let media = flags & (1 << 3) ? await TLObject.read(_data) : undefined;
430
+ let entities = flags & (1 << 1) ? await TLObject.read(_data) : [];
431
+ let replyMarkup = flags & (1 << 2) ? await TLObject.read(_data) : undefined;
432
+ let richMessage = flags & (1 << 4) ? await TLObject.read(_data) : undefined;
433
+ return new EditMessage({
434
+ invertMedia: invertMedia,
435
+ welcome: welcome,
436
+ peer: peer,
437
+ receiverId: receiverId,
438
+ id: id,
439
+ message: message,
440
+ media: media,
441
+ entities: entities,
442
+ replyMarkup: replyMarkup,
443
+ richMessage: richMessage,
444
+ });
393
445
  }
394
446
  /**
395
- * Generate buffer from TLObject.
396
- */
447
+ * Generate buffer from TLObject.
448
+ */
397
449
  write() {
398
450
  const b = new BytesIO();
399
451
  b.write(Primitive.Int.write(this.constructorId, false));
400
452
  // @ts-ignore
401
453
  let flags = 0;
402
- flags |= this.invertMedia ? (1 << 5) : 0;
403
- flags |= this.welcome ? (1 << 6) : 0;
404
- flags |= this.peer !== undefined ? (1 << 7) : 0;
405
- flags |= this.message !== undefined ? (1 << 0) : 0;
406
- flags |= this.media !== undefined ? (1 << 3) : 0;
407
- flags |= this.entities ? (1 << 1) : 0;
408
- flags |= this.replyMarkup !== undefined ? (1 << 2) : 0;
409
- flags |= this.richMessage !== undefined ? (1 << 4) : 0;
410
- b.write((Primitive.Int.write(flags)));
454
+ flags |= this.invertMedia ? 1 << 5 : 0;
455
+ flags |= this.welcome ? 1 << 6 : 0;
456
+ flags |= this.peer !== undefined ? 1 << 7 : 0;
457
+ flags |= this.message !== undefined ? 1 << 0 : 0;
458
+ flags |= this.media !== undefined ? 1 << 3 : 0;
459
+ flags |= this.entities ? 1 << 1 : 0;
460
+ flags |= this.replyMarkup !== undefined ? 1 << 2 : 0;
461
+ flags |= this.richMessage !== undefined ? 1 << 4 : 0;
462
+ b.write(Primitive.Int.write(flags));
411
463
  if (this.peer !== undefined) {
412
464
  b.write(this.peer.write());
413
465
  }
@@ -415,16 +467,16 @@ export class EditMessage extends TLObject {
415
467
  b.write(this.receiverId.write());
416
468
  }
417
469
  if (this.id !== undefined) {
418
- b.write((Primitive.Int.write(this.id)));
470
+ b.write(Primitive.Int.write(this.id));
419
471
  }
420
472
  if (this.message !== undefined) {
421
- b.write((Primitive.String.write(this.message)));
473
+ b.write(Primitive.String.write(this.message));
422
474
  }
423
475
  if (this.media !== undefined) {
424
476
  b.write(this.media.write());
425
477
  }
426
478
  if (this.entities) {
427
- b.write((Primitive.Vector.write(this.entities)));
479
+ b.write(Primitive.Vector.write(this.entities));
428
480
  }
429
481
  if (this.replyMarkup !== undefined) {
430
482
  b.write(this.replyMarkup.write());
@@ -441,27 +493,27 @@ export class DeleteWelcomeMessage extends TLObject {
441
493
  id;
442
494
  constructor(params) {
443
495
  super();
444
- this.classType = "functions";
445
- this.className = "ephemeral.DeleteWelcomeMessage";
496
+ this.classType = 'functions';
497
+ this.className = 'ephemeral.DeleteWelcomeMessage';
446
498
  this.constructorId = 0xe882a9e1;
447
499
  this.subclassOfId = 0xf5b399ac;
448
- this._slots = ["peer", "id"];
500
+ this._slots = ['peer', 'id'];
449
501
  this.peer = params.peer;
450
502
  this.id = params.id;
451
503
  }
452
504
  /**
453
- * Generate the TLObject from buffer.
454
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
455
- */
505
+ * Generate the TLObject from buffer.
506
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
507
+ */
456
508
  static async read(_data, ..._args) {
457
509
  // no flags
458
510
  let peer = await TLObject.read(_data);
459
511
  let id = await Primitive.Int.read(_data);
460
- return new DeleteWelcomeMessage({ "peer": peer, "id": id });
512
+ return new DeleteWelcomeMessage({ peer: peer, id: id });
461
513
  }
462
514
  /**
463
- * Generate buffer from TLObject.
464
- */
515
+ * Generate buffer from TLObject.
516
+ */
465
517
  write() {
466
518
  const b = new BytesIO();
467
519
  b.write(Primitive.Int.write(this.constructorId, false));
@@ -470,7 +522,7 @@ export class DeleteWelcomeMessage extends TLObject {
470
522
  b.write(this.peer.write());
471
523
  }
472
524
  if (this.id !== undefined) {
473
- b.write((Primitive.Int.write(this.id)));
525
+ b.write(Primitive.Int.write(this.id));
474
526
  }
475
527
  return b.buffer;
476
528
  }
@@ -480,25 +532,25 @@ export class DeleteAllWelcomeMessages extends TLObject {
480
532
  peer;
481
533
  constructor(params) {
482
534
  super();
483
- this.classType = "functions";
484
- this.className = "ephemeral.DeleteAllWelcomeMessages";
535
+ this.classType = 'functions';
536
+ this.className = 'ephemeral.DeleteAllWelcomeMessages';
485
537
  this.constructorId = 0x734f9721;
486
538
  this.subclassOfId = 0xf5b399ac;
487
- this._slots = ["peer"];
539
+ this._slots = ['peer'];
488
540
  this.peer = params.peer;
489
541
  }
490
542
  /**
491
- * Generate the TLObject from buffer.
492
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
493
- */
543
+ * Generate the TLObject from buffer.
544
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
545
+ */
494
546
  static async read(_data, ..._args) {
495
547
  // no flags
496
548
  let peer = await TLObject.read(_data);
497
- return new DeleteAllWelcomeMessages({ "peer": peer });
549
+ return new DeleteAllWelcomeMessages({ peer: peer });
498
550
  }
499
551
  /**
500
- * Generate buffer from TLObject.
501
- */
552
+ * Generate buffer from TLObject.
553
+ */
502
554
  write() {
503
555
  const b = new BytesIO();
504
556
  b.write(Primitive.Int.write(this.constructorId, false));
@@ -515,27 +567,27 @@ export class GetWelcomeMessages extends TLObject {
515
567
  hash;
516
568
  constructor(params) {
517
569
  super();
518
- this.classType = "functions";
519
- this.className = "ephemeral.GetWelcomeMessages";
570
+ this.classType = 'functions';
571
+ this.className = 'ephemeral.GetWelcomeMessages';
520
572
  this.constructorId = 0xdb9ac18d;
521
573
  this.subclassOfId = 0x6f749a2d;
522
- this._slots = ["peer", "hash"];
574
+ this._slots = ['peer', 'hash'];
523
575
  this.peer = params.peer;
524
576
  this.hash = params.hash;
525
577
  }
526
578
  /**
527
- * Generate the TLObject from buffer.
528
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
529
- */
579
+ * Generate the TLObject from buffer.
580
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
581
+ */
530
582
  static async read(_data, ..._args) {
531
583
  // no flags
532
584
  let peer = await TLObject.read(_data);
533
585
  let hash = await Primitive.Long.read(_data);
534
- return new GetWelcomeMessages({ "peer": peer, "hash": hash });
586
+ return new GetWelcomeMessages({ peer: peer, hash: hash });
535
587
  }
536
588
  /**
537
- * Generate buffer from TLObject.
538
- */
589
+ * Generate buffer from TLObject.
590
+ */
539
591
  write() {
540
592
  const b = new BytesIO();
541
593
  b.write(Primitive.Int.write(this.constructorId, false));
@@ -544,7 +596,7 @@ export class GetWelcomeMessages extends TLObject {
544
596
  b.write(this.peer.write());
545
597
  }
546
598
  if (this.hash !== undefined) {
547
- b.write((Primitive.Long.write(this.hash)));
599
+ b.write(Primitive.Long.write(this.hash));
548
600
  }
549
601
  return b.buffer;
550
602
  }