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