@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
  import { TLObject } from '../../core/index.js';
11
11
  import { Buffer, BytesIO } from '../../../deps.js';
12
12
  import type { Vector, double, int, long } from '../types.js';
@@ -21,13 +21,13 @@ export declare class Photos extends TLObject {
21
21
  users: Vector<raw.TypeUser>;
22
22
  });
23
23
  /**
24
- * Generate the TLObject from buffer.
25
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
26
- */
24
+ * Generate the TLObject from buffer.
25
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
26
+ */
27
27
  static read(_data: BytesIO, ..._args: Array<any>): Promise<Photos>;
28
28
  /**
29
- * Generate buffer from TLObject.
30
- */
29
+ * Generate buffer from TLObject.
30
+ */
31
31
  write(): Buffer;
32
32
  }
33
33
  export declare class PhotosSlice extends TLObject {
@@ -40,13 +40,13 @@ export declare class PhotosSlice extends TLObject {
40
40
  users: Vector<raw.TypeUser>;
41
41
  });
42
42
  /**
43
- * Generate the TLObject from buffer.
44
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
45
- */
43
+ * Generate the TLObject from buffer.
44
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
45
+ */
46
46
  static read(_data: BytesIO, ..._args: Array<any>): Promise<PhotosSlice>;
47
47
  /**
48
- * Generate buffer from TLObject.
49
- */
48
+ * Generate buffer from TLObject.
49
+ */
50
50
  write(): Buffer;
51
51
  }
52
52
  export declare class Photo extends TLObject {
@@ -57,13 +57,13 @@ export declare class Photo extends TLObject {
57
57
  users: Vector<raw.TypeUser>;
58
58
  });
59
59
  /**
60
- * Generate the TLObject from buffer.
61
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
62
- */
60
+ * Generate the TLObject from buffer.
61
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
62
+ */
63
63
  static read(_data: BytesIO, ..._args: Array<any>): Promise<Photo>;
64
64
  /**
65
- * Generate buffer from TLObject.
66
- */
65
+ * Generate buffer from TLObject.
66
+ */
67
67
  write(): Buffer;
68
68
  }
69
69
  export declare class UpdateProfilePhoto extends TLObject {
@@ -77,13 +77,13 @@ export declare class UpdateProfilePhoto extends TLObject {
77
77
  id: raw.TypeInputPhoto;
78
78
  });
79
79
  /**
80
- * Generate the TLObject from buffer.
81
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
82
- */
80
+ * Generate the TLObject from buffer.
81
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
82
+ */
83
83
  static read(_data: BytesIO, ..._args: Array<any>): Promise<UpdateProfilePhoto>;
84
84
  /**
85
- * Generate buffer from TLObject.
86
- */
85
+ * Generate buffer from TLObject.
86
+ */
87
87
  write(): Buffer;
88
88
  }
89
89
  export declare class UploadProfilePhoto extends TLObject {
@@ -103,13 +103,13 @@ export declare class UploadProfilePhoto extends TLObject {
103
103
  videoEmojiMarkup?: raw.TypeVideoSize;
104
104
  });
105
105
  /**
106
- * Generate the TLObject from buffer.
107
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
108
- */
106
+ * Generate the TLObject from buffer.
107
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
108
+ */
109
109
  static read(_data: BytesIO, ..._args: Array<any>): Promise<UploadProfilePhoto>;
110
110
  /**
111
- * Generate buffer from TLObject.
112
- */
111
+ * Generate buffer from TLObject.
112
+ */
113
113
  write(): Buffer;
114
114
  }
115
115
  export declare class DeletePhotos extends TLObject {
@@ -119,13 +119,13 @@ export declare class DeletePhotos extends TLObject {
119
119
  id: Vector<raw.TypeInputPhoto>;
120
120
  });
121
121
  /**
122
- * Generate the TLObject from buffer.
123
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
124
- */
122
+ * Generate the TLObject from buffer.
123
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
124
+ */
125
125
  static read(_data: BytesIO, ..._args: Array<any>): Promise<DeletePhotos>;
126
126
  /**
127
- * Generate buffer from TLObject.
128
- */
127
+ * Generate buffer from TLObject.
128
+ */
129
129
  write(): Buffer;
130
130
  }
131
131
  export declare class GetUserPhotos extends TLObject {
@@ -141,13 +141,13 @@ export declare class GetUserPhotos extends TLObject {
141
141
  limit: int;
142
142
  });
143
143
  /**
144
- * Generate the TLObject from buffer.
145
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
146
- */
144
+ * Generate the TLObject from buffer.
145
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
146
+ */
147
147
  static read(_data: BytesIO, ..._args: Array<any>): Promise<GetUserPhotos>;
148
148
  /**
149
- * Generate buffer from TLObject.
150
- */
149
+ * Generate buffer from TLObject.
150
+ */
151
151
  write(): Buffer;
152
152
  }
153
153
  export declare class UploadContactProfilePhoto extends TLObject {
@@ -169,12 +169,12 @@ export declare class UploadContactProfilePhoto extends TLObject {
169
169
  videoEmojiMarkup?: raw.TypeVideoSize;
170
170
  });
171
171
  /**
172
- * Generate the TLObject from buffer.
173
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
174
- */
172
+ * Generate the TLObject from buffer.
173
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
174
+ */
175
175
  static read(_data: BytesIO, ..._args: Array<any>): Promise<UploadContactProfilePhoto>;
176
176
  /**
177
- * Generate buffer from TLObject.
178
- */
177
+ * Generate buffer from TLObject.
178
+ */
179
179
  write(): Buffer;
180
180
  }
@@ -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';
@@ -15,36 +15,36 @@ export class Photos extends TLObject {
15
15
  users;
16
16
  constructor(params) {
17
17
  super();
18
- this.classType = "types";
19
- this.className = "photos.Photos";
18
+ this.classType = 'types';
19
+ this.className = 'photos.Photos';
20
20
  this.constructorId = 0x8dca6aa5;
21
21
  this.subclassOfId = 0x27cfb967;
22
- this._slots = ["photos", "users"];
22
+ this._slots = ['photos', 'users'];
23
23
  this.photos = params.photos;
24
24
  this.users = params.users;
25
25
  }
26
26
  /**
27
- * Generate the TLObject from buffer.
28
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
29
- */
27
+ * Generate the TLObject from buffer.
28
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
29
+ */
30
30
  static async read(_data, ..._args) {
31
31
  // no flags
32
32
  let photos = await TLObject.read(_data);
33
33
  let users = await TLObject.read(_data);
34
- return new Photos({ "photos": photos, "users": users });
34
+ return new Photos({ photos: photos, users: users });
35
35
  }
36
36
  /**
37
- * Generate buffer from TLObject.
38
- */
37
+ * Generate buffer from TLObject.
38
+ */
39
39
  write() {
40
40
  const b = new BytesIO();
41
41
  b.write(Primitive.Int.write(this.constructorId, false));
42
42
  // no flags
43
43
  if (this.photos) {
44
- b.write((Primitive.Vector.write(this.photos)));
44
+ b.write(Primitive.Vector.write(this.photos));
45
45
  }
46
46
  if (this.users) {
47
- b.write((Primitive.Vector.write(this.users)));
47
+ b.write(Primitive.Vector.write(this.users));
48
48
  }
49
49
  return b.buffer;
50
50
  }
@@ -55,41 +55,41 @@ export class PhotosSlice extends TLObject {
55
55
  users;
56
56
  constructor(params) {
57
57
  super();
58
- this.classType = "types";
59
- this.className = "photos.PhotosSlice";
58
+ this.classType = 'types';
59
+ this.className = 'photos.PhotosSlice';
60
60
  this.constructorId = 0x15051f54;
61
61
  this.subclassOfId = 0x27cfb967;
62
- this._slots = ["count", "photos", "users"];
62
+ this._slots = ['count', 'photos', 'users'];
63
63
  this.count = params.count;
64
64
  this.photos = params.photos;
65
65
  this.users = params.users;
66
66
  }
67
67
  /**
68
- * Generate the TLObject from buffer.
69
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
70
- */
68
+ * Generate the TLObject from buffer.
69
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
70
+ */
71
71
  static async read(_data, ..._args) {
72
72
  // no flags
73
73
  let count = await Primitive.Int.read(_data);
74
74
  let photos = await TLObject.read(_data);
75
75
  let users = await TLObject.read(_data);
76
- return new PhotosSlice({ "count": count, "photos": photos, "users": users });
76
+ return new PhotosSlice({ count: count, photos: photos, users: users });
77
77
  }
78
78
  /**
79
- * Generate buffer from TLObject.
80
- */
79
+ * Generate buffer from TLObject.
80
+ */
81
81
  write() {
82
82
  const b = new BytesIO();
83
83
  b.write(Primitive.Int.write(this.constructorId, false));
84
84
  // no flags
85
85
  if (this.count !== undefined) {
86
- b.write((Primitive.Int.write(this.count)));
86
+ b.write(Primitive.Int.write(this.count));
87
87
  }
88
88
  if (this.photos) {
89
- b.write((Primitive.Vector.write(this.photos)));
89
+ b.write(Primitive.Vector.write(this.photos));
90
90
  }
91
91
  if (this.users) {
92
- b.write((Primitive.Vector.write(this.users)));
92
+ b.write(Primitive.Vector.write(this.users));
93
93
  }
94
94
  return b.buffer;
95
95
  }
@@ -99,27 +99,27 @@ export class Photo extends TLObject {
99
99
  users;
100
100
  constructor(params) {
101
101
  super();
102
- this.classType = "types";
103
- this.className = "photos.Photo";
102
+ this.classType = 'types';
103
+ this.className = 'photos.Photo';
104
104
  this.constructorId = 0x20212ca8;
105
105
  this.subclassOfId = 0xc292bd24;
106
- this._slots = ["photo", "users"];
106
+ this._slots = ['photo', 'users'];
107
107
  this.photo = params.photo;
108
108
  this.users = params.users;
109
109
  }
110
110
  /**
111
- * Generate the TLObject from buffer.
112
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
113
- */
111
+ * Generate the TLObject from buffer.
112
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
113
+ */
114
114
  static async read(_data, ..._args) {
115
115
  // no flags
116
116
  let photo = await TLObject.read(_data);
117
117
  let users = await TLObject.read(_data);
118
- return new Photo({ "photo": photo, "users": users });
118
+ return new Photo({ photo: photo, users: users });
119
119
  }
120
120
  /**
121
- * Generate buffer from TLObject.
122
- */
121
+ * Generate buffer from TLObject.
122
+ */
123
123
  write() {
124
124
  const b = new BytesIO();
125
125
  b.write(Primitive.Int.write(this.constructorId, false));
@@ -128,7 +128,7 @@ export class Photo extends TLObject {
128
128
  b.write(this.photo.write());
129
129
  }
130
130
  if (this.users) {
131
- b.write((Primitive.Vector.write(this.users)));
131
+ b.write(Primitive.Vector.write(this.users));
132
132
  }
133
133
  return b.buffer;
134
134
  }
@@ -140,38 +140,38 @@ export class UpdateProfilePhoto extends TLObject {
140
140
  id;
141
141
  constructor(params) {
142
142
  super();
143
- this.classType = "functions";
144
- this.className = "photos.UpdateProfilePhoto";
143
+ this.classType = 'functions';
144
+ this.className = 'photos.UpdateProfilePhoto';
145
145
  this.constructorId = 0x9e82039;
146
146
  this.subclassOfId = 0xc292bd24;
147
- this._slots = ["fallback", "bot", "id"];
147
+ this._slots = ['fallback', 'bot', 'id'];
148
148
  this.fallback = params.fallback;
149
149
  this.bot = params.bot;
150
150
  this.id = params.id;
151
151
  }
152
152
  /**
153
- * Generate the TLObject from buffer.
154
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
155
- */
153
+ * Generate the TLObject from buffer.
154
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
155
+ */
156
156
  static async read(_data, ..._args) {
157
157
  // @ts-ignore
158
158
  let flags = await Primitive.Int.read(_data);
159
- let fallback = (flags & (1 << 0)) ? true : false;
160
- let bot = (flags & (1 << 1)) ? await TLObject.read(_data) : undefined;
159
+ let fallback = flags & (1 << 0) ? true : false;
160
+ let bot = flags & (1 << 1) ? await TLObject.read(_data) : undefined;
161
161
  let id = await TLObject.read(_data);
162
- return new UpdateProfilePhoto({ "fallback": fallback, "bot": bot, "id": id });
162
+ return new UpdateProfilePhoto({ fallback: fallback, bot: bot, id: id });
163
163
  }
164
164
  /**
165
- * Generate buffer from TLObject.
166
- */
165
+ * Generate buffer from TLObject.
166
+ */
167
167
  write() {
168
168
  const b = new BytesIO();
169
169
  b.write(Primitive.Int.write(this.constructorId, false));
170
170
  // @ts-ignore
171
171
  let flags = 0;
172
- flags |= this.fallback ? (1 << 0) : 0;
173
- flags |= this.bot !== undefined ? (1 << 1) : 0;
174
- b.write((Primitive.Int.write(flags)));
172
+ flags |= this.fallback ? 1 << 0 : 0;
173
+ flags |= this.bot !== undefined ? 1 << 1 : 0;
174
+ b.write(Primitive.Int.write(flags));
175
175
  if (this.bot !== undefined) {
176
176
  b.write(this.bot.write());
177
177
  }
@@ -191,11 +191,11 @@ export class UploadProfilePhoto extends TLObject {
191
191
  videoEmojiMarkup;
192
192
  constructor(params) {
193
193
  super();
194
- this.classType = "functions";
195
- this.className = "photos.UploadProfilePhoto";
194
+ this.classType = 'functions';
195
+ this.className = 'photos.UploadProfilePhoto';
196
196
  this.constructorId = 0x388a3b5;
197
197
  this.subclassOfId = 0xc292bd24;
198
- this._slots = ["fallback", "bot", "file", "video", "videoStartTs", "videoEmojiMarkup"];
198
+ this._slots = ['fallback', 'bot', 'file', 'video', 'videoStartTs', 'videoEmojiMarkup'];
199
199
  this.fallback = params.fallback;
200
200
  this.bot = params.bot;
201
201
  this.file = params.file;
@@ -204,35 +204,42 @@ export class UploadProfilePhoto extends TLObject {
204
204
  this.videoEmojiMarkup = params.videoEmojiMarkup;
205
205
  }
206
206
  /**
207
- * Generate the TLObject from buffer.
208
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
209
- */
207
+ * Generate the TLObject from buffer.
208
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
209
+ */
210
210
  static async read(_data, ..._args) {
211
211
  // @ts-ignore
212
212
  let flags = await Primitive.Int.read(_data);
213
- let fallback = (flags & (1 << 3)) ? true : false;
214
- let bot = (flags & (1 << 5)) ? await TLObject.read(_data) : undefined;
215
- let file = (flags & (1 << 0)) ? await TLObject.read(_data) : undefined;
216
- let video = (flags & (1 << 1)) ? await TLObject.read(_data) : undefined;
217
- let videoStartTs = (flags & (1 << 2)) ? await Primitive.Double.read(_data) : undefined;
218
- let videoEmojiMarkup = (flags & (1 << 4)) ? await TLObject.read(_data) : undefined;
219
- return new UploadProfilePhoto({ "fallback": fallback, "bot": bot, "file": file, "video": video, "videoStartTs": videoStartTs, "videoEmojiMarkup": videoEmojiMarkup });
213
+ let fallback = flags & (1 << 3) ? true : false;
214
+ let bot = flags & (1 << 5) ? await TLObject.read(_data) : undefined;
215
+ let file = flags & (1 << 0) ? await TLObject.read(_data) : undefined;
216
+ let video = flags & (1 << 1) ? await TLObject.read(_data) : undefined;
217
+ let videoStartTs = flags & (1 << 2) ? await Primitive.Double.read(_data) : undefined;
218
+ let videoEmojiMarkup = flags & (1 << 4) ? await TLObject.read(_data) : undefined;
219
+ return new UploadProfilePhoto({
220
+ fallback: fallback,
221
+ bot: bot,
222
+ file: file,
223
+ video: video,
224
+ videoStartTs: videoStartTs,
225
+ videoEmojiMarkup: videoEmojiMarkup,
226
+ });
220
227
  }
221
228
  /**
222
- * Generate buffer from TLObject.
223
- */
229
+ * Generate buffer from TLObject.
230
+ */
224
231
  write() {
225
232
  const b = new BytesIO();
226
233
  b.write(Primitive.Int.write(this.constructorId, false));
227
234
  // @ts-ignore
228
235
  let flags = 0;
229
- flags |= this.fallback ? (1 << 3) : 0;
230
- flags |= this.bot !== undefined ? (1 << 5) : 0;
231
- flags |= this.file !== undefined ? (1 << 0) : 0;
232
- flags |= this.video !== undefined ? (1 << 1) : 0;
233
- flags |= this.videoStartTs !== undefined ? (1 << 2) : 0;
234
- flags |= this.videoEmojiMarkup !== undefined ? (1 << 4) : 0;
235
- b.write((Primitive.Int.write(flags)));
236
+ flags |= this.fallback ? 1 << 3 : 0;
237
+ flags |= this.bot !== undefined ? 1 << 5 : 0;
238
+ flags |= this.file !== undefined ? 1 << 0 : 0;
239
+ flags |= this.video !== undefined ? 1 << 1 : 0;
240
+ flags |= this.videoStartTs !== undefined ? 1 << 2 : 0;
241
+ flags |= this.videoEmojiMarkup !== undefined ? 1 << 4 : 0;
242
+ b.write(Primitive.Int.write(flags));
236
243
  if (this.bot !== undefined) {
237
244
  b.write(this.bot.write());
238
245
  }
@@ -243,7 +250,7 @@ export class UploadProfilePhoto extends TLObject {
243
250
  b.write(this.video.write());
244
251
  }
245
252
  if (this.videoStartTs !== undefined) {
246
- b.write((Primitive.Double.write(this.videoStartTs)));
253
+ b.write(Primitive.Double.write(this.videoStartTs));
247
254
  }
248
255
  if (this.videoEmojiMarkup !== undefined) {
249
256
  b.write(this.videoEmojiMarkup.write());
@@ -256,31 +263,31 @@ export class DeletePhotos extends TLObject {
256
263
  id;
257
264
  constructor(params) {
258
265
  super();
259
- this.classType = "functions";
260
- this.className = "photos.DeletePhotos";
266
+ this.classType = 'functions';
267
+ this.className = 'photos.DeletePhotos';
261
268
  this.constructorId = 0x87cf7f2f;
262
269
  this.subclassOfId = 0x8918e168;
263
- this._slots = ["id"];
270
+ this._slots = ['id'];
264
271
  this.id = params.id;
265
272
  }
266
273
  /**
267
- * Generate the TLObject from buffer.
268
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
269
- */
274
+ * Generate the TLObject from buffer.
275
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
276
+ */
270
277
  static async read(_data, ..._args) {
271
278
  // no flags
272
279
  let id = await TLObject.read(_data);
273
- return new DeletePhotos({ "id": id });
280
+ return new DeletePhotos({ id: id });
274
281
  }
275
282
  /**
276
- * Generate buffer from TLObject.
277
- */
283
+ * Generate buffer from TLObject.
284
+ */
278
285
  write() {
279
286
  const b = new BytesIO();
280
287
  b.write(Primitive.Int.write(this.constructorId, false));
281
288
  // no flags
282
289
  if (this.id) {
283
- b.write((Primitive.Vector.write(this.id)));
290
+ b.write(Primitive.Vector.write(this.id));
284
291
  }
285
292
  return b.buffer;
286
293
  }
@@ -293,31 +300,31 @@ export class GetUserPhotos extends TLObject {
293
300
  limit;
294
301
  constructor(params) {
295
302
  super();
296
- this.classType = "functions";
297
- this.className = "photos.GetUserPhotos";
303
+ this.classType = 'functions';
304
+ this.className = 'photos.GetUserPhotos';
298
305
  this.constructorId = 0x91cd32a8;
299
306
  this.subclassOfId = 0x27cfb967;
300
- this._slots = ["userId", "offset", "maxId", "limit"];
307
+ this._slots = ['userId', 'offset', 'maxId', 'limit'];
301
308
  this.userId = params.userId;
302
309
  this.offset = params.offset;
303
310
  this.maxId = params.maxId;
304
311
  this.limit = params.limit;
305
312
  }
306
313
  /**
307
- * Generate the TLObject from buffer.
308
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
309
- */
314
+ * Generate the TLObject from buffer.
315
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
316
+ */
310
317
  static async read(_data, ..._args) {
311
318
  // no flags
312
319
  let userId = await TLObject.read(_data);
313
320
  let offset = await Primitive.Int.read(_data);
314
321
  let maxId = await Primitive.Long.read(_data);
315
322
  let limit = await Primitive.Int.read(_data);
316
- return new GetUserPhotos({ "userId": userId, "offset": offset, "maxId": maxId, "limit": limit });
323
+ return new GetUserPhotos({ userId: userId, offset: offset, maxId: maxId, limit: limit });
317
324
  }
318
325
  /**
319
- * Generate buffer from TLObject.
320
- */
326
+ * Generate buffer from TLObject.
327
+ */
321
328
  write() {
322
329
  const b = new BytesIO();
323
330
  b.write(Primitive.Int.write(this.constructorId, false));
@@ -326,13 +333,13 @@ export class GetUserPhotos extends TLObject {
326
333
  b.write(this.userId.write());
327
334
  }
328
335
  if (this.offset !== undefined) {
329
- b.write((Primitive.Int.write(this.offset)));
336
+ b.write(Primitive.Int.write(this.offset));
330
337
  }
331
338
  if (this.maxId !== undefined) {
332
- b.write((Primitive.Long.write(this.maxId)));
339
+ b.write(Primitive.Long.write(this.maxId));
333
340
  }
334
341
  if (this.limit !== undefined) {
335
- b.write((Primitive.Int.write(this.limit)));
342
+ b.write(Primitive.Int.write(this.limit));
336
343
  }
337
344
  return b.buffer;
338
345
  }
@@ -348,11 +355,19 @@ export class UploadContactProfilePhoto extends TLObject {
348
355
  videoEmojiMarkup;
349
356
  constructor(params) {
350
357
  super();
351
- this.classType = "functions";
352
- this.className = "photos.UploadContactProfilePhoto";
358
+ this.classType = 'functions';
359
+ this.className = 'photos.UploadContactProfilePhoto';
353
360
  this.constructorId = 0xe14c4a71;
354
361
  this.subclassOfId = 0xc292bd24;
355
- this._slots = ["suggest", "save", "userId", "file", "video", "videoStartTs", "videoEmojiMarkup"];
362
+ this._slots = [
363
+ 'suggest',
364
+ 'save',
365
+ 'userId',
366
+ 'file',
367
+ 'video',
368
+ 'videoStartTs',
369
+ 'videoEmojiMarkup',
370
+ ];
356
371
  this.suggest = params.suggest;
357
372
  this.save = params.save;
358
373
  this.userId = params.userId;
@@ -362,36 +377,44 @@ export class UploadContactProfilePhoto extends TLObject {
362
377
  this.videoEmojiMarkup = params.videoEmojiMarkup;
363
378
  }
364
379
  /**
365
- * Generate the TLObject from buffer.
366
- * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
367
- */
380
+ * Generate the TLObject from buffer.
381
+ * @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
382
+ */
368
383
  static async read(_data, ..._args) {
369
384
  // @ts-ignore
370
385
  let flags = await Primitive.Int.read(_data);
371
- let suggest = (flags & (1 << 3)) ? true : false;
372
- let save = (flags & (1 << 4)) ? true : false;
386
+ let suggest = flags & (1 << 3) ? true : false;
387
+ let save = flags & (1 << 4) ? true : false;
373
388
  let userId = await TLObject.read(_data);
374
- let file = (flags & (1 << 0)) ? await TLObject.read(_data) : undefined;
375
- let video = (flags & (1 << 1)) ? await TLObject.read(_data) : undefined;
376
- let videoStartTs = (flags & (1 << 2)) ? await Primitive.Double.read(_data) : undefined;
377
- let videoEmojiMarkup = (flags & (1 << 5)) ? await TLObject.read(_data) : undefined;
378
- return new UploadContactProfilePhoto({ "suggest": suggest, "save": save, "userId": userId, "file": file, "video": video, "videoStartTs": videoStartTs, "videoEmojiMarkup": videoEmojiMarkup });
389
+ let file = flags & (1 << 0) ? await TLObject.read(_data) : undefined;
390
+ let video = flags & (1 << 1) ? await TLObject.read(_data) : undefined;
391
+ let videoStartTs = flags & (1 << 2) ? await Primitive.Double.read(_data) : undefined;
392
+ let videoEmojiMarkup = flags & (1 << 5) ? await TLObject.read(_data) : undefined;
393
+ return new UploadContactProfilePhoto({
394
+ suggest: suggest,
395
+ save: save,
396
+ userId: userId,
397
+ file: file,
398
+ video: video,
399
+ videoStartTs: videoStartTs,
400
+ videoEmojiMarkup: videoEmojiMarkup,
401
+ });
379
402
  }
380
403
  /**
381
- * Generate buffer from TLObject.
382
- */
404
+ * Generate buffer from TLObject.
405
+ */
383
406
  write() {
384
407
  const b = new BytesIO();
385
408
  b.write(Primitive.Int.write(this.constructorId, false));
386
409
  // @ts-ignore
387
410
  let flags = 0;
388
- flags |= this.suggest ? (1 << 3) : 0;
389
- flags |= this.save ? (1 << 4) : 0;
390
- flags |= this.file !== undefined ? (1 << 0) : 0;
391
- flags |= this.video !== undefined ? (1 << 1) : 0;
392
- flags |= this.videoStartTs !== undefined ? (1 << 2) : 0;
393
- flags |= this.videoEmojiMarkup !== undefined ? (1 << 5) : 0;
394
- b.write((Primitive.Int.write(flags)));
411
+ flags |= this.suggest ? 1 << 3 : 0;
412
+ flags |= this.save ? 1 << 4 : 0;
413
+ flags |= this.file !== undefined ? 1 << 0 : 0;
414
+ flags |= this.video !== undefined ? 1 << 1 : 0;
415
+ flags |= this.videoStartTs !== undefined ? 1 << 2 : 0;
416
+ flags |= this.videoEmojiMarkup !== undefined ? 1 << 5 : 0;
417
+ b.write(Primitive.Int.write(flags));
395
418
  if (this.userId !== undefined) {
396
419
  b.write(this.userId.write());
397
420
  }
@@ -402,7 +425,7 @@ export class UploadContactProfilePhoto extends TLObject {
402
425
  b.write(this.video.write());
403
426
  }
404
427
  if (this.videoStartTs !== undefined) {
405
- b.write((Primitive.Double.write(this.videoStartTs)));
428
+ b.write(Primitive.Double.write(this.videoStartTs));
406
429
  }
407
430
  if (this.videoEmojiMarkup !== undefined) {
408
431
  b.write(this.videoEmojiMarkup.write());