@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.
- package/README.md +1 -1
- package/dist/src/deps.d.ts +4 -3
- package/dist/src/deps.js +4 -4
- package/dist/src/errors/RpcError.js +3 -1
- package/dist/src/helpers.js +19 -34
- package/dist/src/raw/class/All.d.ts +49 -5
- package/dist/src/raw/class/All.js +2783 -2739
- package/dist/src/raw/class/Raw.d.ts +7856 -7518
- package/dist/src/raw/class/Raw.js +27367 -20433
- 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 +353 -232
- package/dist/src/raw/class/tl/bots.js +871 -504
- package/dist/src/raw/class/tl/channels.d.ts +351 -331
- package/dist/src/raw/class/tl/channels.js +873 -735
- 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 +278 -0
- package/dist/src/raw/class/tl/feed.js +671 -0
- 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 +1901 -1851
- package/dist/src/raw/class/tl/messages.js +6043 -4855
- package/dist/src/raw/class/tl/payments.d.ts +677 -641
- package/dist/src/raw/class/tl/payments.js +2312 -1734
- 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 +257 -206
- package/dist/src/raw/class/tl/wallet.js +701 -525
- package/dist/src/raw/class/types.d.ts +3 -2
- package/dist/src/raw/class/types.js +1 -1
- package/dist/src/raw/core/GzipPacked.d.ts +4 -0
- package/dist/src/raw/core/GzipPacked.js +9 -1
- package/dist/src/raw/core/primitive/Bytes.js +26 -4
- package/dist/src/raw/core/primitive/Vector.js +11 -3
- package/package.json +7 -5
|
@@ -6,30 +6,30 @@
|
|
|
6
6
|
*
|
|
7
7
|
* tgsnake is a free software: you can redistribute it and/or modify
|
|
8
8
|
* it under the terms of the MIT License as published.
|
|
9
|
-
*/
|
|
9
|
+
*/
|
|
10
10
|
// This file is auto generate. All change made in this file will be lost!
|
|
11
11
|
import { TLObject, Primitive } from '../../core/index.js';
|
|
12
12
|
import { BytesIO } from '../../../deps.js';
|
|
13
13
|
export class TonesNotModified extends TLObject {
|
|
14
14
|
constructor() {
|
|
15
15
|
super();
|
|
16
|
-
this.classType =
|
|
17
|
-
this.className =
|
|
16
|
+
this.classType = 'types';
|
|
17
|
+
this.className = 'aicompose.TonesNotModified';
|
|
18
18
|
this.constructorId = 0xc1f46103;
|
|
19
19
|
this.subclassOfId = 0xf25ffed9;
|
|
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 TonesNotModified();
|
|
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));
|
|
@@ -43,41 +43,41 @@ export class Tones extends TLObject {
|
|
|
43
43
|
users;
|
|
44
44
|
constructor(params) {
|
|
45
45
|
super();
|
|
46
|
-
this.classType =
|
|
47
|
-
this.className =
|
|
46
|
+
this.classType = 'types';
|
|
47
|
+
this.className = 'aicompose.Tones';
|
|
48
48
|
this.constructorId = 0x6c9d0efe;
|
|
49
49
|
this.subclassOfId = 0xf25ffed9;
|
|
50
|
-
this._slots = [
|
|
50
|
+
this._slots = ['hash', 'tones', 'users'];
|
|
51
51
|
this.hash = params.hash;
|
|
52
52
|
this.tones = params.tones;
|
|
53
53
|
this.users = params.users;
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
* Generate the TLObject from buffer.
|
|
57
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
58
|
+
*/
|
|
59
59
|
static async read(_data, ..._args) {
|
|
60
60
|
// no flags
|
|
61
61
|
let hash = await Primitive.Long.read(_data);
|
|
62
62
|
let tones = await TLObject.read(_data);
|
|
63
63
|
let users = await TLObject.read(_data);
|
|
64
|
-
return new Tones({
|
|
64
|
+
return new Tones({ hash: hash, tones: tones, users: users });
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
* Generate buffer from TLObject.
|
|
68
|
+
*/
|
|
69
69
|
write() {
|
|
70
70
|
const b = new BytesIO();
|
|
71
71
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
72
72
|
// no flags
|
|
73
73
|
if (this.hash !== undefined) {
|
|
74
|
-
b.write(
|
|
74
|
+
b.write(Primitive.Long.write(this.hash));
|
|
75
75
|
}
|
|
76
76
|
if (this.tones) {
|
|
77
|
-
b.write(
|
|
77
|
+
b.write(Primitive.Vector.write(this.tones));
|
|
78
78
|
}
|
|
79
79
|
if (this.users) {
|
|
80
|
-
b.write(
|
|
80
|
+
b.write(Primitive.Vector.write(this.users));
|
|
81
81
|
}
|
|
82
82
|
return b.buffer;
|
|
83
83
|
}
|
|
@@ -90,47 +90,52 @@ export class CreateTone extends TLObject {
|
|
|
90
90
|
prompt;
|
|
91
91
|
constructor(params) {
|
|
92
92
|
super();
|
|
93
|
-
this.classType =
|
|
94
|
-
this.className =
|
|
93
|
+
this.classType = 'functions';
|
|
94
|
+
this.className = 'aicompose.CreateTone';
|
|
95
95
|
this.constructorId = 0x4aa83913;
|
|
96
96
|
this.subclassOfId = 0xd476f30d;
|
|
97
|
-
this._slots = [
|
|
97
|
+
this._slots = ['displayAuthor', 'emojiId', 'title', 'prompt'];
|
|
98
98
|
this.displayAuthor = params.displayAuthor;
|
|
99
99
|
this.emojiId = params.emojiId;
|
|
100
100
|
this.title = params.title;
|
|
101
101
|
this.prompt = params.prompt;
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
* Generate the TLObject from buffer.
|
|
105
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
106
|
+
*/
|
|
107
107
|
static async read(_data, ..._args) {
|
|
108
108
|
// @ts-ignore
|
|
109
109
|
let flags = await Primitive.Int.read(_data);
|
|
110
|
-
let displayAuthor =
|
|
110
|
+
let displayAuthor = flags & (1 << 0) ? true : false;
|
|
111
111
|
let emojiId = await Primitive.Long.read(_data);
|
|
112
112
|
let title = await Primitive.String.read(_data);
|
|
113
113
|
let prompt = await Primitive.String.read(_data);
|
|
114
|
-
return new CreateTone({
|
|
114
|
+
return new CreateTone({
|
|
115
|
+
displayAuthor: displayAuthor,
|
|
116
|
+
emojiId: emojiId,
|
|
117
|
+
title: title,
|
|
118
|
+
prompt: prompt,
|
|
119
|
+
});
|
|
115
120
|
}
|
|
116
121
|
/**
|
|
117
|
-
|
|
118
|
-
|
|
122
|
+
* Generate buffer from TLObject.
|
|
123
|
+
*/
|
|
119
124
|
write() {
|
|
120
125
|
const b = new BytesIO();
|
|
121
126
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
122
127
|
// @ts-ignore
|
|
123
128
|
let flags = 0;
|
|
124
|
-
flags |= this.displayAuthor ?
|
|
125
|
-
b.write(
|
|
129
|
+
flags |= this.displayAuthor ? 1 << 0 : 0;
|
|
130
|
+
b.write(Primitive.Int.write(flags));
|
|
126
131
|
if (this.emojiId !== undefined) {
|
|
127
|
-
b.write(
|
|
132
|
+
b.write(Primitive.Long.write(this.emojiId));
|
|
128
133
|
}
|
|
129
134
|
if (this.title !== undefined) {
|
|
130
|
-
b.write(
|
|
135
|
+
b.write(Primitive.String.write(this.title));
|
|
131
136
|
}
|
|
132
137
|
if (this.prompt !== undefined) {
|
|
133
|
-
b.write(
|
|
138
|
+
b.write(Primitive.String.write(this.prompt));
|
|
134
139
|
}
|
|
135
140
|
return b.buffer;
|
|
136
141
|
}
|
|
@@ -144,11 +149,11 @@ export class UpdateTone extends TLObject {
|
|
|
144
149
|
prompt;
|
|
145
150
|
constructor(params) {
|
|
146
151
|
super();
|
|
147
|
-
this.classType =
|
|
148
|
-
this.className =
|
|
152
|
+
this.classType = 'functions';
|
|
153
|
+
this.className = 'aicompose.UpdateTone';
|
|
149
154
|
this.constructorId = 0x903bcf59;
|
|
150
155
|
this.subclassOfId = 0xd476f30d;
|
|
151
|
-
this._slots = [
|
|
156
|
+
this._slots = ['tone', 'displayAuthor', 'emojiId', 'title', 'prompt'];
|
|
152
157
|
this.tone = params.tone;
|
|
153
158
|
this.displayAuthor = params.displayAuthor;
|
|
154
159
|
this.emojiId = params.emojiId;
|
|
@@ -156,46 +161,52 @@ export class UpdateTone extends TLObject {
|
|
|
156
161
|
this.prompt = params.prompt;
|
|
157
162
|
}
|
|
158
163
|
/**
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
164
|
+
* Generate the TLObject from buffer.
|
|
165
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
166
|
+
*/
|
|
162
167
|
static async read(_data, ..._args) {
|
|
163
168
|
// @ts-ignore
|
|
164
169
|
let flags = await Primitive.Int.read(_data);
|
|
165
170
|
let tone = await TLObject.read(_data);
|
|
166
|
-
let displayAuthor =
|
|
167
|
-
let emojiId =
|
|
168
|
-
let title =
|
|
169
|
-
let prompt =
|
|
170
|
-
return new UpdateTone({
|
|
171
|
+
let displayAuthor = flags & (1 << 0) ? await Primitive.Bool.read(_data) : undefined;
|
|
172
|
+
let emojiId = flags & (1 << 1) ? await Primitive.Long.read(_data) : undefined;
|
|
173
|
+
let title = flags & (1 << 2) ? await Primitive.String.read(_data) : undefined;
|
|
174
|
+
let prompt = flags & (1 << 3) ? await Primitive.String.read(_data) : undefined;
|
|
175
|
+
return new UpdateTone({
|
|
176
|
+
tone: tone,
|
|
177
|
+
displayAuthor: displayAuthor,
|
|
178
|
+
emojiId: emojiId,
|
|
179
|
+
title: title,
|
|
180
|
+
prompt: prompt,
|
|
181
|
+
});
|
|
171
182
|
}
|
|
172
183
|
/**
|
|
173
|
-
|
|
174
|
-
|
|
184
|
+
* Generate buffer from TLObject.
|
|
185
|
+
*/
|
|
175
186
|
write() {
|
|
176
187
|
const b = new BytesIO();
|
|
177
188
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
178
189
|
// @ts-ignore
|
|
179
190
|
let flags = 0;
|
|
180
|
-
flags |= this.displayAuthor !== undefined ?
|
|
181
|
-
flags |= this.emojiId !== undefined ?
|
|
182
|
-
flags |= this.title !== undefined ?
|
|
183
|
-
flags |= this.prompt !== undefined ?
|
|
184
|
-
b.write(
|
|
191
|
+
flags |= this.displayAuthor !== undefined ? 1 << 0 : 0;
|
|
192
|
+
flags |= this.emojiId !== undefined ? 1 << 1 : 0;
|
|
193
|
+
flags |= this.title !== undefined ? 1 << 2 : 0;
|
|
194
|
+
flags |= this.prompt !== undefined ? 1 << 3 : 0;
|
|
195
|
+
b.write(Primitive.Int.write(flags));
|
|
185
196
|
if (this.tone !== undefined) {
|
|
186
197
|
b.write(this.tone.write());
|
|
187
198
|
}
|
|
188
199
|
if (this.displayAuthor !== undefined) {
|
|
189
|
-
b.write(
|
|
200
|
+
b.write(Primitive.Bool.write(this.displayAuthor));
|
|
190
201
|
}
|
|
191
202
|
if (this.emojiId !== undefined) {
|
|
192
|
-
b.write(
|
|
203
|
+
b.write(Primitive.Long.write(this.emojiId));
|
|
193
204
|
}
|
|
194
205
|
if (this.title !== undefined) {
|
|
195
|
-
b.write(
|
|
206
|
+
b.write(Primitive.String.write(this.title));
|
|
196
207
|
}
|
|
197
208
|
if (this.prompt !== undefined) {
|
|
198
|
-
b.write(
|
|
209
|
+
b.write(Primitive.String.write(this.prompt));
|
|
199
210
|
}
|
|
200
211
|
return b.buffer;
|
|
201
212
|
}
|
|
@@ -206,27 +217,27 @@ export class SaveTone extends TLObject {
|
|
|
206
217
|
unsave;
|
|
207
218
|
constructor(params) {
|
|
208
219
|
super();
|
|
209
|
-
this.classType =
|
|
210
|
-
this.className =
|
|
220
|
+
this.classType = 'functions';
|
|
221
|
+
this.className = 'aicompose.SaveTone';
|
|
211
222
|
this.constructorId = 0x1782cbb1;
|
|
212
223
|
this.subclassOfId = 0xf5b399ac;
|
|
213
|
-
this._slots = [
|
|
224
|
+
this._slots = ['tone', 'unsave'];
|
|
214
225
|
this.tone = params.tone;
|
|
215
226
|
this.unsave = params.unsave;
|
|
216
227
|
}
|
|
217
228
|
/**
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
229
|
+
* Generate the TLObject from buffer.
|
|
230
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
231
|
+
*/
|
|
221
232
|
static async read(_data, ..._args) {
|
|
222
233
|
// no flags
|
|
223
234
|
let tone = await TLObject.read(_data);
|
|
224
235
|
let unsave = await Primitive.Bool.read(_data);
|
|
225
|
-
return new SaveTone({
|
|
236
|
+
return new SaveTone({ tone: tone, unsave: unsave });
|
|
226
237
|
}
|
|
227
238
|
/**
|
|
228
|
-
|
|
229
|
-
|
|
239
|
+
* Generate buffer from TLObject.
|
|
240
|
+
*/
|
|
230
241
|
write() {
|
|
231
242
|
const b = new BytesIO();
|
|
232
243
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -235,7 +246,7 @@ export class SaveTone extends TLObject {
|
|
|
235
246
|
b.write(this.tone.write());
|
|
236
247
|
}
|
|
237
248
|
if (this.unsave !== undefined) {
|
|
238
|
-
b.write(
|
|
249
|
+
b.write(Primitive.Bool.write(this.unsave));
|
|
239
250
|
}
|
|
240
251
|
return b.buffer;
|
|
241
252
|
}
|
|
@@ -245,25 +256,25 @@ export class DeleteTone extends TLObject {
|
|
|
245
256
|
tone;
|
|
246
257
|
constructor(params) {
|
|
247
258
|
super();
|
|
248
|
-
this.classType =
|
|
249
|
-
this.className =
|
|
259
|
+
this.classType = 'functions';
|
|
260
|
+
this.className = 'aicompose.DeleteTone';
|
|
250
261
|
this.constructorId = 0xdd39316a;
|
|
251
262
|
this.subclassOfId = 0xf5b399ac;
|
|
252
|
-
this._slots = [
|
|
263
|
+
this._slots = ['tone'];
|
|
253
264
|
this.tone = params.tone;
|
|
254
265
|
}
|
|
255
266
|
/**
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
267
|
+
* Generate the TLObject from buffer.
|
|
268
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
269
|
+
*/
|
|
259
270
|
static async read(_data, ..._args) {
|
|
260
271
|
// no flags
|
|
261
272
|
let tone = await TLObject.read(_data);
|
|
262
|
-
return new DeleteTone({
|
|
273
|
+
return new DeleteTone({ tone: tone });
|
|
263
274
|
}
|
|
264
275
|
/**
|
|
265
|
-
|
|
266
|
-
|
|
276
|
+
* Generate buffer from TLObject.
|
|
277
|
+
*/
|
|
267
278
|
write() {
|
|
268
279
|
const b = new BytesIO();
|
|
269
280
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -279,25 +290,25 @@ export class GetTone extends TLObject {
|
|
|
279
290
|
tone;
|
|
280
291
|
constructor(params) {
|
|
281
292
|
super();
|
|
282
|
-
this.classType =
|
|
283
|
-
this.className =
|
|
293
|
+
this.classType = 'functions';
|
|
294
|
+
this.className = 'aicompose.GetTone';
|
|
284
295
|
this.constructorId = 0xb2e8ba03;
|
|
285
296
|
this.subclassOfId = 0xf25ffed9;
|
|
286
|
-
this._slots = [
|
|
297
|
+
this._slots = ['tone'];
|
|
287
298
|
this.tone = params.tone;
|
|
288
299
|
}
|
|
289
300
|
/**
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
301
|
+
* Generate the TLObject from buffer.
|
|
302
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
303
|
+
*/
|
|
293
304
|
static async read(_data, ..._args) {
|
|
294
305
|
// no flags
|
|
295
306
|
let tone = await TLObject.read(_data);
|
|
296
|
-
return new GetTone({
|
|
307
|
+
return new GetTone({ tone: tone });
|
|
297
308
|
}
|
|
298
309
|
/**
|
|
299
|
-
|
|
300
|
-
|
|
310
|
+
* Generate buffer from TLObject.
|
|
311
|
+
*/
|
|
301
312
|
write() {
|
|
302
313
|
const b = new BytesIO();
|
|
303
314
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -313,31 +324,31 @@ export class GetTones extends TLObject {
|
|
|
313
324
|
hash;
|
|
314
325
|
constructor(params) {
|
|
315
326
|
super();
|
|
316
|
-
this.classType =
|
|
317
|
-
this.className =
|
|
327
|
+
this.classType = 'functions';
|
|
328
|
+
this.className = 'aicompose.GetTones';
|
|
318
329
|
this.constructorId = 0xabd59201;
|
|
319
330
|
this.subclassOfId = 0xf25ffed9;
|
|
320
|
-
this._slots = [
|
|
331
|
+
this._slots = ['hash'];
|
|
321
332
|
this.hash = params.hash;
|
|
322
333
|
}
|
|
323
334
|
/**
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
335
|
+
* Generate the TLObject from buffer.
|
|
336
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
337
|
+
*/
|
|
327
338
|
static async read(_data, ..._args) {
|
|
328
339
|
// no flags
|
|
329
340
|
let hash = await Primitive.Long.read(_data);
|
|
330
|
-
return new GetTones({
|
|
341
|
+
return new GetTones({ hash: hash });
|
|
331
342
|
}
|
|
332
343
|
/**
|
|
333
|
-
|
|
334
|
-
|
|
344
|
+
* Generate buffer from TLObject.
|
|
345
|
+
*/
|
|
335
346
|
write() {
|
|
336
347
|
const b = new BytesIO();
|
|
337
348
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
338
349
|
// no flags
|
|
339
350
|
if (this.hash !== undefined) {
|
|
340
|
-
b.write(
|
|
351
|
+
b.write(Primitive.Long.write(this.hash));
|
|
341
352
|
}
|
|
342
353
|
return b.buffer;
|
|
343
354
|
}
|
|
@@ -348,27 +359,27 @@ export class GetToneExample extends TLObject {
|
|
|
348
359
|
num;
|
|
349
360
|
constructor(params) {
|
|
350
361
|
super();
|
|
351
|
-
this.classType =
|
|
352
|
-
this.className =
|
|
362
|
+
this.classType = 'functions';
|
|
363
|
+
this.className = 'aicompose.GetToneExample';
|
|
353
364
|
this.constructorId = 0xd1b4ab14;
|
|
354
365
|
this.subclassOfId = 0x8c2493d5;
|
|
355
|
-
this._slots = [
|
|
366
|
+
this._slots = ['tone', 'num'];
|
|
356
367
|
this.tone = params.tone;
|
|
357
368
|
this.num = params.num;
|
|
358
369
|
}
|
|
359
370
|
/**
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
371
|
+
* Generate the TLObject from buffer.
|
|
372
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
373
|
+
*/
|
|
363
374
|
static async read(_data, ..._args) {
|
|
364
375
|
// no flags
|
|
365
376
|
let tone = await TLObject.read(_data);
|
|
366
377
|
let num = await Primitive.Int.read(_data);
|
|
367
|
-
return new GetToneExample({
|
|
378
|
+
return new GetToneExample({ tone: tone, num: num });
|
|
368
379
|
}
|
|
369
380
|
/**
|
|
370
|
-
|
|
371
|
-
|
|
381
|
+
* Generate buffer from TLObject.
|
|
382
|
+
*/
|
|
372
383
|
write() {
|
|
373
384
|
const b = new BytesIO();
|
|
374
385
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -377,7 +388,7 @@ export class GetToneExample extends TLObject {
|
|
|
377
388
|
b.write(this.tone.write());
|
|
378
389
|
}
|
|
379
390
|
if (this.num !== undefined) {
|
|
380
|
-
b.write(
|
|
391
|
+
b.write(Primitive.Int.write(this.num));
|
|
381
392
|
}
|
|
382
393
|
return b.buffer;
|
|
383
394
|
}
|
|
@@ -388,35 +399,35 @@ export class SetChatStyle extends TLObject {
|
|
|
388
399
|
style;
|
|
389
400
|
constructor(params) {
|
|
390
401
|
super();
|
|
391
|
-
this.classType =
|
|
392
|
-
this.className =
|
|
402
|
+
this.classType = 'functions';
|
|
403
|
+
this.className = 'aicompose.SetChatStyle';
|
|
393
404
|
this.constructorId = 0x5d9939c0;
|
|
394
405
|
this.subclassOfId = 0xf5b399ac;
|
|
395
|
-
this._slots = [
|
|
406
|
+
this._slots = ['peer', 'style'];
|
|
396
407
|
this.peer = params.peer;
|
|
397
408
|
this.style = params.style;
|
|
398
409
|
}
|
|
399
410
|
/**
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
411
|
+
* Generate the TLObject from buffer.
|
|
412
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
413
|
+
*/
|
|
403
414
|
static async read(_data, ..._args) {
|
|
404
415
|
// @ts-ignore
|
|
405
416
|
let flags = await Primitive.Int.read(_data);
|
|
406
417
|
let peer = await TLObject.read(_data);
|
|
407
|
-
let style =
|
|
408
|
-
return new SetChatStyle({
|
|
418
|
+
let style = flags & (1 << 0) ? await TLObject.read(_data) : undefined;
|
|
419
|
+
return new SetChatStyle({ peer: peer, style: style });
|
|
409
420
|
}
|
|
410
421
|
/**
|
|
411
|
-
|
|
412
|
-
|
|
422
|
+
* Generate buffer from TLObject.
|
|
423
|
+
*/
|
|
413
424
|
write() {
|
|
414
425
|
const b = new BytesIO();
|
|
415
426
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
416
427
|
// @ts-ignore
|
|
417
428
|
let flags = 0;
|
|
418
|
-
flags |= this.style !== undefined ?
|
|
419
|
-
b.write(
|
|
429
|
+
flags |= this.style !== undefined ? 1 << 0 : 0;
|
|
430
|
+
b.write(Primitive.Int.write(flags));
|
|
420
431
|
if (this.peer !== undefined) {
|
|
421
432
|
b.write(this.peer.write());
|
|
422
433
|
}
|