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