@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,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';
|
|
@@ -17,46 +17,51 @@ export class ChannelParticipants extends TLObject {
|
|
|
17
17
|
users;
|
|
18
18
|
constructor(params) {
|
|
19
19
|
super();
|
|
20
|
-
this.classType =
|
|
21
|
-
this.className =
|
|
20
|
+
this.classType = 'types';
|
|
21
|
+
this.className = 'channels.ChannelParticipants';
|
|
22
22
|
this.constructorId = 0x9ab0feaf;
|
|
23
23
|
this.subclassOfId = 0xe60a6e64;
|
|
24
|
-
this._slots = [
|
|
24
|
+
this._slots = ['count', 'participants', 'chats', 'users'];
|
|
25
25
|
this.count = params.count;
|
|
26
26
|
this.participants = params.participants;
|
|
27
27
|
this.chats = params.chats;
|
|
28
28
|
this.users = params.users;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
* Generate the TLObject from buffer.
|
|
32
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
33
|
+
*/
|
|
34
34
|
static async read(_data, ..._args) {
|
|
35
35
|
// no flags
|
|
36
36
|
let count = await Primitive.Int.read(_data);
|
|
37
37
|
let participants = await TLObject.read(_data);
|
|
38
38
|
let chats = await TLObject.read(_data);
|
|
39
39
|
let users = await TLObject.read(_data);
|
|
40
|
-
return new ChannelParticipants({
|
|
40
|
+
return new ChannelParticipants({
|
|
41
|
+
count: count,
|
|
42
|
+
participants: participants,
|
|
43
|
+
chats: chats,
|
|
44
|
+
users: users,
|
|
45
|
+
});
|
|
41
46
|
}
|
|
42
47
|
/**
|
|
43
|
-
|
|
44
|
-
|
|
48
|
+
* Generate buffer from TLObject.
|
|
49
|
+
*/
|
|
45
50
|
write() {
|
|
46
51
|
const b = new BytesIO();
|
|
47
52
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
48
53
|
// no flags
|
|
49
54
|
if (this.count !== undefined) {
|
|
50
|
-
b.write(
|
|
55
|
+
b.write(Primitive.Int.write(this.count));
|
|
51
56
|
}
|
|
52
57
|
if (this.participants) {
|
|
53
|
-
b.write(
|
|
58
|
+
b.write(Primitive.Vector.write(this.participants));
|
|
54
59
|
}
|
|
55
60
|
if (this.chats) {
|
|
56
|
-
b.write(
|
|
61
|
+
b.write(Primitive.Vector.write(this.chats));
|
|
57
62
|
}
|
|
58
63
|
if (this.users) {
|
|
59
|
-
b.write(
|
|
64
|
+
b.write(Primitive.Vector.write(this.users));
|
|
60
65
|
}
|
|
61
66
|
return b.buffer;
|
|
62
67
|
}
|
|
@@ -64,23 +69,23 @@ export class ChannelParticipants extends TLObject {
|
|
|
64
69
|
export class ChannelParticipantsNotModified extends TLObject {
|
|
65
70
|
constructor() {
|
|
66
71
|
super();
|
|
67
|
-
this.classType =
|
|
68
|
-
this.className =
|
|
72
|
+
this.classType = 'types';
|
|
73
|
+
this.className = 'channels.ChannelParticipantsNotModified';
|
|
69
74
|
this.constructorId = 0xf0173fe9;
|
|
70
75
|
this.subclassOfId = 0xe60a6e64;
|
|
71
76
|
this._slots = [];
|
|
72
77
|
}
|
|
73
78
|
/**
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
79
|
+
* Generate the TLObject from buffer.
|
|
80
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
81
|
+
*/
|
|
77
82
|
static async read(_data, ..._args) {
|
|
78
83
|
// no flags
|
|
79
84
|
return new ChannelParticipantsNotModified();
|
|
80
85
|
}
|
|
81
86
|
/**
|
|
82
|
-
|
|
83
|
-
|
|
87
|
+
* Generate buffer from TLObject.
|
|
88
|
+
*/
|
|
84
89
|
write() {
|
|
85
90
|
const b = new BytesIO();
|
|
86
91
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -94,29 +99,29 @@ export class ChannelParticipant extends TLObject {
|
|
|
94
99
|
users;
|
|
95
100
|
constructor(params) {
|
|
96
101
|
super();
|
|
97
|
-
this.classType =
|
|
98
|
-
this.className =
|
|
102
|
+
this.classType = 'types';
|
|
103
|
+
this.className = 'channels.ChannelParticipant';
|
|
99
104
|
this.constructorId = 0xdfb80317;
|
|
100
105
|
this.subclassOfId = 0x6658151a;
|
|
101
|
-
this._slots = [
|
|
106
|
+
this._slots = ['participant', 'chats', 'users'];
|
|
102
107
|
this.participant = params.participant;
|
|
103
108
|
this.chats = params.chats;
|
|
104
109
|
this.users = params.users;
|
|
105
110
|
}
|
|
106
111
|
/**
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
112
|
+
* Generate the TLObject from buffer.
|
|
113
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
114
|
+
*/
|
|
110
115
|
static async read(_data, ..._args) {
|
|
111
116
|
// no flags
|
|
112
117
|
let participant = await TLObject.read(_data);
|
|
113
118
|
let chats = await TLObject.read(_data);
|
|
114
119
|
let users = await TLObject.read(_data);
|
|
115
|
-
return new ChannelParticipant({
|
|
120
|
+
return new ChannelParticipant({ participant: participant, chats: chats, users: users });
|
|
116
121
|
}
|
|
117
122
|
/**
|
|
118
|
-
|
|
119
|
-
|
|
123
|
+
* Generate buffer from TLObject.
|
|
124
|
+
*/
|
|
120
125
|
write() {
|
|
121
126
|
const b = new BytesIO();
|
|
122
127
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -125,10 +130,10 @@ export class ChannelParticipant extends TLObject {
|
|
|
125
130
|
b.write(this.participant.write());
|
|
126
131
|
}
|
|
127
132
|
if (this.chats) {
|
|
128
|
-
b.write(
|
|
133
|
+
b.write(Primitive.Vector.write(this.chats));
|
|
129
134
|
}
|
|
130
135
|
if (this.users) {
|
|
131
|
-
b.write(
|
|
136
|
+
b.write(Primitive.Vector.write(this.users));
|
|
132
137
|
}
|
|
133
138
|
return b.buffer;
|
|
134
139
|
}
|
|
@@ -139,41 +144,41 @@ export class AdminLogResults extends TLObject {
|
|
|
139
144
|
users;
|
|
140
145
|
constructor(params) {
|
|
141
146
|
super();
|
|
142
|
-
this.classType =
|
|
143
|
-
this.className =
|
|
147
|
+
this.classType = 'types';
|
|
148
|
+
this.className = 'channels.AdminLogResults';
|
|
144
149
|
this.constructorId = 0xed8af74d;
|
|
145
150
|
this.subclassOfId = 0x51f076bc;
|
|
146
|
-
this._slots = [
|
|
151
|
+
this._slots = ['events', 'chats', 'users'];
|
|
147
152
|
this.events = params.events;
|
|
148
153
|
this.chats = params.chats;
|
|
149
154
|
this.users = params.users;
|
|
150
155
|
}
|
|
151
156
|
/**
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
157
|
+
* Generate the TLObject from buffer.
|
|
158
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
159
|
+
*/
|
|
155
160
|
static async read(_data, ..._args) {
|
|
156
161
|
// no flags
|
|
157
162
|
let events = await TLObject.read(_data);
|
|
158
163
|
let chats = await TLObject.read(_data);
|
|
159
164
|
let users = await TLObject.read(_data);
|
|
160
|
-
return new AdminLogResults({
|
|
165
|
+
return new AdminLogResults({ events: events, chats: chats, users: users });
|
|
161
166
|
}
|
|
162
167
|
/**
|
|
163
|
-
|
|
164
|
-
|
|
168
|
+
* Generate buffer from TLObject.
|
|
169
|
+
*/
|
|
165
170
|
write() {
|
|
166
171
|
const b = new BytesIO();
|
|
167
172
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
168
173
|
// no flags
|
|
169
174
|
if (this.events) {
|
|
170
|
-
b.write(
|
|
175
|
+
b.write(Primitive.Vector.write(this.events));
|
|
171
176
|
}
|
|
172
177
|
if (this.chats) {
|
|
173
|
-
b.write(
|
|
178
|
+
b.write(Primitive.Vector.write(this.chats));
|
|
174
179
|
}
|
|
175
180
|
if (this.users) {
|
|
176
|
-
b.write(
|
|
181
|
+
b.write(Primitive.Vector.write(this.users));
|
|
177
182
|
}
|
|
178
183
|
return b.buffer;
|
|
179
184
|
}
|
|
@@ -184,41 +189,41 @@ export class SendAsPeers extends TLObject {
|
|
|
184
189
|
users;
|
|
185
190
|
constructor(params) {
|
|
186
191
|
super();
|
|
187
|
-
this.classType =
|
|
188
|
-
this.className =
|
|
192
|
+
this.classType = 'types';
|
|
193
|
+
this.className = 'channels.SendAsPeers';
|
|
189
194
|
this.constructorId = 0xf496b0c6;
|
|
190
195
|
this.subclassOfId = 0x38cb8d21;
|
|
191
|
-
this._slots = [
|
|
196
|
+
this._slots = ['peers', 'chats', 'users'];
|
|
192
197
|
this.peers = params.peers;
|
|
193
198
|
this.chats = params.chats;
|
|
194
199
|
this.users = params.users;
|
|
195
200
|
}
|
|
196
201
|
/**
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
202
|
+
* Generate the TLObject from buffer.
|
|
203
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
204
|
+
*/
|
|
200
205
|
static async read(_data, ..._args) {
|
|
201
206
|
// no flags
|
|
202
207
|
let peers = await TLObject.read(_data);
|
|
203
208
|
let chats = await TLObject.read(_data);
|
|
204
209
|
let users = await TLObject.read(_data);
|
|
205
|
-
return new SendAsPeers({
|
|
210
|
+
return new SendAsPeers({ peers: peers, chats: chats, users: users });
|
|
206
211
|
}
|
|
207
212
|
/**
|
|
208
|
-
|
|
209
|
-
|
|
213
|
+
* Generate buffer from TLObject.
|
|
214
|
+
*/
|
|
210
215
|
write() {
|
|
211
216
|
const b = new BytesIO();
|
|
212
217
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
213
218
|
// no flags
|
|
214
219
|
if (this.peers) {
|
|
215
|
-
b.write(
|
|
220
|
+
b.write(Primitive.Vector.write(this.peers));
|
|
216
221
|
}
|
|
217
222
|
if (this.chats) {
|
|
218
|
-
b.write(
|
|
223
|
+
b.write(Primitive.Vector.write(this.chats));
|
|
219
224
|
}
|
|
220
225
|
if (this.users) {
|
|
221
|
-
b.write(
|
|
226
|
+
b.write(Primitive.Vector.write(this.users));
|
|
222
227
|
}
|
|
223
228
|
return b.buffer;
|
|
224
229
|
}
|
|
@@ -228,36 +233,36 @@ export class SponsoredMessageReportResultChooseOption extends TLObject {
|
|
|
228
233
|
options;
|
|
229
234
|
constructor(params) {
|
|
230
235
|
super();
|
|
231
|
-
this.classType =
|
|
232
|
-
this.className =
|
|
236
|
+
this.classType = 'types';
|
|
237
|
+
this.className = 'channels.SponsoredMessageReportResultChooseOption';
|
|
233
238
|
this.constructorId = 0x846f9e42;
|
|
234
239
|
this.subclassOfId = 0x26231822;
|
|
235
|
-
this._slots = [
|
|
240
|
+
this._slots = ['title', 'options'];
|
|
236
241
|
this.title = params.title;
|
|
237
242
|
this.options = params.options;
|
|
238
243
|
}
|
|
239
244
|
/**
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
245
|
+
* Generate the TLObject from buffer.
|
|
246
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
247
|
+
*/
|
|
243
248
|
static async read(_data, ..._args) {
|
|
244
249
|
// no flags
|
|
245
250
|
let title = await Primitive.String.read(_data);
|
|
246
251
|
let options = await TLObject.read(_data);
|
|
247
|
-
return new SponsoredMessageReportResultChooseOption({
|
|
252
|
+
return new SponsoredMessageReportResultChooseOption({ title: title, options: options });
|
|
248
253
|
}
|
|
249
254
|
/**
|
|
250
|
-
|
|
251
|
-
|
|
255
|
+
* Generate buffer from TLObject.
|
|
256
|
+
*/
|
|
252
257
|
write() {
|
|
253
258
|
const b = new BytesIO();
|
|
254
259
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
255
260
|
// no flags
|
|
256
261
|
if (this.title !== undefined) {
|
|
257
|
-
b.write(
|
|
262
|
+
b.write(Primitive.String.write(this.title));
|
|
258
263
|
}
|
|
259
264
|
if (this.options) {
|
|
260
|
-
b.write(
|
|
265
|
+
b.write(Primitive.Vector.write(this.options));
|
|
261
266
|
}
|
|
262
267
|
return b.buffer;
|
|
263
268
|
}
|
|
@@ -265,23 +270,23 @@ export class SponsoredMessageReportResultChooseOption extends TLObject {
|
|
|
265
270
|
export class SponsoredMessageReportResultAdsHidden extends TLObject {
|
|
266
271
|
constructor() {
|
|
267
272
|
super();
|
|
268
|
-
this.classType =
|
|
269
|
-
this.className =
|
|
273
|
+
this.classType = 'types';
|
|
274
|
+
this.className = 'channels.SponsoredMessageReportResultAdsHidden';
|
|
270
275
|
this.constructorId = 0x3e3bcf2f;
|
|
271
276
|
this.subclassOfId = 0x26231822;
|
|
272
277
|
this._slots = [];
|
|
273
278
|
}
|
|
274
279
|
/**
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
280
|
+
* Generate the TLObject from buffer.
|
|
281
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
282
|
+
*/
|
|
278
283
|
static async read(_data, ..._args) {
|
|
279
284
|
// no flags
|
|
280
285
|
return new SponsoredMessageReportResultAdsHidden();
|
|
281
286
|
}
|
|
282
287
|
/**
|
|
283
|
-
|
|
284
|
-
|
|
288
|
+
* Generate buffer from TLObject.
|
|
289
|
+
*/
|
|
285
290
|
write() {
|
|
286
291
|
const b = new BytesIO();
|
|
287
292
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -292,23 +297,23 @@ export class SponsoredMessageReportResultAdsHidden extends TLObject {
|
|
|
292
297
|
export class SponsoredMessageReportResultReported extends TLObject {
|
|
293
298
|
constructor() {
|
|
294
299
|
super();
|
|
295
|
-
this.classType =
|
|
296
|
-
this.className =
|
|
300
|
+
this.classType = 'types';
|
|
301
|
+
this.className = 'channels.SponsoredMessageReportResultReported';
|
|
297
302
|
this.constructorId = 0xad798849;
|
|
298
303
|
this.subclassOfId = 0x26231822;
|
|
299
304
|
this._slots = [];
|
|
300
305
|
}
|
|
301
306
|
/**
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
307
|
+
* Generate the TLObject from buffer.
|
|
308
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
309
|
+
*/
|
|
305
310
|
static async read(_data, ..._args) {
|
|
306
311
|
// no flags
|
|
307
312
|
return new SponsoredMessageReportResultReported();
|
|
308
313
|
}
|
|
309
314
|
/**
|
|
310
|
-
|
|
311
|
-
|
|
315
|
+
* Generate buffer from TLObject.
|
|
316
|
+
*/
|
|
312
317
|
write() {
|
|
313
318
|
const b = new BytesIO();
|
|
314
319
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -322,27 +327,27 @@ export class ReadHistory extends TLObject {
|
|
|
322
327
|
maxId;
|
|
323
328
|
constructor(params) {
|
|
324
329
|
super();
|
|
325
|
-
this.classType =
|
|
326
|
-
this.className =
|
|
330
|
+
this.classType = 'functions';
|
|
331
|
+
this.className = 'channels.ReadHistory';
|
|
327
332
|
this.constructorId = 0xcc104937;
|
|
328
333
|
this.subclassOfId = 0xf5b399ac;
|
|
329
|
-
this._slots = [
|
|
334
|
+
this._slots = ['channel', 'maxId'];
|
|
330
335
|
this.channel = params.channel;
|
|
331
336
|
this.maxId = params.maxId;
|
|
332
337
|
}
|
|
333
338
|
/**
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
339
|
+
* Generate the TLObject from buffer.
|
|
340
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
341
|
+
*/
|
|
337
342
|
static async read(_data, ..._args) {
|
|
338
343
|
// no flags
|
|
339
344
|
let channel = await TLObject.read(_data);
|
|
340
345
|
let maxId = await Primitive.Int.read(_data);
|
|
341
|
-
return new ReadHistory({
|
|
346
|
+
return new ReadHistory({ channel: channel, maxId: maxId });
|
|
342
347
|
}
|
|
343
348
|
/**
|
|
344
|
-
|
|
345
|
-
|
|
349
|
+
* Generate buffer from TLObject.
|
|
350
|
+
*/
|
|
346
351
|
write() {
|
|
347
352
|
const b = new BytesIO();
|
|
348
353
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -351,7 +356,7 @@ export class ReadHistory extends TLObject {
|
|
|
351
356
|
b.write(this.channel.write());
|
|
352
357
|
}
|
|
353
358
|
if (this.maxId !== undefined) {
|
|
354
|
-
b.write(
|
|
359
|
+
b.write(Primitive.Int.write(this.maxId));
|
|
355
360
|
}
|
|
356
361
|
return b.buffer;
|
|
357
362
|
}
|
|
@@ -362,27 +367,27 @@ export class DeleteMessages extends TLObject {
|
|
|
362
367
|
id;
|
|
363
368
|
constructor(params) {
|
|
364
369
|
super();
|
|
365
|
-
this.classType =
|
|
366
|
-
this.className =
|
|
370
|
+
this.classType = 'functions';
|
|
371
|
+
this.className = 'channels.DeleteMessages';
|
|
367
372
|
this.constructorId = 0x84c1fd4e;
|
|
368
373
|
this.subclassOfId = 0xced3c06e;
|
|
369
|
-
this._slots = [
|
|
374
|
+
this._slots = ['channel', 'id'];
|
|
370
375
|
this.channel = params.channel;
|
|
371
376
|
this.id = params.id;
|
|
372
377
|
}
|
|
373
378
|
/**
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
379
|
+
* Generate the TLObject from buffer.
|
|
380
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
381
|
+
*/
|
|
377
382
|
static async read(_data, ..._args) {
|
|
378
383
|
// no flags
|
|
379
384
|
let channel = await TLObject.read(_data);
|
|
380
385
|
let id = await TLObject.read(_data, Primitive.Int);
|
|
381
|
-
return new DeleteMessages({
|
|
386
|
+
return new DeleteMessages({ channel: channel, id: id });
|
|
382
387
|
}
|
|
383
388
|
/**
|
|
384
|
-
|
|
385
|
-
|
|
389
|
+
* Generate buffer from TLObject.
|
|
390
|
+
*/
|
|
386
391
|
write() {
|
|
387
392
|
const b = new BytesIO();
|
|
388
393
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -391,7 +396,7 @@ export class DeleteMessages extends TLObject {
|
|
|
391
396
|
b.write(this.channel.write());
|
|
392
397
|
}
|
|
393
398
|
if (this.id) {
|
|
394
|
-
b.write(
|
|
399
|
+
b.write(Primitive.Vector.write(this.id, Primitive.Int));
|
|
395
400
|
}
|
|
396
401
|
return b.buffer;
|
|
397
402
|
}
|
|
@@ -403,29 +408,29 @@ export class ReportSpam extends TLObject {
|
|
|
403
408
|
id;
|
|
404
409
|
constructor(params) {
|
|
405
410
|
super();
|
|
406
|
-
this.classType =
|
|
407
|
-
this.className =
|
|
411
|
+
this.classType = 'functions';
|
|
412
|
+
this.className = 'channels.ReportSpam';
|
|
408
413
|
this.constructorId = 0xf44a8315;
|
|
409
414
|
this.subclassOfId = 0xf5b399ac;
|
|
410
|
-
this._slots = [
|
|
415
|
+
this._slots = ['channel', 'participant', 'id'];
|
|
411
416
|
this.channel = params.channel;
|
|
412
417
|
this.participant = params.participant;
|
|
413
418
|
this.id = params.id;
|
|
414
419
|
}
|
|
415
420
|
/**
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
421
|
+
* Generate the TLObject from buffer.
|
|
422
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
423
|
+
*/
|
|
419
424
|
static async read(_data, ..._args) {
|
|
420
425
|
// no flags
|
|
421
426
|
let channel = await TLObject.read(_data);
|
|
422
427
|
let participant = await TLObject.read(_data);
|
|
423
428
|
let id = await TLObject.read(_data, Primitive.Int);
|
|
424
|
-
return new ReportSpam({
|
|
429
|
+
return new ReportSpam({ channel: channel, participant: participant, id: id });
|
|
425
430
|
}
|
|
426
431
|
/**
|
|
427
|
-
|
|
428
|
-
|
|
432
|
+
* Generate buffer from TLObject.
|
|
433
|
+
*/
|
|
429
434
|
write() {
|
|
430
435
|
const b = new BytesIO();
|
|
431
436
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -437,7 +442,7 @@ export class ReportSpam extends TLObject {
|
|
|
437
442
|
b.write(this.participant.write());
|
|
438
443
|
}
|
|
439
444
|
if (this.id) {
|
|
440
|
-
b.write(
|
|
445
|
+
b.write(Primitive.Vector.write(this.id, Primitive.Int));
|
|
441
446
|
}
|
|
442
447
|
return b.buffer;
|
|
443
448
|
}
|
|
@@ -448,27 +453,27 @@ export class GetMessages extends TLObject {
|
|
|
448
453
|
id;
|
|
449
454
|
constructor(params) {
|
|
450
455
|
super();
|
|
451
|
-
this.classType =
|
|
452
|
-
this.className =
|
|
456
|
+
this.classType = 'functions';
|
|
457
|
+
this.className = 'channels.GetMessages';
|
|
453
458
|
this.constructorId = 0xad8c9a23;
|
|
454
459
|
this.subclassOfId = 0xd4b40b5e;
|
|
455
|
-
this._slots = [
|
|
460
|
+
this._slots = ['channel', 'id'];
|
|
456
461
|
this.channel = params.channel;
|
|
457
462
|
this.id = params.id;
|
|
458
463
|
}
|
|
459
464
|
/**
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
465
|
+
* Generate the TLObject from buffer.
|
|
466
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
467
|
+
*/
|
|
463
468
|
static async read(_data, ..._args) {
|
|
464
469
|
// no flags
|
|
465
470
|
let channel = await TLObject.read(_data);
|
|
466
471
|
let id = await TLObject.read(_data);
|
|
467
|
-
return new GetMessages({
|
|
472
|
+
return new GetMessages({ channel: channel, id: id });
|
|
468
473
|
}
|
|
469
474
|
/**
|
|
470
|
-
|
|
471
|
-
|
|
475
|
+
* Generate buffer from TLObject.
|
|
476
|
+
*/
|
|
472
477
|
write() {
|
|
473
478
|
const b = new BytesIO();
|
|
474
479
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -477,7 +482,7 @@ export class GetMessages extends TLObject {
|
|
|
477
482
|
b.write(this.channel.write());
|
|
478
483
|
}
|
|
479
484
|
if (this.id) {
|
|
480
|
-
b.write(
|
|
485
|
+
b.write(Primitive.Vector.write(this.id));
|
|
481
486
|
}
|
|
482
487
|
return b.buffer;
|
|
483
488
|
}
|
|
@@ -491,11 +496,11 @@ export class GetParticipants extends TLObject {
|
|
|
491
496
|
hash;
|
|
492
497
|
constructor(params) {
|
|
493
498
|
super();
|
|
494
|
-
this.classType =
|
|
495
|
-
this.className =
|
|
499
|
+
this.classType = 'functions';
|
|
500
|
+
this.className = 'channels.GetParticipants';
|
|
496
501
|
this.constructorId = 0x77ced9d0;
|
|
497
502
|
this.subclassOfId = 0xe60a6e64;
|
|
498
|
-
this._slots = [
|
|
503
|
+
this._slots = ['channel', 'filter', 'offset', 'limit', 'hash'];
|
|
499
504
|
this.channel = params.channel;
|
|
500
505
|
this.filter = params.filter;
|
|
501
506
|
this.offset = params.offset;
|
|
@@ -503,9 +508,9 @@ export class GetParticipants extends TLObject {
|
|
|
503
508
|
this.hash = params.hash;
|
|
504
509
|
}
|
|
505
510
|
/**
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
511
|
+
* Generate the TLObject from buffer.
|
|
512
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
513
|
+
*/
|
|
509
514
|
static async read(_data, ..._args) {
|
|
510
515
|
// no flags
|
|
511
516
|
let channel = await TLObject.read(_data);
|
|
@@ -513,11 +518,17 @@ export class GetParticipants extends TLObject {
|
|
|
513
518
|
let offset = await Primitive.Int.read(_data);
|
|
514
519
|
let limit = await Primitive.Int.read(_data);
|
|
515
520
|
let hash = await Primitive.Long.read(_data);
|
|
516
|
-
return new GetParticipants({
|
|
521
|
+
return new GetParticipants({
|
|
522
|
+
channel: channel,
|
|
523
|
+
filter: filter,
|
|
524
|
+
offset: offset,
|
|
525
|
+
limit: limit,
|
|
526
|
+
hash: hash,
|
|
527
|
+
});
|
|
517
528
|
}
|
|
518
529
|
/**
|
|
519
|
-
|
|
520
|
-
|
|
530
|
+
* Generate buffer from TLObject.
|
|
531
|
+
*/
|
|
521
532
|
write() {
|
|
522
533
|
const b = new BytesIO();
|
|
523
534
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -529,13 +540,13 @@ export class GetParticipants extends TLObject {
|
|
|
529
540
|
b.write(this.filter.write());
|
|
530
541
|
}
|
|
531
542
|
if (this.offset !== undefined) {
|
|
532
|
-
b.write(
|
|
543
|
+
b.write(Primitive.Int.write(this.offset));
|
|
533
544
|
}
|
|
534
545
|
if (this.limit !== undefined) {
|
|
535
|
-
b.write(
|
|
546
|
+
b.write(Primitive.Int.write(this.limit));
|
|
536
547
|
}
|
|
537
548
|
if (this.hash !== undefined) {
|
|
538
|
-
b.write(
|
|
549
|
+
b.write(Primitive.Long.write(this.hash));
|
|
539
550
|
}
|
|
540
551
|
return b.buffer;
|
|
541
552
|
}
|
|
@@ -546,27 +557,27 @@ export class GetParticipant extends TLObject {
|
|
|
546
557
|
participant;
|
|
547
558
|
constructor(params) {
|
|
548
559
|
super();
|
|
549
|
-
this.classType =
|
|
550
|
-
this.className =
|
|
560
|
+
this.classType = 'functions';
|
|
561
|
+
this.className = 'channels.GetParticipant';
|
|
551
562
|
this.constructorId = 0xa0ab6cc6;
|
|
552
563
|
this.subclassOfId = 0x6658151a;
|
|
553
|
-
this._slots = [
|
|
564
|
+
this._slots = ['channel', 'participant'];
|
|
554
565
|
this.channel = params.channel;
|
|
555
566
|
this.participant = params.participant;
|
|
556
567
|
}
|
|
557
568
|
/**
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
569
|
+
* Generate the TLObject from buffer.
|
|
570
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
571
|
+
*/
|
|
561
572
|
static async read(_data, ..._args) {
|
|
562
573
|
// no flags
|
|
563
574
|
let channel = await TLObject.read(_data);
|
|
564
575
|
let participant = await TLObject.read(_data);
|
|
565
|
-
return new GetParticipant({
|
|
576
|
+
return new GetParticipant({ channel: channel, participant: participant });
|
|
566
577
|
}
|
|
567
578
|
/**
|
|
568
|
-
|
|
569
|
-
|
|
579
|
+
* Generate buffer from TLObject.
|
|
580
|
+
*/
|
|
570
581
|
write() {
|
|
571
582
|
const b = new BytesIO();
|
|
572
583
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -585,31 +596,31 @@ export class GetChannels extends TLObject {
|
|
|
585
596
|
id;
|
|
586
597
|
constructor(params) {
|
|
587
598
|
super();
|
|
588
|
-
this.classType =
|
|
589
|
-
this.className =
|
|
599
|
+
this.classType = 'functions';
|
|
600
|
+
this.className = 'channels.GetChannels';
|
|
590
601
|
this.constructorId = 0xa7f6bbb;
|
|
591
602
|
this.subclassOfId = 0x99d5cb14;
|
|
592
|
-
this._slots = [
|
|
603
|
+
this._slots = ['id'];
|
|
593
604
|
this.id = params.id;
|
|
594
605
|
}
|
|
595
606
|
/**
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
607
|
+
* Generate the TLObject from buffer.
|
|
608
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
609
|
+
*/
|
|
599
610
|
static async read(_data, ..._args) {
|
|
600
611
|
// no flags
|
|
601
612
|
let id = await TLObject.read(_data);
|
|
602
|
-
return new GetChannels({
|
|
613
|
+
return new GetChannels({ id: id });
|
|
603
614
|
}
|
|
604
615
|
/**
|
|
605
|
-
|
|
606
|
-
|
|
616
|
+
* Generate buffer from TLObject.
|
|
617
|
+
*/
|
|
607
618
|
write() {
|
|
608
619
|
const b = new BytesIO();
|
|
609
620
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
610
621
|
// no flags
|
|
611
622
|
if (this.id) {
|
|
612
|
-
b.write(
|
|
623
|
+
b.write(Primitive.Vector.write(this.id));
|
|
613
624
|
}
|
|
614
625
|
return b.buffer;
|
|
615
626
|
}
|
|
@@ -619,25 +630,25 @@ export class GetFullChannel extends TLObject {
|
|
|
619
630
|
channel;
|
|
620
631
|
constructor(params) {
|
|
621
632
|
super();
|
|
622
|
-
this.classType =
|
|
623
|
-
this.className =
|
|
633
|
+
this.classType = 'functions';
|
|
634
|
+
this.className = 'channels.GetFullChannel';
|
|
624
635
|
this.constructorId = 0x8736a09;
|
|
625
636
|
this.subclassOfId = 0x225a5109;
|
|
626
|
-
this._slots = [
|
|
637
|
+
this._slots = ['channel'];
|
|
627
638
|
this.channel = params.channel;
|
|
628
639
|
}
|
|
629
640
|
/**
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
641
|
+
* Generate the TLObject from buffer.
|
|
642
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
643
|
+
*/
|
|
633
644
|
static async read(_data, ..._args) {
|
|
634
645
|
// no flags
|
|
635
646
|
let channel = await TLObject.read(_data);
|
|
636
|
-
return new GetFullChannel({
|
|
647
|
+
return new GetFullChannel({ channel: channel });
|
|
637
648
|
}
|
|
638
649
|
/**
|
|
639
|
-
|
|
640
|
-
|
|
650
|
+
* Generate buffer from TLObject.
|
|
651
|
+
*/
|
|
641
652
|
write() {
|
|
642
653
|
const b = new BytesIO();
|
|
643
654
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -661,11 +672,21 @@ export class CreateChannel extends TLObject {
|
|
|
661
672
|
ttlPeriod;
|
|
662
673
|
constructor(params) {
|
|
663
674
|
super();
|
|
664
|
-
this.classType =
|
|
665
|
-
this.className =
|
|
675
|
+
this.classType = 'functions';
|
|
676
|
+
this.className = 'channels.CreateChannel';
|
|
666
677
|
this.constructorId = 0x91006707;
|
|
667
678
|
this.subclassOfId = 0x8af52aac;
|
|
668
|
-
this._slots = [
|
|
679
|
+
this._slots = [
|
|
680
|
+
'broadcast',
|
|
681
|
+
'megagroup',
|
|
682
|
+
'forImport',
|
|
683
|
+
'forum',
|
|
684
|
+
'title',
|
|
685
|
+
'about',
|
|
686
|
+
'geoPoint',
|
|
687
|
+
'address',
|
|
688
|
+
'ttlPeriod',
|
|
689
|
+
];
|
|
669
690
|
this.broadcast = params.broadcast;
|
|
670
691
|
this.megagroup = params.megagroup;
|
|
671
692
|
this.forImport = params.forImport;
|
|
@@ -677,53 +698,63 @@ export class CreateChannel extends TLObject {
|
|
|
677
698
|
this.ttlPeriod = params.ttlPeriod;
|
|
678
699
|
}
|
|
679
700
|
/**
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
701
|
+
* Generate the TLObject from buffer.
|
|
702
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
703
|
+
*/
|
|
683
704
|
static async read(_data, ..._args) {
|
|
684
705
|
// @ts-ignore
|
|
685
706
|
let flags = await Primitive.Int.read(_data);
|
|
686
|
-
let broadcast =
|
|
687
|
-
let megagroup =
|
|
688
|
-
let forImport =
|
|
689
|
-
let forum =
|
|
707
|
+
let broadcast = flags & (1 << 0) ? true : false;
|
|
708
|
+
let megagroup = flags & (1 << 1) ? true : false;
|
|
709
|
+
let forImport = flags & (1 << 3) ? true : false;
|
|
710
|
+
let forum = flags & (1 << 5) ? true : false;
|
|
690
711
|
let title = await Primitive.String.read(_data);
|
|
691
712
|
let about = await Primitive.String.read(_data);
|
|
692
|
-
let geoPoint =
|
|
693
|
-
let address =
|
|
694
|
-
let ttlPeriod =
|
|
695
|
-
return new CreateChannel({
|
|
713
|
+
let geoPoint = flags & (1 << 2) ? await TLObject.read(_data) : undefined;
|
|
714
|
+
let address = flags & (1 << 2) ? await Primitive.String.read(_data) : undefined;
|
|
715
|
+
let ttlPeriod = flags & (1 << 4) ? await Primitive.Int.read(_data) : undefined;
|
|
716
|
+
return new CreateChannel({
|
|
717
|
+
broadcast: broadcast,
|
|
718
|
+
megagroup: megagroup,
|
|
719
|
+
forImport: forImport,
|
|
720
|
+
forum: forum,
|
|
721
|
+
title: title,
|
|
722
|
+
about: about,
|
|
723
|
+
geoPoint: geoPoint,
|
|
724
|
+
address: address,
|
|
725
|
+
ttlPeriod: ttlPeriod,
|
|
726
|
+
});
|
|
696
727
|
}
|
|
697
728
|
/**
|
|
698
|
-
|
|
699
|
-
|
|
729
|
+
* Generate buffer from TLObject.
|
|
730
|
+
*/
|
|
700
731
|
write() {
|
|
701
732
|
const b = new BytesIO();
|
|
702
733
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
703
734
|
// @ts-ignore
|
|
704
735
|
let flags = 0;
|
|
705
|
-
flags |= this.broadcast ?
|
|
706
|
-
flags |= this.megagroup ?
|
|
707
|
-
flags |= this.forImport ?
|
|
708
|
-
flags |= this.forum ?
|
|
709
|
-
flags |= this.geoPoint !== undefined ?
|
|
710
|
-
flags |= this.address !== undefined ?
|
|
711
|
-
flags |= this.ttlPeriod !== undefined ?
|
|
712
|
-
b.write(
|
|
736
|
+
flags |= this.broadcast ? 1 << 0 : 0;
|
|
737
|
+
flags |= this.megagroup ? 1 << 1 : 0;
|
|
738
|
+
flags |= this.forImport ? 1 << 3 : 0;
|
|
739
|
+
flags |= this.forum ? 1 << 5 : 0;
|
|
740
|
+
flags |= this.geoPoint !== undefined ? 1 << 2 : 0;
|
|
741
|
+
flags |= this.address !== undefined ? 1 << 2 : 0;
|
|
742
|
+
flags |= this.ttlPeriod !== undefined ? 1 << 4 : 0;
|
|
743
|
+
b.write(Primitive.Int.write(flags));
|
|
713
744
|
if (this.title !== undefined) {
|
|
714
|
-
b.write(
|
|
745
|
+
b.write(Primitive.String.write(this.title));
|
|
715
746
|
}
|
|
716
747
|
if (this.about !== undefined) {
|
|
717
|
-
b.write(
|
|
748
|
+
b.write(Primitive.String.write(this.about));
|
|
718
749
|
}
|
|
719
750
|
if (this.geoPoint !== undefined) {
|
|
720
751
|
b.write(this.geoPoint.write());
|
|
721
752
|
}
|
|
722
753
|
if (this.address !== undefined) {
|
|
723
|
-
b.write(
|
|
754
|
+
b.write(Primitive.String.write(this.address));
|
|
724
755
|
}
|
|
725
756
|
if (this.ttlPeriod !== undefined) {
|
|
726
|
-
b.write(
|
|
757
|
+
b.write(Primitive.Int.write(this.ttlPeriod));
|
|
727
758
|
}
|
|
728
759
|
return b.buffer;
|
|
729
760
|
}
|
|
@@ -736,39 +767,44 @@ export class EditAdmin extends TLObject {
|
|
|
736
767
|
rank;
|
|
737
768
|
constructor(params) {
|
|
738
769
|
super();
|
|
739
|
-
this.classType =
|
|
740
|
-
this.className =
|
|
770
|
+
this.classType = 'functions';
|
|
771
|
+
this.className = 'channels.EditAdmin';
|
|
741
772
|
this.constructorId = 0x9a98ad68;
|
|
742
773
|
this.subclassOfId = 0x8af52aac;
|
|
743
|
-
this._slots = [
|
|
774
|
+
this._slots = ['channel', 'userId', 'adminRights', 'rank'];
|
|
744
775
|
this.channel = params.channel;
|
|
745
776
|
this.userId = params.userId;
|
|
746
777
|
this.adminRights = params.adminRights;
|
|
747
778
|
this.rank = params.rank;
|
|
748
779
|
}
|
|
749
780
|
/**
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
781
|
+
* Generate the TLObject from buffer.
|
|
782
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
783
|
+
*/
|
|
753
784
|
static async read(_data, ..._args) {
|
|
754
785
|
// @ts-ignore
|
|
755
786
|
let flags = await Primitive.Int.read(_data);
|
|
756
787
|
let channel = await TLObject.read(_data);
|
|
757
788
|
let userId = await TLObject.read(_data);
|
|
758
789
|
let adminRights = await TLObject.read(_data);
|
|
759
|
-
let rank =
|
|
760
|
-
return new EditAdmin({
|
|
790
|
+
let rank = flags & (1 << 0) ? await Primitive.String.read(_data) : undefined;
|
|
791
|
+
return new EditAdmin({
|
|
792
|
+
channel: channel,
|
|
793
|
+
userId: userId,
|
|
794
|
+
adminRights: adminRights,
|
|
795
|
+
rank: rank,
|
|
796
|
+
});
|
|
761
797
|
}
|
|
762
798
|
/**
|
|
763
|
-
|
|
764
|
-
|
|
799
|
+
* Generate buffer from TLObject.
|
|
800
|
+
*/
|
|
765
801
|
write() {
|
|
766
802
|
const b = new BytesIO();
|
|
767
803
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
768
804
|
// @ts-ignore
|
|
769
805
|
let flags = 0;
|
|
770
|
-
flags |= this.rank !== undefined ?
|
|
771
|
-
b.write(
|
|
806
|
+
flags |= this.rank !== undefined ? 1 << 0 : 0;
|
|
807
|
+
b.write(Primitive.Int.write(flags));
|
|
772
808
|
if (this.channel !== undefined) {
|
|
773
809
|
b.write(this.channel.write());
|
|
774
810
|
}
|
|
@@ -779,7 +815,7 @@ export class EditAdmin extends TLObject {
|
|
|
779
815
|
b.write(this.adminRights.write());
|
|
780
816
|
}
|
|
781
817
|
if (this.rank !== undefined) {
|
|
782
|
-
b.write(
|
|
818
|
+
b.write(Primitive.String.write(this.rank));
|
|
783
819
|
}
|
|
784
820
|
return b.buffer;
|
|
785
821
|
}
|
|
@@ -790,27 +826,27 @@ export class EditTitle extends TLObject {
|
|
|
790
826
|
title;
|
|
791
827
|
constructor(params) {
|
|
792
828
|
super();
|
|
793
|
-
this.classType =
|
|
794
|
-
this.className =
|
|
829
|
+
this.classType = 'functions';
|
|
830
|
+
this.className = 'channels.EditTitle';
|
|
795
831
|
this.constructorId = 0x566decd0;
|
|
796
832
|
this.subclassOfId = 0x8af52aac;
|
|
797
|
-
this._slots = [
|
|
833
|
+
this._slots = ['channel', 'title'];
|
|
798
834
|
this.channel = params.channel;
|
|
799
835
|
this.title = params.title;
|
|
800
836
|
}
|
|
801
837
|
/**
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
838
|
+
* Generate the TLObject from buffer.
|
|
839
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
840
|
+
*/
|
|
805
841
|
static async read(_data, ..._args) {
|
|
806
842
|
// no flags
|
|
807
843
|
let channel = await TLObject.read(_data);
|
|
808
844
|
let title = await Primitive.String.read(_data);
|
|
809
|
-
return new EditTitle({
|
|
845
|
+
return new EditTitle({ channel: channel, title: title });
|
|
810
846
|
}
|
|
811
847
|
/**
|
|
812
|
-
|
|
813
|
-
|
|
848
|
+
* Generate buffer from TLObject.
|
|
849
|
+
*/
|
|
814
850
|
write() {
|
|
815
851
|
const b = new BytesIO();
|
|
816
852
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -819,7 +855,7 @@ export class EditTitle extends TLObject {
|
|
|
819
855
|
b.write(this.channel.write());
|
|
820
856
|
}
|
|
821
857
|
if (this.title !== undefined) {
|
|
822
|
-
b.write(
|
|
858
|
+
b.write(Primitive.String.write(this.title));
|
|
823
859
|
}
|
|
824
860
|
return b.buffer;
|
|
825
861
|
}
|
|
@@ -830,27 +866,27 @@ export class EditPhoto extends TLObject {
|
|
|
830
866
|
photo;
|
|
831
867
|
constructor(params) {
|
|
832
868
|
super();
|
|
833
|
-
this.classType =
|
|
834
|
-
this.className =
|
|
869
|
+
this.classType = 'functions';
|
|
870
|
+
this.className = 'channels.EditPhoto';
|
|
835
871
|
this.constructorId = 0xf12e57c9;
|
|
836
872
|
this.subclassOfId = 0x8af52aac;
|
|
837
|
-
this._slots = [
|
|
873
|
+
this._slots = ['channel', 'photo'];
|
|
838
874
|
this.channel = params.channel;
|
|
839
875
|
this.photo = params.photo;
|
|
840
876
|
}
|
|
841
877
|
/**
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
878
|
+
* Generate the TLObject from buffer.
|
|
879
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
880
|
+
*/
|
|
845
881
|
static async read(_data, ..._args) {
|
|
846
882
|
// no flags
|
|
847
883
|
let channel = await TLObject.read(_data);
|
|
848
884
|
let photo = await TLObject.read(_data);
|
|
849
|
-
return new EditPhoto({
|
|
885
|
+
return new EditPhoto({ channel: channel, photo: photo });
|
|
850
886
|
}
|
|
851
887
|
/**
|
|
852
|
-
|
|
853
|
-
|
|
888
|
+
* Generate buffer from TLObject.
|
|
889
|
+
*/
|
|
854
890
|
write() {
|
|
855
891
|
const b = new BytesIO();
|
|
856
892
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -870,27 +906,27 @@ export class CheckUsername extends TLObject {
|
|
|
870
906
|
username;
|
|
871
907
|
constructor(params) {
|
|
872
908
|
super();
|
|
873
|
-
this.classType =
|
|
874
|
-
this.className =
|
|
909
|
+
this.classType = 'functions';
|
|
910
|
+
this.className = 'channels.CheckUsername';
|
|
875
911
|
this.constructorId = 0x10e6bd2c;
|
|
876
912
|
this.subclassOfId = 0xf5b399ac;
|
|
877
|
-
this._slots = [
|
|
913
|
+
this._slots = ['channel', 'username'];
|
|
878
914
|
this.channel = params.channel;
|
|
879
915
|
this.username = params.username;
|
|
880
916
|
}
|
|
881
917
|
/**
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
918
|
+
* Generate the TLObject from buffer.
|
|
919
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
920
|
+
*/
|
|
885
921
|
static async read(_data, ..._args) {
|
|
886
922
|
// no flags
|
|
887
923
|
let channel = await TLObject.read(_data);
|
|
888
924
|
let username = await Primitive.String.read(_data);
|
|
889
|
-
return new CheckUsername({
|
|
925
|
+
return new CheckUsername({ channel: channel, username: username });
|
|
890
926
|
}
|
|
891
927
|
/**
|
|
892
|
-
|
|
893
|
-
|
|
928
|
+
* Generate buffer from TLObject.
|
|
929
|
+
*/
|
|
894
930
|
write() {
|
|
895
931
|
const b = new BytesIO();
|
|
896
932
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -899,7 +935,7 @@ export class CheckUsername extends TLObject {
|
|
|
899
935
|
b.write(this.channel.write());
|
|
900
936
|
}
|
|
901
937
|
if (this.username !== undefined) {
|
|
902
|
-
b.write(
|
|
938
|
+
b.write(Primitive.String.write(this.username));
|
|
903
939
|
}
|
|
904
940
|
return b.buffer;
|
|
905
941
|
}
|
|
@@ -910,27 +946,27 @@ export class UpdateUsername extends TLObject {
|
|
|
910
946
|
username;
|
|
911
947
|
constructor(params) {
|
|
912
948
|
super();
|
|
913
|
-
this.classType =
|
|
914
|
-
this.className =
|
|
949
|
+
this.classType = 'functions';
|
|
950
|
+
this.className = 'channels.UpdateUsername';
|
|
915
951
|
this.constructorId = 0x3514b3de;
|
|
916
952
|
this.subclassOfId = 0xf5b399ac;
|
|
917
|
-
this._slots = [
|
|
953
|
+
this._slots = ['channel', 'username'];
|
|
918
954
|
this.channel = params.channel;
|
|
919
955
|
this.username = params.username;
|
|
920
956
|
}
|
|
921
957
|
/**
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
958
|
+
* Generate the TLObject from buffer.
|
|
959
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
960
|
+
*/
|
|
925
961
|
static async read(_data, ..._args) {
|
|
926
962
|
// no flags
|
|
927
963
|
let channel = await TLObject.read(_data);
|
|
928
964
|
let username = await Primitive.String.read(_data);
|
|
929
|
-
return new UpdateUsername({
|
|
965
|
+
return new UpdateUsername({ channel: channel, username: username });
|
|
930
966
|
}
|
|
931
967
|
/**
|
|
932
|
-
|
|
933
|
-
|
|
968
|
+
* Generate buffer from TLObject.
|
|
969
|
+
*/
|
|
934
970
|
write() {
|
|
935
971
|
const b = new BytesIO();
|
|
936
972
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -939,39 +975,46 @@ export class UpdateUsername extends TLObject {
|
|
|
939
975
|
b.write(this.channel.write());
|
|
940
976
|
}
|
|
941
977
|
if (this.username !== undefined) {
|
|
942
|
-
b.write(
|
|
978
|
+
b.write(Primitive.String.write(this.username));
|
|
943
979
|
}
|
|
944
980
|
return b.buffer;
|
|
945
981
|
}
|
|
946
982
|
}
|
|
947
983
|
export class JoinChannel extends TLObject {
|
|
948
984
|
__response__;
|
|
985
|
+
forNews;
|
|
949
986
|
channel;
|
|
950
987
|
constructor(params) {
|
|
951
988
|
super();
|
|
952
|
-
this.classType =
|
|
953
|
-
this.className =
|
|
954
|
-
this.constructorId =
|
|
989
|
+
this.classType = 'functions';
|
|
990
|
+
this.className = 'channels.JoinChannel';
|
|
991
|
+
this.constructorId = 0x416cb50c;
|
|
955
992
|
this.subclassOfId = 0x5d0ff992;
|
|
956
|
-
this._slots = [
|
|
993
|
+
this._slots = ['forNews', 'channel'];
|
|
994
|
+
this.forNews = params.forNews;
|
|
957
995
|
this.channel = params.channel;
|
|
958
996
|
}
|
|
959
997
|
/**
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
998
|
+
* Generate the TLObject from buffer.
|
|
999
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1000
|
+
*/
|
|
963
1001
|
static async read(_data, ..._args) {
|
|
964
|
-
//
|
|
1002
|
+
// @ts-ignore
|
|
1003
|
+
let flags = await Primitive.Int.read(_data);
|
|
1004
|
+
let forNews = flags & (1 << 0) ? true : false;
|
|
965
1005
|
let channel = await TLObject.read(_data);
|
|
966
|
-
return new JoinChannel({
|
|
1006
|
+
return new JoinChannel({ forNews: forNews, channel: channel });
|
|
967
1007
|
}
|
|
968
1008
|
/**
|
|
969
|
-
|
|
970
|
-
|
|
1009
|
+
* Generate buffer from TLObject.
|
|
1010
|
+
*/
|
|
971
1011
|
write() {
|
|
972
1012
|
const b = new BytesIO();
|
|
973
1013
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
974
|
-
//
|
|
1014
|
+
// @ts-ignore
|
|
1015
|
+
let flags = 0;
|
|
1016
|
+
flags |= this.forNews ? 1 << 0 : 0;
|
|
1017
|
+
b.write(Primitive.Int.write(flags));
|
|
975
1018
|
if (this.channel !== undefined) {
|
|
976
1019
|
b.write(this.channel.write());
|
|
977
1020
|
}
|
|
@@ -983,25 +1026,25 @@ export class LeaveChannel extends TLObject {
|
|
|
983
1026
|
channel;
|
|
984
1027
|
constructor(params) {
|
|
985
1028
|
super();
|
|
986
|
-
this.classType =
|
|
987
|
-
this.className =
|
|
1029
|
+
this.classType = 'functions';
|
|
1030
|
+
this.className = 'channels.LeaveChannel';
|
|
988
1031
|
this.constructorId = 0xf836aa95;
|
|
989
1032
|
this.subclassOfId = 0x8af52aac;
|
|
990
|
-
this._slots = [
|
|
1033
|
+
this._slots = ['channel'];
|
|
991
1034
|
this.channel = params.channel;
|
|
992
1035
|
}
|
|
993
1036
|
/**
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
1037
|
+
* Generate the TLObject from buffer.
|
|
1038
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1039
|
+
*/
|
|
997
1040
|
static async read(_data, ..._args) {
|
|
998
1041
|
// no flags
|
|
999
1042
|
let channel = await TLObject.read(_data);
|
|
1000
|
-
return new LeaveChannel({
|
|
1043
|
+
return new LeaveChannel({ channel: channel });
|
|
1001
1044
|
}
|
|
1002
1045
|
/**
|
|
1003
|
-
|
|
1004
|
-
|
|
1046
|
+
* Generate buffer from TLObject.
|
|
1047
|
+
*/
|
|
1005
1048
|
write() {
|
|
1006
1049
|
const b = new BytesIO();
|
|
1007
1050
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -1018,27 +1061,27 @@ export class InviteToChannel extends TLObject {
|
|
|
1018
1061
|
users;
|
|
1019
1062
|
constructor(params) {
|
|
1020
1063
|
super();
|
|
1021
|
-
this.classType =
|
|
1022
|
-
this.className =
|
|
1064
|
+
this.classType = 'functions';
|
|
1065
|
+
this.className = 'channels.InviteToChannel';
|
|
1023
1066
|
this.constructorId = 0xc9e33d54;
|
|
1024
1067
|
this.subclassOfId = 0x3dbe90a1;
|
|
1025
|
-
this._slots = [
|
|
1068
|
+
this._slots = ['channel', 'users'];
|
|
1026
1069
|
this.channel = params.channel;
|
|
1027
1070
|
this.users = params.users;
|
|
1028
1071
|
}
|
|
1029
1072
|
/**
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1073
|
+
* Generate the TLObject from buffer.
|
|
1074
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1075
|
+
*/
|
|
1033
1076
|
static async read(_data, ..._args) {
|
|
1034
1077
|
// no flags
|
|
1035
1078
|
let channel = await TLObject.read(_data);
|
|
1036
1079
|
let users = await TLObject.read(_data);
|
|
1037
|
-
return new InviteToChannel({
|
|
1080
|
+
return new InviteToChannel({ channel: channel, users: users });
|
|
1038
1081
|
}
|
|
1039
1082
|
/**
|
|
1040
|
-
|
|
1041
|
-
|
|
1083
|
+
* Generate buffer from TLObject.
|
|
1084
|
+
*/
|
|
1042
1085
|
write() {
|
|
1043
1086
|
const b = new BytesIO();
|
|
1044
1087
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -1047,7 +1090,7 @@ export class InviteToChannel extends TLObject {
|
|
|
1047
1090
|
b.write(this.channel.write());
|
|
1048
1091
|
}
|
|
1049
1092
|
if (this.users) {
|
|
1050
|
-
b.write(
|
|
1093
|
+
b.write(Primitive.Vector.write(this.users));
|
|
1051
1094
|
}
|
|
1052
1095
|
return b.buffer;
|
|
1053
1096
|
}
|
|
@@ -1057,25 +1100,25 @@ export class DeleteChannel extends TLObject {
|
|
|
1057
1100
|
channel;
|
|
1058
1101
|
constructor(params) {
|
|
1059
1102
|
super();
|
|
1060
|
-
this.classType =
|
|
1061
|
-
this.className =
|
|
1103
|
+
this.classType = 'functions';
|
|
1104
|
+
this.className = 'channels.DeleteChannel';
|
|
1062
1105
|
this.constructorId = 0xc0111fe3;
|
|
1063
1106
|
this.subclassOfId = 0x8af52aac;
|
|
1064
|
-
this._slots = [
|
|
1107
|
+
this._slots = ['channel'];
|
|
1065
1108
|
this.channel = params.channel;
|
|
1066
1109
|
}
|
|
1067
1110
|
/**
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1111
|
+
* Generate the TLObject from buffer.
|
|
1112
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1113
|
+
*/
|
|
1071
1114
|
static async read(_data, ..._args) {
|
|
1072
1115
|
// no flags
|
|
1073
1116
|
let channel = await TLObject.read(_data);
|
|
1074
|
-
return new DeleteChannel({
|
|
1117
|
+
return new DeleteChannel({ channel: channel });
|
|
1075
1118
|
}
|
|
1076
1119
|
/**
|
|
1077
|
-
|
|
1078
|
-
|
|
1120
|
+
* Generate buffer from TLObject.
|
|
1121
|
+
*/
|
|
1079
1122
|
write() {
|
|
1080
1123
|
const b = new BytesIO();
|
|
1081
1124
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -1094,45 +1137,45 @@ export class ExportMessageLink extends TLObject {
|
|
|
1094
1137
|
id;
|
|
1095
1138
|
constructor(params) {
|
|
1096
1139
|
super();
|
|
1097
|
-
this.classType =
|
|
1098
|
-
this.className =
|
|
1140
|
+
this.classType = 'functions';
|
|
1141
|
+
this.className = 'channels.ExportMessageLink';
|
|
1099
1142
|
this.constructorId = 0xe63fadeb;
|
|
1100
1143
|
this.subclassOfId = 0xdee644cc;
|
|
1101
|
-
this._slots = [
|
|
1144
|
+
this._slots = ['grouped', 'thread', 'channel', 'id'];
|
|
1102
1145
|
this.grouped = params.grouped;
|
|
1103
1146
|
this.thread = params.thread;
|
|
1104
1147
|
this.channel = params.channel;
|
|
1105
1148
|
this.id = params.id;
|
|
1106
1149
|
}
|
|
1107
1150
|
/**
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1151
|
+
* Generate the TLObject from buffer.
|
|
1152
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1153
|
+
*/
|
|
1111
1154
|
static async read(_data, ..._args) {
|
|
1112
1155
|
// @ts-ignore
|
|
1113
1156
|
let flags = await Primitive.Int.read(_data);
|
|
1114
|
-
let grouped =
|
|
1115
|
-
let thread =
|
|
1157
|
+
let grouped = flags & (1 << 0) ? true : false;
|
|
1158
|
+
let thread = flags & (1 << 1) ? true : false;
|
|
1116
1159
|
let channel = await TLObject.read(_data);
|
|
1117
1160
|
let id = await Primitive.Int.read(_data);
|
|
1118
|
-
return new ExportMessageLink({
|
|
1161
|
+
return new ExportMessageLink({ grouped: grouped, thread: thread, channel: channel, id: id });
|
|
1119
1162
|
}
|
|
1120
1163
|
/**
|
|
1121
|
-
|
|
1122
|
-
|
|
1164
|
+
* Generate buffer from TLObject.
|
|
1165
|
+
*/
|
|
1123
1166
|
write() {
|
|
1124
1167
|
const b = new BytesIO();
|
|
1125
1168
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
1126
1169
|
// @ts-ignore
|
|
1127
1170
|
let flags = 0;
|
|
1128
|
-
flags |= this.grouped ?
|
|
1129
|
-
flags |= this.thread ?
|
|
1130
|
-
b.write(
|
|
1171
|
+
flags |= this.grouped ? 1 << 0 : 0;
|
|
1172
|
+
flags |= this.thread ? 1 << 1 : 0;
|
|
1173
|
+
b.write(Primitive.Int.write(flags));
|
|
1131
1174
|
if (this.channel !== undefined) {
|
|
1132
1175
|
b.write(this.channel.write());
|
|
1133
1176
|
}
|
|
1134
1177
|
if (this.id !== undefined) {
|
|
1135
|
-
b.write(
|
|
1178
|
+
b.write(Primitive.Int.write(this.id));
|
|
1136
1179
|
}
|
|
1137
1180
|
return b.buffer;
|
|
1138
1181
|
}
|
|
@@ -1144,38 +1187,42 @@ export class ToggleSignatures extends TLObject {
|
|
|
1144
1187
|
channel;
|
|
1145
1188
|
constructor(params) {
|
|
1146
1189
|
super();
|
|
1147
|
-
this.classType =
|
|
1148
|
-
this.className =
|
|
1190
|
+
this.classType = 'functions';
|
|
1191
|
+
this.className = 'channels.ToggleSignatures';
|
|
1149
1192
|
this.constructorId = 0x418d549c;
|
|
1150
1193
|
this.subclassOfId = 0x8af52aac;
|
|
1151
|
-
this._slots = [
|
|
1194
|
+
this._slots = ['signaturesEnabled', 'profilesEnabled', 'channel'];
|
|
1152
1195
|
this.signaturesEnabled = params.signaturesEnabled;
|
|
1153
1196
|
this.profilesEnabled = params.profilesEnabled;
|
|
1154
1197
|
this.channel = params.channel;
|
|
1155
1198
|
}
|
|
1156
1199
|
/**
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1200
|
+
* Generate the TLObject from buffer.
|
|
1201
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1202
|
+
*/
|
|
1160
1203
|
static async read(_data, ..._args) {
|
|
1161
1204
|
// @ts-ignore
|
|
1162
1205
|
let flags = await Primitive.Int.read(_data);
|
|
1163
|
-
let signaturesEnabled =
|
|
1164
|
-
let profilesEnabled =
|
|
1206
|
+
let signaturesEnabled = flags & (1 << 0) ? true : false;
|
|
1207
|
+
let profilesEnabled = flags & (1 << 1) ? true : false;
|
|
1165
1208
|
let channel = await TLObject.read(_data);
|
|
1166
|
-
return new ToggleSignatures({
|
|
1209
|
+
return new ToggleSignatures({
|
|
1210
|
+
signaturesEnabled: signaturesEnabled,
|
|
1211
|
+
profilesEnabled: profilesEnabled,
|
|
1212
|
+
channel: channel,
|
|
1213
|
+
});
|
|
1167
1214
|
}
|
|
1168
1215
|
/**
|
|
1169
|
-
|
|
1170
|
-
|
|
1216
|
+
* Generate buffer from TLObject.
|
|
1217
|
+
*/
|
|
1171
1218
|
write() {
|
|
1172
1219
|
const b = new BytesIO();
|
|
1173
1220
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
1174
1221
|
// @ts-ignore
|
|
1175
1222
|
let flags = 0;
|
|
1176
|
-
flags |= this.signaturesEnabled ?
|
|
1177
|
-
flags |= this.profilesEnabled ?
|
|
1178
|
-
b.write(
|
|
1223
|
+
flags |= this.signaturesEnabled ? 1 << 0 : 0;
|
|
1224
|
+
flags |= this.profilesEnabled ? 1 << 1 : 0;
|
|
1225
|
+
b.write(Primitive.Int.write(flags));
|
|
1179
1226
|
if (this.channel !== undefined) {
|
|
1180
1227
|
b.write(this.channel.write());
|
|
1181
1228
|
}
|
|
@@ -1190,42 +1237,47 @@ export class GetAdminedPublicChannels extends TLObject {
|
|
|
1190
1237
|
forCommunityPeer;
|
|
1191
1238
|
constructor(params) {
|
|
1192
1239
|
super();
|
|
1193
|
-
this.classType =
|
|
1194
|
-
this.className =
|
|
1240
|
+
this.classType = 'functions';
|
|
1241
|
+
this.className = 'channels.GetAdminedPublicChannels';
|
|
1195
1242
|
this.constructorId = 0xf8b036af;
|
|
1196
1243
|
this.subclassOfId = 0x99d5cb14;
|
|
1197
|
-
this._slots = [
|
|
1244
|
+
this._slots = ['byLocation', 'checkLimit', 'forPersonal', 'forCommunityPeer'];
|
|
1198
1245
|
this.byLocation = params.byLocation;
|
|
1199
1246
|
this.checkLimit = params.checkLimit;
|
|
1200
1247
|
this.forPersonal = params.forPersonal;
|
|
1201
1248
|
this.forCommunityPeer = params.forCommunityPeer;
|
|
1202
1249
|
}
|
|
1203
1250
|
/**
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1251
|
+
* Generate the TLObject from buffer.
|
|
1252
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1253
|
+
*/
|
|
1207
1254
|
static async read(_data, ..._args) {
|
|
1208
1255
|
// @ts-ignore
|
|
1209
1256
|
let flags = await Primitive.Int.read(_data);
|
|
1210
|
-
let byLocation =
|
|
1211
|
-
let checkLimit =
|
|
1212
|
-
let forPersonal =
|
|
1213
|
-
let forCommunityPeer =
|
|
1214
|
-
return new GetAdminedPublicChannels({
|
|
1257
|
+
let byLocation = flags & (1 << 0) ? true : false;
|
|
1258
|
+
let checkLimit = flags & (1 << 1) ? true : false;
|
|
1259
|
+
let forPersonal = flags & (1 << 2) ? true : false;
|
|
1260
|
+
let forCommunityPeer = flags & (1 << 3) ? true : false;
|
|
1261
|
+
return new GetAdminedPublicChannels({
|
|
1262
|
+
byLocation: byLocation,
|
|
1263
|
+
checkLimit: checkLimit,
|
|
1264
|
+
forPersonal: forPersonal,
|
|
1265
|
+
forCommunityPeer: forCommunityPeer,
|
|
1266
|
+
});
|
|
1215
1267
|
}
|
|
1216
1268
|
/**
|
|
1217
|
-
|
|
1218
|
-
|
|
1269
|
+
* Generate buffer from TLObject.
|
|
1270
|
+
*/
|
|
1219
1271
|
write() {
|
|
1220
1272
|
const b = new BytesIO();
|
|
1221
1273
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
1222
1274
|
// @ts-ignore
|
|
1223
1275
|
let flags = 0;
|
|
1224
|
-
flags |= this.byLocation ?
|
|
1225
|
-
flags |= this.checkLimit ?
|
|
1226
|
-
flags |= this.forPersonal ?
|
|
1227
|
-
flags |= this.forCommunityPeer ?
|
|
1228
|
-
b.write(
|
|
1276
|
+
flags |= this.byLocation ? 1 << 0 : 0;
|
|
1277
|
+
flags |= this.checkLimit ? 1 << 1 : 0;
|
|
1278
|
+
flags |= this.forPersonal ? 1 << 2 : 0;
|
|
1279
|
+
flags |= this.forCommunityPeer ? 1 << 3 : 0;
|
|
1280
|
+
b.write(Primitive.Int.write(flags));
|
|
1229
1281
|
return b.buffer;
|
|
1230
1282
|
}
|
|
1231
1283
|
}
|
|
@@ -1236,29 +1288,33 @@ export class EditBanned extends TLObject {
|
|
|
1236
1288
|
bannedRights;
|
|
1237
1289
|
constructor(params) {
|
|
1238
1290
|
super();
|
|
1239
|
-
this.classType =
|
|
1240
|
-
this.className =
|
|
1291
|
+
this.classType = 'functions';
|
|
1292
|
+
this.className = 'channels.EditBanned';
|
|
1241
1293
|
this.constructorId = 0x96e6cd81;
|
|
1242
1294
|
this.subclassOfId = 0x8af52aac;
|
|
1243
|
-
this._slots = [
|
|
1295
|
+
this._slots = ['channel', 'participant', 'bannedRights'];
|
|
1244
1296
|
this.channel = params.channel;
|
|
1245
1297
|
this.participant = params.participant;
|
|
1246
1298
|
this.bannedRights = params.bannedRights;
|
|
1247
1299
|
}
|
|
1248
1300
|
/**
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1301
|
+
* Generate the TLObject from buffer.
|
|
1302
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1303
|
+
*/
|
|
1252
1304
|
static async read(_data, ..._args) {
|
|
1253
1305
|
// no flags
|
|
1254
1306
|
let channel = await TLObject.read(_data);
|
|
1255
1307
|
let participant = await TLObject.read(_data);
|
|
1256
1308
|
let bannedRights = await TLObject.read(_data);
|
|
1257
|
-
return new EditBanned({
|
|
1309
|
+
return new EditBanned({
|
|
1310
|
+
channel: channel,
|
|
1311
|
+
participant: participant,
|
|
1312
|
+
bannedRights: bannedRights,
|
|
1313
|
+
});
|
|
1258
1314
|
}
|
|
1259
1315
|
/**
|
|
1260
|
-
|
|
1261
|
-
|
|
1316
|
+
* Generate buffer from TLObject.
|
|
1317
|
+
*/
|
|
1262
1318
|
write() {
|
|
1263
1319
|
const b = new BytesIO();
|
|
1264
1320
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -1286,11 +1342,11 @@ export class GetAdminLog extends TLObject {
|
|
|
1286
1342
|
limit;
|
|
1287
1343
|
constructor(params) {
|
|
1288
1344
|
super();
|
|
1289
|
-
this.classType =
|
|
1290
|
-
this.className =
|
|
1345
|
+
this.classType = 'functions';
|
|
1346
|
+
this.className = 'channels.GetAdminLog';
|
|
1291
1347
|
this.constructorId = 0x33ddf480;
|
|
1292
1348
|
this.subclassOfId = 0x51f076bc;
|
|
1293
|
-
this._slots = [
|
|
1349
|
+
this._slots = ['channel', 'q', 'eventsFilter', 'admins', 'maxId', 'minId', 'limit'];
|
|
1294
1350
|
this.channel = params.channel;
|
|
1295
1351
|
this.q = params.q;
|
|
1296
1352
|
this.eventsFilter = params.eventsFilter;
|
|
@@ -1300,52 +1356,60 @@ export class GetAdminLog extends TLObject {
|
|
|
1300
1356
|
this.limit = params.limit;
|
|
1301
1357
|
}
|
|
1302
1358
|
/**
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1359
|
+
* Generate the TLObject from buffer.
|
|
1360
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1361
|
+
*/
|
|
1306
1362
|
static async read(_data, ..._args) {
|
|
1307
1363
|
// @ts-ignore
|
|
1308
1364
|
let flags = await Primitive.Int.read(_data);
|
|
1309
1365
|
let channel = await TLObject.read(_data);
|
|
1310
1366
|
let q = await Primitive.String.read(_data);
|
|
1311
|
-
let eventsFilter =
|
|
1312
|
-
let admins =
|
|
1367
|
+
let eventsFilter = flags & (1 << 0) ? await TLObject.read(_data) : undefined;
|
|
1368
|
+
let admins = flags & (1 << 1) ? await TLObject.read(_data) : [];
|
|
1313
1369
|
let maxId = await Primitive.Long.read(_data);
|
|
1314
1370
|
let minId = await Primitive.Long.read(_data);
|
|
1315
1371
|
let limit = await Primitive.Int.read(_data);
|
|
1316
|
-
return new GetAdminLog({
|
|
1372
|
+
return new GetAdminLog({
|
|
1373
|
+
channel: channel,
|
|
1374
|
+
q: q,
|
|
1375
|
+
eventsFilter: eventsFilter,
|
|
1376
|
+
admins: admins,
|
|
1377
|
+
maxId: maxId,
|
|
1378
|
+
minId: minId,
|
|
1379
|
+
limit: limit,
|
|
1380
|
+
});
|
|
1317
1381
|
}
|
|
1318
1382
|
/**
|
|
1319
|
-
|
|
1320
|
-
|
|
1383
|
+
* Generate buffer from TLObject.
|
|
1384
|
+
*/
|
|
1321
1385
|
write() {
|
|
1322
1386
|
const b = new BytesIO();
|
|
1323
1387
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
1324
1388
|
// @ts-ignore
|
|
1325
1389
|
let flags = 0;
|
|
1326
|
-
flags |= this.eventsFilter !== undefined ?
|
|
1327
|
-
flags |= this.admins ?
|
|
1328
|
-
b.write(
|
|
1390
|
+
flags |= this.eventsFilter !== undefined ? 1 << 0 : 0;
|
|
1391
|
+
flags |= this.admins ? 1 << 1 : 0;
|
|
1392
|
+
b.write(Primitive.Int.write(flags));
|
|
1329
1393
|
if (this.channel !== undefined) {
|
|
1330
1394
|
b.write(this.channel.write());
|
|
1331
1395
|
}
|
|
1332
1396
|
if (this.q !== undefined) {
|
|
1333
|
-
b.write(
|
|
1397
|
+
b.write(Primitive.String.write(this.q));
|
|
1334
1398
|
}
|
|
1335
1399
|
if (this.eventsFilter !== undefined) {
|
|
1336
1400
|
b.write(this.eventsFilter.write());
|
|
1337
1401
|
}
|
|
1338
1402
|
if (this.admins) {
|
|
1339
|
-
b.write(
|
|
1403
|
+
b.write(Primitive.Vector.write(this.admins));
|
|
1340
1404
|
}
|
|
1341
1405
|
if (this.maxId !== undefined) {
|
|
1342
|
-
b.write(
|
|
1406
|
+
b.write(Primitive.Long.write(this.maxId));
|
|
1343
1407
|
}
|
|
1344
1408
|
if (this.minId !== undefined) {
|
|
1345
|
-
b.write(
|
|
1409
|
+
b.write(Primitive.Long.write(this.minId));
|
|
1346
1410
|
}
|
|
1347
1411
|
if (this.limit !== undefined) {
|
|
1348
|
-
b.write(
|
|
1412
|
+
b.write(Primitive.Int.write(this.limit));
|
|
1349
1413
|
}
|
|
1350
1414
|
return b.buffer;
|
|
1351
1415
|
}
|
|
@@ -1356,27 +1420,27 @@ export class SetStickers extends TLObject {
|
|
|
1356
1420
|
stickerset;
|
|
1357
1421
|
constructor(params) {
|
|
1358
1422
|
super();
|
|
1359
|
-
this.classType =
|
|
1360
|
-
this.className =
|
|
1423
|
+
this.classType = 'functions';
|
|
1424
|
+
this.className = 'channels.SetStickers';
|
|
1361
1425
|
this.constructorId = 0xea8ca4f9;
|
|
1362
1426
|
this.subclassOfId = 0xf5b399ac;
|
|
1363
|
-
this._slots = [
|
|
1427
|
+
this._slots = ['channel', 'stickerset'];
|
|
1364
1428
|
this.channel = params.channel;
|
|
1365
1429
|
this.stickerset = params.stickerset;
|
|
1366
1430
|
}
|
|
1367
1431
|
/**
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1432
|
+
* Generate the TLObject from buffer.
|
|
1433
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1434
|
+
*/
|
|
1371
1435
|
static async read(_data, ..._args) {
|
|
1372
1436
|
// no flags
|
|
1373
1437
|
let channel = await TLObject.read(_data);
|
|
1374
1438
|
let stickerset = await TLObject.read(_data);
|
|
1375
|
-
return new SetStickers({
|
|
1439
|
+
return new SetStickers({ channel: channel, stickerset: stickerset });
|
|
1376
1440
|
}
|
|
1377
1441
|
/**
|
|
1378
|
-
|
|
1379
|
-
|
|
1442
|
+
* Generate buffer from TLObject.
|
|
1443
|
+
*/
|
|
1380
1444
|
write() {
|
|
1381
1445
|
const b = new BytesIO();
|
|
1382
1446
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -1396,27 +1460,27 @@ export class ReadMessageContents extends TLObject {
|
|
|
1396
1460
|
id;
|
|
1397
1461
|
constructor(params) {
|
|
1398
1462
|
super();
|
|
1399
|
-
this.classType =
|
|
1400
|
-
this.className =
|
|
1463
|
+
this.classType = 'functions';
|
|
1464
|
+
this.className = 'channels.ReadMessageContents';
|
|
1401
1465
|
this.constructorId = 0xeab5dc38;
|
|
1402
1466
|
this.subclassOfId = 0xf5b399ac;
|
|
1403
|
-
this._slots = [
|
|
1467
|
+
this._slots = ['channel', 'id'];
|
|
1404
1468
|
this.channel = params.channel;
|
|
1405
1469
|
this.id = params.id;
|
|
1406
1470
|
}
|
|
1407
1471
|
/**
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1472
|
+
* Generate the TLObject from buffer.
|
|
1473
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1474
|
+
*/
|
|
1411
1475
|
static async read(_data, ..._args) {
|
|
1412
1476
|
// no flags
|
|
1413
1477
|
let channel = await TLObject.read(_data);
|
|
1414
1478
|
let id = await TLObject.read(_data, Primitive.Int);
|
|
1415
|
-
return new ReadMessageContents({
|
|
1479
|
+
return new ReadMessageContents({ channel: channel, id: id });
|
|
1416
1480
|
}
|
|
1417
1481
|
/**
|
|
1418
|
-
|
|
1419
|
-
|
|
1482
|
+
* Generate buffer from TLObject.
|
|
1483
|
+
*/
|
|
1420
1484
|
write() {
|
|
1421
1485
|
const b = new BytesIO();
|
|
1422
1486
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -1425,7 +1489,7 @@ export class ReadMessageContents extends TLObject {
|
|
|
1425
1489
|
b.write(this.channel.write());
|
|
1426
1490
|
}
|
|
1427
1491
|
if (this.id) {
|
|
1428
|
-
b.write(
|
|
1492
|
+
b.write(Primitive.Vector.write(this.id, Primitive.Int));
|
|
1429
1493
|
}
|
|
1430
1494
|
return b.buffer;
|
|
1431
1495
|
}
|
|
@@ -1437,42 +1501,42 @@ export class DeleteHistory extends TLObject {
|
|
|
1437
1501
|
maxId;
|
|
1438
1502
|
constructor(params) {
|
|
1439
1503
|
super();
|
|
1440
|
-
this.classType =
|
|
1441
|
-
this.className =
|
|
1504
|
+
this.classType = 'functions';
|
|
1505
|
+
this.className = 'channels.DeleteHistory';
|
|
1442
1506
|
this.constructorId = 0x9baa9647;
|
|
1443
1507
|
this.subclassOfId = 0x8af52aac;
|
|
1444
|
-
this._slots = [
|
|
1508
|
+
this._slots = ['forEveryone', 'channel', 'maxId'];
|
|
1445
1509
|
this.forEveryone = params.forEveryone;
|
|
1446
1510
|
this.channel = params.channel;
|
|
1447
1511
|
this.maxId = params.maxId;
|
|
1448
1512
|
}
|
|
1449
1513
|
/**
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1514
|
+
* Generate the TLObject from buffer.
|
|
1515
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1516
|
+
*/
|
|
1453
1517
|
static async read(_data, ..._args) {
|
|
1454
1518
|
// @ts-ignore
|
|
1455
1519
|
let flags = await Primitive.Int.read(_data);
|
|
1456
|
-
let forEveryone =
|
|
1520
|
+
let forEveryone = flags & (1 << 0) ? true : false;
|
|
1457
1521
|
let channel = await TLObject.read(_data);
|
|
1458
1522
|
let maxId = await Primitive.Int.read(_data);
|
|
1459
|
-
return new DeleteHistory({
|
|
1523
|
+
return new DeleteHistory({ forEveryone: forEveryone, channel: channel, maxId: maxId });
|
|
1460
1524
|
}
|
|
1461
1525
|
/**
|
|
1462
|
-
|
|
1463
|
-
|
|
1526
|
+
* Generate buffer from TLObject.
|
|
1527
|
+
*/
|
|
1464
1528
|
write() {
|
|
1465
1529
|
const b = new BytesIO();
|
|
1466
1530
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
1467
1531
|
// @ts-ignore
|
|
1468
1532
|
let flags = 0;
|
|
1469
|
-
flags |= this.forEveryone ?
|
|
1470
|
-
b.write(
|
|
1533
|
+
flags |= this.forEveryone ? 1 << 0 : 0;
|
|
1534
|
+
b.write(Primitive.Int.write(flags));
|
|
1471
1535
|
if (this.channel !== undefined) {
|
|
1472
1536
|
b.write(this.channel.write());
|
|
1473
1537
|
}
|
|
1474
1538
|
if (this.maxId !== undefined) {
|
|
1475
|
-
b.write(
|
|
1539
|
+
b.write(Primitive.Int.write(this.maxId));
|
|
1476
1540
|
}
|
|
1477
1541
|
return b.buffer;
|
|
1478
1542
|
}
|
|
@@ -1483,27 +1547,27 @@ export class TogglePreHistoryHidden extends TLObject {
|
|
|
1483
1547
|
enabled;
|
|
1484
1548
|
constructor(params) {
|
|
1485
1549
|
super();
|
|
1486
|
-
this.classType =
|
|
1487
|
-
this.className =
|
|
1550
|
+
this.classType = 'functions';
|
|
1551
|
+
this.className = 'channels.TogglePreHistoryHidden';
|
|
1488
1552
|
this.constructorId = 0xeabbb94c;
|
|
1489
1553
|
this.subclassOfId = 0x8af52aac;
|
|
1490
|
-
this._slots = [
|
|
1554
|
+
this._slots = ['channel', 'enabled'];
|
|
1491
1555
|
this.channel = params.channel;
|
|
1492
1556
|
this.enabled = params.enabled;
|
|
1493
1557
|
}
|
|
1494
1558
|
/**
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1559
|
+
* Generate the TLObject from buffer.
|
|
1560
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1561
|
+
*/
|
|
1498
1562
|
static async read(_data, ..._args) {
|
|
1499
1563
|
// no flags
|
|
1500
1564
|
let channel = await TLObject.read(_data);
|
|
1501
1565
|
let enabled = await Primitive.Bool.read(_data);
|
|
1502
|
-
return new TogglePreHistoryHidden({
|
|
1566
|
+
return new TogglePreHistoryHidden({ channel: channel, enabled: enabled });
|
|
1503
1567
|
}
|
|
1504
1568
|
/**
|
|
1505
|
-
|
|
1506
|
-
|
|
1569
|
+
* Generate buffer from TLObject.
|
|
1570
|
+
*/
|
|
1507
1571
|
write() {
|
|
1508
1572
|
const b = new BytesIO();
|
|
1509
1573
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -1512,7 +1576,7 @@ export class TogglePreHistoryHidden extends TLObject {
|
|
|
1512
1576
|
b.write(this.channel.write());
|
|
1513
1577
|
}
|
|
1514
1578
|
if (this.enabled !== undefined) {
|
|
1515
|
-
b.write(
|
|
1579
|
+
b.write(Primitive.Bool.write(this.enabled));
|
|
1516
1580
|
}
|
|
1517
1581
|
return b.buffer;
|
|
1518
1582
|
}
|
|
@@ -1522,31 +1586,31 @@ export class GetLeftChannels extends TLObject {
|
|
|
1522
1586
|
offset;
|
|
1523
1587
|
constructor(params) {
|
|
1524
1588
|
super();
|
|
1525
|
-
this.classType =
|
|
1526
|
-
this.className =
|
|
1589
|
+
this.classType = 'functions';
|
|
1590
|
+
this.className = 'channels.GetLeftChannels';
|
|
1527
1591
|
this.constructorId = 0x8341ecc0;
|
|
1528
1592
|
this.subclassOfId = 0x99d5cb14;
|
|
1529
|
-
this._slots = [
|
|
1593
|
+
this._slots = ['offset'];
|
|
1530
1594
|
this.offset = params.offset;
|
|
1531
1595
|
}
|
|
1532
1596
|
/**
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1597
|
+
* Generate the TLObject from buffer.
|
|
1598
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1599
|
+
*/
|
|
1536
1600
|
static async read(_data, ..._args) {
|
|
1537
1601
|
// no flags
|
|
1538
1602
|
let offset = await Primitive.Int.read(_data);
|
|
1539
|
-
return new GetLeftChannels({
|
|
1603
|
+
return new GetLeftChannels({ offset: offset });
|
|
1540
1604
|
}
|
|
1541
1605
|
/**
|
|
1542
|
-
|
|
1543
|
-
|
|
1606
|
+
* Generate buffer from TLObject.
|
|
1607
|
+
*/
|
|
1544
1608
|
write() {
|
|
1545
1609
|
const b = new BytesIO();
|
|
1546
1610
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
1547
1611
|
// no flags
|
|
1548
1612
|
if (this.offset !== undefined) {
|
|
1549
|
-
b.write(
|
|
1613
|
+
b.write(Primitive.Int.write(this.offset));
|
|
1550
1614
|
}
|
|
1551
1615
|
return b.buffer;
|
|
1552
1616
|
}
|
|
@@ -1555,23 +1619,23 @@ export class GetGroupsForDiscussion extends TLObject {
|
|
|
1555
1619
|
__response__;
|
|
1556
1620
|
constructor() {
|
|
1557
1621
|
super();
|
|
1558
|
-
this.classType =
|
|
1559
|
-
this.className =
|
|
1622
|
+
this.classType = 'functions';
|
|
1623
|
+
this.className = 'channels.GetGroupsForDiscussion';
|
|
1560
1624
|
this.constructorId = 0xf5dad378;
|
|
1561
1625
|
this.subclassOfId = 0x99d5cb14;
|
|
1562
1626
|
this._slots = [];
|
|
1563
1627
|
}
|
|
1564
1628
|
/**
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1629
|
+
* Generate the TLObject from buffer.
|
|
1630
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1631
|
+
*/
|
|
1568
1632
|
static async read(_data, ..._args) {
|
|
1569
1633
|
// no flags
|
|
1570
1634
|
return new GetGroupsForDiscussion();
|
|
1571
1635
|
}
|
|
1572
1636
|
/**
|
|
1573
|
-
|
|
1574
|
-
|
|
1637
|
+
* Generate buffer from TLObject.
|
|
1638
|
+
*/
|
|
1575
1639
|
write() {
|
|
1576
1640
|
const b = new BytesIO();
|
|
1577
1641
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -1585,27 +1649,27 @@ export class SetDiscussionGroup extends TLObject {
|
|
|
1585
1649
|
group;
|
|
1586
1650
|
constructor(params) {
|
|
1587
1651
|
super();
|
|
1588
|
-
this.classType =
|
|
1589
|
-
this.className =
|
|
1652
|
+
this.classType = 'functions';
|
|
1653
|
+
this.className = 'channels.SetDiscussionGroup';
|
|
1590
1654
|
this.constructorId = 0x40582bb2;
|
|
1591
1655
|
this.subclassOfId = 0xf5b399ac;
|
|
1592
|
-
this._slots = [
|
|
1656
|
+
this._slots = ['broadcast', 'group'];
|
|
1593
1657
|
this.broadcast = params.broadcast;
|
|
1594
1658
|
this.group = params.group;
|
|
1595
1659
|
}
|
|
1596
1660
|
/**
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1661
|
+
* Generate the TLObject from buffer.
|
|
1662
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1663
|
+
*/
|
|
1600
1664
|
static async read(_data, ..._args) {
|
|
1601
1665
|
// no flags
|
|
1602
1666
|
let broadcast = await TLObject.read(_data);
|
|
1603
1667
|
let group = await TLObject.read(_data);
|
|
1604
|
-
return new SetDiscussionGroup({
|
|
1668
|
+
return new SetDiscussionGroup({ broadcast: broadcast, group: group });
|
|
1605
1669
|
}
|
|
1606
1670
|
/**
|
|
1607
|
-
|
|
1608
|
-
|
|
1671
|
+
* Generate buffer from TLObject.
|
|
1672
|
+
*/
|
|
1609
1673
|
write() {
|
|
1610
1674
|
const b = new BytesIO();
|
|
1611
1675
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -1626,29 +1690,29 @@ export class EditLocation extends TLObject {
|
|
|
1626
1690
|
address;
|
|
1627
1691
|
constructor(params) {
|
|
1628
1692
|
super();
|
|
1629
|
-
this.classType =
|
|
1630
|
-
this.className =
|
|
1693
|
+
this.classType = 'functions';
|
|
1694
|
+
this.className = 'channels.EditLocation';
|
|
1631
1695
|
this.constructorId = 0x58e63f6d;
|
|
1632
1696
|
this.subclassOfId = 0xf5b399ac;
|
|
1633
|
-
this._slots = [
|
|
1697
|
+
this._slots = ['channel', 'geoPoint', 'address'];
|
|
1634
1698
|
this.channel = params.channel;
|
|
1635
1699
|
this.geoPoint = params.geoPoint;
|
|
1636
1700
|
this.address = params.address;
|
|
1637
1701
|
}
|
|
1638
1702
|
/**
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1703
|
+
* Generate the TLObject from buffer.
|
|
1704
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1705
|
+
*/
|
|
1642
1706
|
static async read(_data, ..._args) {
|
|
1643
1707
|
// no flags
|
|
1644
1708
|
let channel = await TLObject.read(_data);
|
|
1645
1709
|
let geoPoint = await TLObject.read(_data);
|
|
1646
1710
|
let address = await Primitive.String.read(_data);
|
|
1647
|
-
return new EditLocation({
|
|
1711
|
+
return new EditLocation({ channel: channel, geoPoint: geoPoint, address: address });
|
|
1648
1712
|
}
|
|
1649
1713
|
/**
|
|
1650
|
-
|
|
1651
|
-
|
|
1714
|
+
* Generate buffer from TLObject.
|
|
1715
|
+
*/
|
|
1652
1716
|
write() {
|
|
1653
1717
|
const b = new BytesIO();
|
|
1654
1718
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -1660,7 +1724,7 @@ export class EditLocation extends TLObject {
|
|
|
1660
1724
|
b.write(this.geoPoint.write());
|
|
1661
1725
|
}
|
|
1662
1726
|
if (this.address !== undefined) {
|
|
1663
|
-
b.write(
|
|
1727
|
+
b.write(Primitive.String.write(this.address));
|
|
1664
1728
|
}
|
|
1665
1729
|
return b.buffer;
|
|
1666
1730
|
}
|
|
@@ -1671,27 +1735,27 @@ export class ToggleSlowMode extends TLObject {
|
|
|
1671
1735
|
seconds;
|
|
1672
1736
|
constructor(params) {
|
|
1673
1737
|
super();
|
|
1674
|
-
this.classType =
|
|
1675
|
-
this.className =
|
|
1738
|
+
this.classType = 'functions';
|
|
1739
|
+
this.className = 'channels.ToggleSlowMode';
|
|
1676
1740
|
this.constructorId = 0xedd49ef0;
|
|
1677
1741
|
this.subclassOfId = 0x8af52aac;
|
|
1678
|
-
this._slots = [
|
|
1742
|
+
this._slots = ['channel', 'seconds'];
|
|
1679
1743
|
this.channel = params.channel;
|
|
1680
1744
|
this.seconds = params.seconds;
|
|
1681
1745
|
}
|
|
1682
1746
|
/**
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1747
|
+
* Generate the TLObject from buffer.
|
|
1748
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1749
|
+
*/
|
|
1686
1750
|
static async read(_data, ..._args) {
|
|
1687
1751
|
// no flags
|
|
1688
1752
|
let channel = await TLObject.read(_data);
|
|
1689
1753
|
let seconds = await Primitive.Int.read(_data);
|
|
1690
|
-
return new ToggleSlowMode({
|
|
1754
|
+
return new ToggleSlowMode({ channel: channel, seconds: seconds });
|
|
1691
1755
|
}
|
|
1692
1756
|
/**
|
|
1693
|
-
|
|
1694
|
-
|
|
1757
|
+
* Generate buffer from TLObject.
|
|
1758
|
+
*/
|
|
1695
1759
|
write() {
|
|
1696
1760
|
const b = new BytesIO();
|
|
1697
1761
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -1700,7 +1764,7 @@ export class ToggleSlowMode extends TLObject {
|
|
|
1700
1764
|
b.write(this.channel.write());
|
|
1701
1765
|
}
|
|
1702
1766
|
if (this.seconds !== undefined) {
|
|
1703
|
-
b.write(
|
|
1767
|
+
b.write(Primitive.Int.write(this.seconds));
|
|
1704
1768
|
}
|
|
1705
1769
|
return b.buffer;
|
|
1706
1770
|
}
|
|
@@ -1709,23 +1773,23 @@ export class GetInactiveChannels extends TLObject {
|
|
|
1709
1773
|
__response__;
|
|
1710
1774
|
constructor() {
|
|
1711
1775
|
super();
|
|
1712
|
-
this.classType =
|
|
1713
|
-
this.className =
|
|
1776
|
+
this.classType = 'functions';
|
|
1777
|
+
this.className = 'channels.GetInactiveChannels';
|
|
1714
1778
|
this.constructorId = 0x11e831ee;
|
|
1715
1779
|
this.subclassOfId = 0x8bf3d7d4;
|
|
1716
1780
|
this._slots = [];
|
|
1717
1781
|
}
|
|
1718
1782
|
/**
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1783
|
+
* Generate the TLObject from buffer.
|
|
1784
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1785
|
+
*/
|
|
1722
1786
|
static async read(_data, ..._args) {
|
|
1723
1787
|
// no flags
|
|
1724
1788
|
return new GetInactiveChannels();
|
|
1725
1789
|
}
|
|
1726
1790
|
/**
|
|
1727
|
-
|
|
1728
|
-
|
|
1791
|
+
* Generate buffer from TLObject.
|
|
1792
|
+
*/
|
|
1729
1793
|
write() {
|
|
1730
1794
|
const b = new BytesIO();
|
|
1731
1795
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -1738,25 +1802,25 @@ export class ConvertToGigagroup extends TLObject {
|
|
|
1738
1802
|
channel;
|
|
1739
1803
|
constructor(params) {
|
|
1740
1804
|
super();
|
|
1741
|
-
this.classType =
|
|
1742
|
-
this.className =
|
|
1805
|
+
this.classType = 'functions';
|
|
1806
|
+
this.className = 'channels.ConvertToGigagroup';
|
|
1743
1807
|
this.constructorId = 0xb290c69;
|
|
1744
1808
|
this.subclassOfId = 0x8af52aac;
|
|
1745
|
-
this._slots = [
|
|
1809
|
+
this._slots = ['channel'];
|
|
1746
1810
|
this.channel = params.channel;
|
|
1747
1811
|
}
|
|
1748
1812
|
/**
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1813
|
+
* Generate the TLObject from buffer.
|
|
1814
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1815
|
+
*/
|
|
1752
1816
|
static async read(_data, ..._args) {
|
|
1753
1817
|
// no flags
|
|
1754
1818
|
let channel = await TLObject.read(_data);
|
|
1755
|
-
return new ConvertToGigagroup({
|
|
1819
|
+
return new ConvertToGigagroup({ channel: channel });
|
|
1756
1820
|
}
|
|
1757
1821
|
/**
|
|
1758
|
-
|
|
1759
|
-
|
|
1822
|
+
* Generate buffer from TLObject.
|
|
1823
|
+
*/
|
|
1760
1824
|
write() {
|
|
1761
1825
|
const b = new BytesIO();
|
|
1762
1826
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -1774,38 +1838,42 @@ export class GetSendAs extends TLObject {
|
|
|
1774
1838
|
peer;
|
|
1775
1839
|
constructor(params) {
|
|
1776
1840
|
super();
|
|
1777
|
-
this.classType =
|
|
1778
|
-
this.className =
|
|
1841
|
+
this.classType = 'functions';
|
|
1842
|
+
this.className = 'channels.GetSendAs';
|
|
1779
1843
|
this.constructorId = 0xe785a43f;
|
|
1780
1844
|
this.subclassOfId = 0x38cb8d21;
|
|
1781
|
-
this._slots = [
|
|
1845
|
+
this._slots = ['forPaidReactions', 'forLiveStories', 'peer'];
|
|
1782
1846
|
this.forPaidReactions = params.forPaidReactions;
|
|
1783
1847
|
this.forLiveStories = params.forLiveStories;
|
|
1784
1848
|
this.peer = params.peer;
|
|
1785
1849
|
}
|
|
1786
1850
|
/**
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1851
|
+
* Generate the TLObject from buffer.
|
|
1852
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1853
|
+
*/
|
|
1790
1854
|
static async read(_data, ..._args) {
|
|
1791
1855
|
// @ts-ignore
|
|
1792
1856
|
let flags = await Primitive.Int.read(_data);
|
|
1793
|
-
let forPaidReactions =
|
|
1794
|
-
let forLiveStories =
|
|
1857
|
+
let forPaidReactions = flags & (1 << 0) ? true : false;
|
|
1858
|
+
let forLiveStories = flags & (1 << 1) ? true : false;
|
|
1795
1859
|
let peer = await TLObject.read(_data);
|
|
1796
|
-
return new GetSendAs({
|
|
1860
|
+
return new GetSendAs({
|
|
1861
|
+
forPaidReactions: forPaidReactions,
|
|
1862
|
+
forLiveStories: forLiveStories,
|
|
1863
|
+
peer: peer,
|
|
1864
|
+
});
|
|
1797
1865
|
}
|
|
1798
1866
|
/**
|
|
1799
|
-
|
|
1800
|
-
|
|
1867
|
+
* Generate buffer from TLObject.
|
|
1868
|
+
*/
|
|
1801
1869
|
write() {
|
|
1802
1870
|
const b = new BytesIO();
|
|
1803
1871
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
1804
1872
|
// @ts-ignore
|
|
1805
1873
|
let flags = 0;
|
|
1806
|
-
flags |= this.forPaidReactions ?
|
|
1807
|
-
flags |= this.forLiveStories ?
|
|
1808
|
-
b.write(
|
|
1874
|
+
flags |= this.forPaidReactions ? 1 << 0 : 0;
|
|
1875
|
+
flags |= this.forLiveStories ? 1 << 1 : 0;
|
|
1876
|
+
b.write(Primitive.Int.write(flags));
|
|
1809
1877
|
if (this.peer !== undefined) {
|
|
1810
1878
|
b.write(this.peer.write());
|
|
1811
1879
|
}
|
|
@@ -1818,27 +1886,27 @@ export class DeleteParticipantHistory extends TLObject {
|
|
|
1818
1886
|
participant;
|
|
1819
1887
|
constructor(params) {
|
|
1820
1888
|
super();
|
|
1821
|
-
this.classType =
|
|
1822
|
-
this.className =
|
|
1889
|
+
this.classType = 'functions';
|
|
1890
|
+
this.className = 'channels.DeleteParticipantHistory';
|
|
1823
1891
|
this.constructorId = 0x367544db;
|
|
1824
1892
|
this.subclassOfId = 0x2c49c116;
|
|
1825
|
-
this._slots = [
|
|
1893
|
+
this._slots = ['channel', 'participant'];
|
|
1826
1894
|
this.channel = params.channel;
|
|
1827
1895
|
this.participant = params.participant;
|
|
1828
1896
|
}
|
|
1829
1897
|
/**
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1898
|
+
* Generate the TLObject from buffer.
|
|
1899
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1900
|
+
*/
|
|
1833
1901
|
static async read(_data, ..._args) {
|
|
1834
1902
|
// no flags
|
|
1835
1903
|
let channel = await TLObject.read(_data);
|
|
1836
1904
|
let participant = await TLObject.read(_data);
|
|
1837
|
-
return new DeleteParticipantHistory({
|
|
1905
|
+
return new DeleteParticipantHistory({ channel: channel, participant: participant });
|
|
1838
1906
|
}
|
|
1839
1907
|
/**
|
|
1840
|
-
|
|
1841
|
-
|
|
1908
|
+
* Generate buffer from TLObject.
|
|
1909
|
+
*/
|
|
1842
1910
|
write() {
|
|
1843
1911
|
const b = new BytesIO();
|
|
1844
1912
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -1858,27 +1926,27 @@ export class ToggleJoinToSend extends TLObject {
|
|
|
1858
1926
|
enabled;
|
|
1859
1927
|
constructor(params) {
|
|
1860
1928
|
super();
|
|
1861
|
-
this.classType =
|
|
1862
|
-
this.className =
|
|
1929
|
+
this.classType = 'functions';
|
|
1930
|
+
this.className = 'channels.ToggleJoinToSend';
|
|
1863
1931
|
this.constructorId = 0xe4cb9580;
|
|
1864
1932
|
this.subclassOfId = 0x8af52aac;
|
|
1865
|
-
this._slots = [
|
|
1933
|
+
this._slots = ['channel', 'enabled'];
|
|
1866
1934
|
this.channel = params.channel;
|
|
1867
1935
|
this.enabled = params.enabled;
|
|
1868
1936
|
}
|
|
1869
1937
|
/**
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1938
|
+
* Generate the TLObject from buffer.
|
|
1939
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1940
|
+
*/
|
|
1873
1941
|
static async read(_data, ..._args) {
|
|
1874
1942
|
// no flags
|
|
1875
1943
|
let channel = await TLObject.read(_data);
|
|
1876
1944
|
let enabled = await Primitive.Bool.read(_data);
|
|
1877
|
-
return new ToggleJoinToSend({
|
|
1945
|
+
return new ToggleJoinToSend({ channel: channel, enabled: enabled });
|
|
1878
1946
|
}
|
|
1879
1947
|
/**
|
|
1880
|
-
|
|
1881
|
-
|
|
1948
|
+
* Generate buffer from TLObject.
|
|
1949
|
+
*/
|
|
1882
1950
|
write() {
|
|
1883
1951
|
const b = new BytesIO();
|
|
1884
1952
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -1887,7 +1955,7 @@ export class ToggleJoinToSend extends TLObject {
|
|
|
1887
1955
|
b.write(this.channel.write());
|
|
1888
1956
|
}
|
|
1889
1957
|
if (this.enabled !== undefined) {
|
|
1890
|
-
b.write(
|
|
1958
|
+
b.write(Primitive.Bool.write(this.enabled));
|
|
1891
1959
|
}
|
|
1892
1960
|
return b.buffer;
|
|
1893
1961
|
}
|
|
@@ -1900,45 +1968,50 @@ export class ToggleJoinRequest extends TLObject {
|
|
|
1900
1968
|
guardBot;
|
|
1901
1969
|
constructor(params) {
|
|
1902
1970
|
super();
|
|
1903
|
-
this.classType =
|
|
1904
|
-
this.className =
|
|
1971
|
+
this.classType = 'functions';
|
|
1972
|
+
this.className = 'channels.ToggleJoinRequest';
|
|
1905
1973
|
this.constructorId = 0xecc2618;
|
|
1906
1974
|
this.subclassOfId = 0x8af52aac;
|
|
1907
|
-
this._slots = [
|
|
1975
|
+
this._slots = ['applyToInvites', 'channel', 'enabled', 'guardBot'];
|
|
1908
1976
|
this.applyToInvites = params.applyToInvites;
|
|
1909
1977
|
this.channel = params.channel;
|
|
1910
1978
|
this.enabled = params.enabled;
|
|
1911
1979
|
this.guardBot = params.guardBot;
|
|
1912
1980
|
}
|
|
1913
1981
|
/**
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1982
|
+
* Generate the TLObject from buffer.
|
|
1983
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1984
|
+
*/
|
|
1917
1985
|
static async read(_data, ..._args) {
|
|
1918
1986
|
// @ts-ignore
|
|
1919
1987
|
let flags = await Primitive.Int.read(_data);
|
|
1920
|
-
let applyToInvites =
|
|
1988
|
+
let applyToInvites = flags & (1 << 1) ? true : false;
|
|
1921
1989
|
let channel = await TLObject.read(_data);
|
|
1922
1990
|
let enabled = await Primitive.Bool.read(_data);
|
|
1923
|
-
let guardBot =
|
|
1924
|
-
return new ToggleJoinRequest({
|
|
1991
|
+
let guardBot = flags & (1 << 0) ? await TLObject.read(_data) : undefined;
|
|
1992
|
+
return new ToggleJoinRequest({
|
|
1993
|
+
applyToInvites: applyToInvites,
|
|
1994
|
+
channel: channel,
|
|
1995
|
+
enabled: enabled,
|
|
1996
|
+
guardBot: guardBot,
|
|
1997
|
+
});
|
|
1925
1998
|
}
|
|
1926
1999
|
/**
|
|
1927
|
-
|
|
1928
|
-
|
|
2000
|
+
* Generate buffer from TLObject.
|
|
2001
|
+
*/
|
|
1929
2002
|
write() {
|
|
1930
2003
|
const b = new BytesIO();
|
|
1931
2004
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
1932
2005
|
// @ts-ignore
|
|
1933
2006
|
let flags = 0;
|
|
1934
|
-
flags |= this.applyToInvites ?
|
|
1935
|
-
flags |= this.guardBot !== undefined ?
|
|
1936
|
-
b.write(
|
|
2007
|
+
flags |= this.applyToInvites ? 1 << 1 : 0;
|
|
2008
|
+
flags |= this.guardBot !== undefined ? 1 << 0 : 0;
|
|
2009
|
+
b.write(Primitive.Int.write(flags));
|
|
1937
2010
|
if (this.channel !== undefined) {
|
|
1938
2011
|
b.write(this.channel.write());
|
|
1939
2012
|
}
|
|
1940
2013
|
if (this.enabled !== undefined) {
|
|
1941
|
-
b.write(
|
|
2014
|
+
b.write(Primitive.Bool.write(this.enabled));
|
|
1942
2015
|
}
|
|
1943
2016
|
if (this.guardBot !== undefined) {
|
|
1944
2017
|
b.write(this.guardBot.write());
|
|
@@ -1952,27 +2025,27 @@ export class ReorderUsernames extends TLObject {
|
|
|
1952
2025
|
order;
|
|
1953
2026
|
constructor(params) {
|
|
1954
2027
|
super();
|
|
1955
|
-
this.classType =
|
|
1956
|
-
this.className =
|
|
2028
|
+
this.classType = 'functions';
|
|
2029
|
+
this.className = 'channels.ReorderUsernames';
|
|
1957
2030
|
this.constructorId = 0xb45ced1d;
|
|
1958
2031
|
this.subclassOfId = 0xf5b399ac;
|
|
1959
|
-
this._slots = [
|
|
2032
|
+
this._slots = ['channel', 'order'];
|
|
1960
2033
|
this.channel = params.channel;
|
|
1961
2034
|
this.order = params.order;
|
|
1962
2035
|
}
|
|
1963
2036
|
/**
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
2037
|
+
* Generate the TLObject from buffer.
|
|
2038
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
2039
|
+
*/
|
|
1967
2040
|
static async read(_data, ..._args) {
|
|
1968
2041
|
// no flags
|
|
1969
2042
|
let channel = await TLObject.read(_data);
|
|
1970
2043
|
let order = await TLObject.read(_data, Primitive.String);
|
|
1971
|
-
return new ReorderUsernames({
|
|
2044
|
+
return new ReorderUsernames({ channel: channel, order: order });
|
|
1972
2045
|
}
|
|
1973
2046
|
/**
|
|
1974
|
-
|
|
1975
|
-
|
|
2047
|
+
* Generate buffer from TLObject.
|
|
2048
|
+
*/
|
|
1976
2049
|
write() {
|
|
1977
2050
|
const b = new BytesIO();
|
|
1978
2051
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -1981,7 +2054,7 @@ export class ReorderUsernames extends TLObject {
|
|
|
1981
2054
|
b.write(this.channel.write());
|
|
1982
2055
|
}
|
|
1983
2056
|
if (this.order) {
|
|
1984
|
-
b.write(
|
|
2057
|
+
b.write(Primitive.Vector.write(this.order, Primitive.String));
|
|
1985
2058
|
}
|
|
1986
2059
|
return b.buffer;
|
|
1987
2060
|
}
|
|
@@ -1993,29 +2066,29 @@ export class ToggleUsername extends TLObject {
|
|
|
1993
2066
|
active;
|
|
1994
2067
|
constructor(params) {
|
|
1995
2068
|
super();
|
|
1996
|
-
this.classType =
|
|
1997
|
-
this.className =
|
|
2069
|
+
this.classType = 'functions';
|
|
2070
|
+
this.className = 'channels.ToggleUsername';
|
|
1998
2071
|
this.constructorId = 0x50f24105;
|
|
1999
2072
|
this.subclassOfId = 0xf5b399ac;
|
|
2000
|
-
this._slots = [
|
|
2073
|
+
this._slots = ['channel', 'username', 'active'];
|
|
2001
2074
|
this.channel = params.channel;
|
|
2002
2075
|
this.username = params.username;
|
|
2003
2076
|
this.active = params.active;
|
|
2004
2077
|
}
|
|
2005
2078
|
/**
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2079
|
+
* Generate the TLObject from buffer.
|
|
2080
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
2081
|
+
*/
|
|
2009
2082
|
static async read(_data, ..._args) {
|
|
2010
2083
|
// no flags
|
|
2011
2084
|
let channel = await TLObject.read(_data);
|
|
2012
2085
|
let username = await Primitive.String.read(_data);
|
|
2013
2086
|
let active = await Primitive.Bool.read(_data);
|
|
2014
|
-
return new ToggleUsername({
|
|
2087
|
+
return new ToggleUsername({ channel: channel, username: username, active: active });
|
|
2015
2088
|
}
|
|
2016
2089
|
/**
|
|
2017
|
-
|
|
2018
|
-
|
|
2090
|
+
* Generate buffer from TLObject.
|
|
2091
|
+
*/
|
|
2019
2092
|
write() {
|
|
2020
2093
|
const b = new BytesIO();
|
|
2021
2094
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -2024,10 +2097,10 @@ export class ToggleUsername extends TLObject {
|
|
|
2024
2097
|
b.write(this.channel.write());
|
|
2025
2098
|
}
|
|
2026
2099
|
if (this.username !== undefined) {
|
|
2027
|
-
b.write(
|
|
2100
|
+
b.write(Primitive.String.write(this.username));
|
|
2028
2101
|
}
|
|
2029
2102
|
if (this.active !== undefined) {
|
|
2030
|
-
b.write(
|
|
2103
|
+
b.write(Primitive.Bool.write(this.active));
|
|
2031
2104
|
}
|
|
2032
2105
|
return b.buffer;
|
|
2033
2106
|
}
|
|
@@ -2037,25 +2110,25 @@ export class DeactivateAllUsernames extends TLObject {
|
|
|
2037
2110
|
channel;
|
|
2038
2111
|
constructor(params) {
|
|
2039
2112
|
super();
|
|
2040
|
-
this.classType =
|
|
2041
|
-
this.className =
|
|
2113
|
+
this.classType = 'functions';
|
|
2114
|
+
this.className = 'channels.DeactivateAllUsernames';
|
|
2042
2115
|
this.constructorId = 0xa245dd3;
|
|
2043
2116
|
this.subclassOfId = 0xf5b399ac;
|
|
2044
|
-
this._slots = [
|
|
2117
|
+
this._slots = ['channel'];
|
|
2045
2118
|
this.channel = params.channel;
|
|
2046
2119
|
}
|
|
2047
2120
|
/**
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2121
|
+
* Generate the TLObject from buffer.
|
|
2122
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
2123
|
+
*/
|
|
2051
2124
|
static async read(_data, ..._args) {
|
|
2052
2125
|
// no flags
|
|
2053
2126
|
let channel = await TLObject.read(_data);
|
|
2054
|
-
return new DeactivateAllUsernames({
|
|
2127
|
+
return new DeactivateAllUsernames({ channel: channel });
|
|
2055
2128
|
}
|
|
2056
2129
|
/**
|
|
2057
|
-
|
|
2058
|
-
|
|
2130
|
+
* Generate buffer from TLObject.
|
|
2131
|
+
*/
|
|
2059
2132
|
write() {
|
|
2060
2133
|
const b = new BytesIO();
|
|
2061
2134
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -2074,31 +2147,31 @@ export class ToggleForum extends TLObject {
|
|
|
2074
2147
|
sidebar;
|
|
2075
2148
|
constructor(params) {
|
|
2076
2149
|
super();
|
|
2077
|
-
this.classType =
|
|
2078
|
-
this.className =
|
|
2150
|
+
this.classType = 'functions';
|
|
2151
|
+
this.className = 'channels.ToggleForum';
|
|
2079
2152
|
this.constructorId = 0xa2952b54;
|
|
2080
2153
|
this.subclassOfId = 0x8af52aac;
|
|
2081
|
-
this._slots = [
|
|
2154
|
+
this._slots = ['channel', 'enabled', 'tabs', 'sidebar'];
|
|
2082
2155
|
this.channel = params.channel;
|
|
2083
2156
|
this.enabled = params.enabled;
|
|
2084
2157
|
this.tabs = params.tabs;
|
|
2085
2158
|
this.sidebar = params.sidebar;
|
|
2086
2159
|
}
|
|
2087
2160
|
/**
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2161
|
+
* Generate the TLObject from buffer.
|
|
2162
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
2163
|
+
*/
|
|
2091
2164
|
static async read(_data, ..._args) {
|
|
2092
2165
|
// no flags
|
|
2093
2166
|
let channel = await TLObject.read(_data);
|
|
2094
2167
|
let enabled = await Primitive.Bool.read(_data);
|
|
2095
2168
|
let tabs = await Primitive.Bool.read(_data);
|
|
2096
2169
|
let sidebar = await Primitive.Bool.read(_data);
|
|
2097
|
-
return new ToggleForum({
|
|
2170
|
+
return new ToggleForum({ channel: channel, enabled: enabled, tabs: tabs, sidebar: sidebar });
|
|
2098
2171
|
}
|
|
2099
2172
|
/**
|
|
2100
|
-
|
|
2101
|
-
|
|
2173
|
+
* Generate buffer from TLObject.
|
|
2174
|
+
*/
|
|
2102
2175
|
write() {
|
|
2103
2176
|
const b = new BytesIO();
|
|
2104
2177
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -2107,13 +2180,13 @@ export class ToggleForum extends TLObject {
|
|
|
2107
2180
|
b.write(this.channel.write());
|
|
2108
2181
|
}
|
|
2109
2182
|
if (this.enabled !== undefined) {
|
|
2110
|
-
b.write(
|
|
2183
|
+
b.write(Primitive.Bool.write(this.enabled));
|
|
2111
2184
|
}
|
|
2112
2185
|
if (this.tabs !== undefined) {
|
|
2113
|
-
b.write(
|
|
2186
|
+
b.write(Primitive.Bool.write(this.tabs));
|
|
2114
2187
|
}
|
|
2115
2188
|
if (this.sidebar !== undefined) {
|
|
2116
|
-
b.write(
|
|
2189
|
+
b.write(Primitive.Bool.write(this.sidebar));
|
|
2117
2190
|
}
|
|
2118
2191
|
return b.buffer;
|
|
2119
2192
|
}
|
|
@@ -2124,27 +2197,27 @@ export class ToggleAntiSpam extends TLObject {
|
|
|
2124
2197
|
enabled;
|
|
2125
2198
|
constructor(params) {
|
|
2126
2199
|
super();
|
|
2127
|
-
this.classType =
|
|
2128
|
-
this.className =
|
|
2200
|
+
this.classType = 'functions';
|
|
2201
|
+
this.className = 'channels.ToggleAntiSpam';
|
|
2129
2202
|
this.constructorId = 0x68f3e4eb;
|
|
2130
2203
|
this.subclassOfId = 0x8af52aac;
|
|
2131
|
-
this._slots = [
|
|
2204
|
+
this._slots = ['channel', 'enabled'];
|
|
2132
2205
|
this.channel = params.channel;
|
|
2133
2206
|
this.enabled = params.enabled;
|
|
2134
2207
|
}
|
|
2135
2208
|
/**
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2209
|
+
* Generate the TLObject from buffer.
|
|
2210
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
2211
|
+
*/
|
|
2139
2212
|
static async read(_data, ..._args) {
|
|
2140
2213
|
// no flags
|
|
2141
2214
|
let channel = await TLObject.read(_data);
|
|
2142
2215
|
let enabled = await Primitive.Bool.read(_data);
|
|
2143
|
-
return new ToggleAntiSpam({
|
|
2216
|
+
return new ToggleAntiSpam({ channel: channel, enabled: enabled });
|
|
2144
2217
|
}
|
|
2145
2218
|
/**
|
|
2146
|
-
|
|
2147
|
-
|
|
2219
|
+
* Generate buffer from TLObject.
|
|
2220
|
+
*/
|
|
2148
2221
|
write() {
|
|
2149
2222
|
const b = new BytesIO();
|
|
2150
2223
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -2153,7 +2226,7 @@ export class ToggleAntiSpam extends TLObject {
|
|
|
2153
2226
|
b.write(this.channel.write());
|
|
2154
2227
|
}
|
|
2155
2228
|
if (this.enabled !== undefined) {
|
|
2156
|
-
b.write(
|
|
2229
|
+
b.write(Primitive.Bool.write(this.enabled));
|
|
2157
2230
|
}
|
|
2158
2231
|
return b.buffer;
|
|
2159
2232
|
}
|
|
@@ -2164,27 +2237,27 @@ export class ReportAntiSpamFalsePositive extends TLObject {
|
|
|
2164
2237
|
msgId;
|
|
2165
2238
|
constructor(params) {
|
|
2166
2239
|
super();
|
|
2167
|
-
this.classType =
|
|
2168
|
-
this.className =
|
|
2240
|
+
this.classType = 'functions';
|
|
2241
|
+
this.className = 'channels.ReportAntiSpamFalsePositive';
|
|
2169
2242
|
this.constructorId = 0xa850a693;
|
|
2170
2243
|
this.subclassOfId = 0xf5b399ac;
|
|
2171
|
-
this._slots = [
|
|
2244
|
+
this._slots = ['channel', 'msgId'];
|
|
2172
2245
|
this.channel = params.channel;
|
|
2173
2246
|
this.msgId = params.msgId;
|
|
2174
2247
|
}
|
|
2175
2248
|
/**
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2249
|
+
* Generate the TLObject from buffer.
|
|
2250
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
2251
|
+
*/
|
|
2179
2252
|
static async read(_data, ..._args) {
|
|
2180
2253
|
// no flags
|
|
2181
2254
|
let channel = await TLObject.read(_data);
|
|
2182
2255
|
let msgId = await Primitive.Int.read(_data);
|
|
2183
|
-
return new ReportAntiSpamFalsePositive({
|
|
2256
|
+
return new ReportAntiSpamFalsePositive({ channel: channel, msgId: msgId });
|
|
2184
2257
|
}
|
|
2185
2258
|
/**
|
|
2186
|
-
|
|
2187
|
-
|
|
2259
|
+
* Generate buffer from TLObject.
|
|
2260
|
+
*/
|
|
2188
2261
|
write() {
|
|
2189
2262
|
const b = new BytesIO();
|
|
2190
2263
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -2193,7 +2266,7 @@ export class ReportAntiSpamFalsePositive extends TLObject {
|
|
|
2193
2266
|
b.write(this.channel.write());
|
|
2194
2267
|
}
|
|
2195
2268
|
if (this.msgId !== undefined) {
|
|
2196
|
-
b.write(
|
|
2269
|
+
b.write(Primitive.Int.write(this.msgId));
|
|
2197
2270
|
}
|
|
2198
2271
|
return b.buffer;
|
|
2199
2272
|
}
|
|
@@ -2204,27 +2277,27 @@ export class ToggleParticipantsHidden extends TLObject {
|
|
|
2204
2277
|
enabled;
|
|
2205
2278
|
constructor(params) {
|
|
2206
2279
|
super();
|
|
2207
|
-
this.classType =
|
|
2208
|
-
this.className =
|
|
2280
|
+
this.classType = 'functions';
|
|
2281
|
+
this.className = 'channels.ToggleParticipantsHidden';
|
|
2209
2282
|
this.constructorId = 0x6a6e7854;
|
|
2210
2283
|
this.subclassOfId = 0x8af52aac;
|
|
2211
|
-
this._slots = [
|
|
2284
|
+
this._slots = ['channel', 'enabled'];
|
|
2212
2285
|
this.channel = params.channel;
|
|
2213
2286
|
this.enabled = params.enabled;
|
|
2214
2287
|
}
|
|
2215
2288
|
/**
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2289
|
+
* Generate the TLObject from buffer.
|
|
2290
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
2291
|
+
*/
|
|
2219
2292
|
static async read(_data, ..._args) {
|
|
2220
2293
|
// no flags
|
|
2221
2294
|
let channel = await TLObject.read(_data);
|
|
2222
2295
|
let enabled = await Primitive.Bool.read(_data);
|
|
2223
|
-
return new ToggleParticipantsHidden({
|
|
2296
|
+
return new ToggleParticipantsHidden({ channel: channel, enabled: enabled });
|
|
2224
2297
|
}
|
|
2225
2298
|
/**
|
|
2226
|
-
|
|
2227
|
-
|
|
2299
|
+
* Generate buffer from TLObject.
|
|
2300
|
+
*/
|
|
2228
2301
|
write() {
|
|
2229
2302
|
const b = new BytesIO();
|
|
2230
2303
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -2233,7 +2306,7 @@ export class ToggleParticipantsHidden extends TLObject {
|
|
|
2233
2306
|
b.write(this.channel.write());
|
|
2234
2307
|
}
|
|
2235
2308
|
if (this.enabled !== undefined) {
|
|
2236
|
-
b.write(
|
|
2309
|
+
b.write(Primitive.Bool.write(this.enabled));
|
|
2237
2310
|
}
|
|
2238
2311
|
return b.buffer;
|
|
2239
2312
|
}
|
|
@@ -2246,49 +2319,54 @@ export class UpdateColor extends TLObject {
|
|
|
2246
2319
|
backgroundEmojiId;
|
|
2247
2320
|
constructor(params) {
|
|
2248
2321
|
super();
|
|
2249
|
-
this.classType =
|
|
2250
|
-
this.className =
|
|
2322
|
+
this.classType = 'functions';
|
|
2323
|
+
this.className = 'channels.UpdateColor';
|
|
2251
2324
|
this.constructorId = 0xd8aa3671;
|
|
2252
2325
|
this.subclassOfId = 0x8af52aac;
|
|
2253
|
-
this._slots = [
|
|
2326
|
+
this._slots = ['forProfile', 'channel', 'color', 'backgroundEmojiId'];
|
|
2254
2327
|
this.forProfile = params.forProfile;
|
|
2255
2328
|
this.channel = params.channel;
|
|
2256
2329
|
this.color = params.color;
|
|
2257
2330
|
this.backgroundEmojiId = params.backgroundEmojiId;
|
|
2258
2331
|
}
|
|
2259
2332
|
/**
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2333
|
+
* Generate the TLObject from buffer.
|
|
2334
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
2335
|
+
*/
|
|
2263
2336
|
static async read(_data, ..._args) {
|
|
2264
2337
|
// @ts-ignore
|
|
2265
2338
|
let flags = await Primitive.Int.read(_data);
|
|
2266
|
-
let forProfile =
|
|
2339
|
+
let forProfile = flags & (1 << 1) ? true : false;
|
|
2267
2340
|
let channel = await TLObject.read(_data);
|
|
2268
|
-
let color =
|
|
2269
|
-
let backgroundEmojiId =
|
|
2270
|
-
return new UpdateColor({
|
|
2341
|
+
let color = flags & (1 << 2) ? await Primitive.Int.read(_data) : undefined;
|
|
2342
|
+
let backgroundEmojiId = flags & (1 << 0) ? await Primitive.Long.read(_data) : undefined;
|
|
2343
|
+
return new UpdateColor({
|
|
2344
|
+
forProfile: forProfile,
|
|
2345
|
+
channel: channel,
|
|
2346
|
+
color: color,
|
|
2347
|
+
backgroundEmojiId: backgroundEmojiId,
|
|
2348
|
+
});
|
|
2271
2349
|
}
|
|
2272
2350
|
/**
|
|
2273
|
-
|
|
2274
|
-
|
|
2351
|
+
* Generate buffer from TLObject.
|
|
2352
|
+
*/
|
|
2275
2353
|
write() {
|
|
2276
2354
|
const b = new BytesIO();
|
|
2277
2355
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
2278
2356
|
// @ts-ignore
|
|
2279
2357
|
let flags = 0;
|
|
2280
|
-
flags |= this.forProfile ?
|
|
2281
|
-
flags |= this.color !== undefined ?
|
|
2282
|
-
flags |= this.backgroundEmojiId !== undefined ?
|
|
2283
|
-
b.write(
|
|
2358
|
+
flags |= this.forProfile ? 1 << 1 : 0;
|
|
2359
|
+
flags |= this.color !== undefined ? 1 << 2 : 0;
|
|
2360
|
+
flags |= this.backgroundEmojiId !== undefined ? 1 << 0 : 0;
|
|
2361
|
+
b.write(Primitive.Int.write(flags));
|
|
2284
2362
|
if (this.channel !== undefined) {
|
|
2285
2363
|
b.write(this.channel.write());
|
|
2286
2364
|
}
|
|
2287
2365
|
if (this.color !== undefined) {
|
|
2288
|
-
b.write(
|
|
2366
|
+
b.write(Primitive.Int.write(this.color));
|
|
2289
2367
|
}
|
|
2290
2368
|
if (this.backgroundEmojiId !== undefined) {
|
|
2291
|
-
b.write(
|
|
2369
|
+
b.write(Primitive.Long.write(this.backgroundEmojiId));
|
|
2292
2370
|
}
|
|
2293
2371
|
return b.buffer;
|
|
2294
2372
|
}
|
|
@@ -2299,27 +2377,27 @@ export class ToggleViewForumAsMessages extends TLObject {
|
|
|
2299
2377
|
enabled;
|
|
2300
2378
|
constructor(params) {
|
|
2301
2379
|
super();
|
|
2302
|
-
this.classType =
|
|
2303
|
-
this.className =
|
|
2380
|
+
this.classType = 'functions';
|
|
2381
|
+
this.className = 'channels.ToggleViewForumAsMessages';
|
|
2304
2382
|
this.constructorId = 0x9738bb15;
|
|
2305
2383
|
this.subclassOfId = 0x8af52aac;
|
|
2306
|
-
this._slots = [
|
|
2384
|
+
this._slots = ['channel', 'enabled'];
|
|
2307
2385
|
this.channel = params.channel;
|
|
2308
2386
|
this.enabled = params.enabled;
|
|
2309
2387
|
}
|
|
2310
2388
|
/**
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2389
|
+
* Generate the TLObject from buffer.
|
|
2390
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
2391
|
+
*/
|
|
2314
2392
|
static async read(_data, ..._args) {
|
|
2315
2393
|
// no flags
|
|
2316
2394
|
let channel = await TLObject.read(_data);
|
|
2317
2395
|
let enabled = await Primitive.Bool.read(_data);
|
|
2318
|
-
return new ToggleViewForumAsMessages({
|
|
2396
|
+
return new ToggleViewForumAsMessages({ channel: channel, enabled: enabled });
|
|
2319
2397
|
}
|
|
2320
2398
|
/**
|
|
2321
|
-
|
|
2322
|
-
|
|
2399
|
+
* Generate buffer from TLObject.
|
|
2400
|
+
*/
|
|
2323
2401
|
write() {
|
|
2324
2402
|
const b = new BytesIO();
|
|
2325
2403
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -2328,7 +2406,7 @@ export class ToggleViewForumAsMessages extends TLObject {
|
|
|
2328
2406
|
b.write(this.channel.write());
|
|
2329
2407
|
}
|
|
2330
2408
|
if (this.enabled !== undefined) {
|
|
2331
|
-
b.write(
|
|
2409
|
+
b.write(Primitive.Bool.write(this.enabled));
|
|
2332
2410
|
}
|
|
2333
2411
|
return b.buffer;
|
|
2334
2412
|
}
|
|
@@ -2338,33 +2416,33 @@ export class GetChannelRecommendations extends TLObject {
|
|
|
2338
2416
|
channel;
|
|
2339
2417
|
constructor(params) {
|
|
2340
2418
|
super();
|
|
2341
|
-
this.classType =
|
|
2342
|
-
this.className =
|
|
2419
|
+
this.classType = 'functions';
|
|
2420
|
+
this.className = 'channels.GetChannelRecommendations';
|
|
2343
2421
|
this.constructorId = 0x25a71742;
|
|
2344
2422
|
this.subclassOfId = 0x99d5cb14;
|
|
2345
|
-
this._slots = [
|
|
2423
|
+
this._slots = ['channel'];
|
|
2346
2424
|
this.channel = params.channel;
|
|
2347
2425
|
}
|
|
2348
2426
|
/**
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2427
|
+
* Generate the TLObject from buffer.
|
|
2428
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
2429
|
+
*/
|
|
2352
2430
|
static async read(_data, ..._args) {
|
|
2353
2431
|
// @ts-ignore
|
|
2354
2432
|
let flags = await Primitive.Int.read(_data);
|
|
2355
|
-
let channel =
|
|
2356
|
-
return new GetChannelRecommendations({
|
|
2433
|
+
let channel = flags & (1 << 0) ? await TLObject.read(_data) : undefined;
|
|
2434
|
+
return new GetChannelRecommendations({ channel: channel });
|
|
2357
2435
|
}
|
|
2358
2436
|
/**
|
|
2359
|
-
|
|
2360
|
-
|
|
2437
|
+
* Generate buffer from TLObject.
|
|
2438
|
+
*/
|
|
2361
2439
|
write() {
|
|
2362
2440
|
const b = new BytesIO();
|
|
2363
2441
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
2364
2442
|
// @ts-ignore
|
|
2365
2443
|
let flags = 0;
|
|
2366
|
-
flags |= this.channel !== undefined ?
|
|
2367
|
-
b.write(
|
|
2444
|
+
flags |= this.channel !== undefined ? 1 << 0 : 0;
|
|
2445
|
+
b.write(Primitive.Int.write(flags));
|
|
2368
2446
|
if (this.channel !== undefined) {
|
|
2369
2447
|
b.write(this.channel.write());
|
|
2370
2448
|
}
|
|
@@ -2377,27 +2455,27 @@ export class UpdateEmojiStatus extends TLObject {
|
|
|
2377
2455
|
emojiStatus;
|
|
2378
2456
|
constructor(params) {
|
|
2379
2457
|
super();
|
|
2380
|
-
this.classType =
|
|
2381
|
-
this.className =
|
|
2458
|
+
this.classType = 'functions';
|
|
2459
|
+
this.className = 'channels.UpdateEmojiStatus';
|
|
2382
2460
|
this.constructorId = 0xf0d3e6a8;
|
|
2383
2461
|
this.subclassOfId = 0x8af52aac;
|
|
2384
|
-
this._slots = [
|
|
2462
|
+
this._slots = ['channel', 'emojiStatus'];
|
|
2385
2463
|
this.channel = params.channel;
|
|
2386
2464
|
this.emojiStatus = params.emojiStatus;
|
|
2387
2465
|
}
|
|
2388
2466
|
/**
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2467
|
+
* Generate the TLObject from buffer.
|
|
2468
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
2469
|
+
*/
|
|
2392
2470
|
static async read(_data, ..._args) {
|
|
2393
2471
|
// no flags
|
|
2394
2472
|
let channel = await TLObject.read(_data);
|
|
2395
2473
|
let emojiStatus = await TLObject.read(_data);
|
|
2396
|
-
return new UpdateEmojiStatus({
|
|
2474
|
+
return new UpdateEmojiStatus({ channel: channel, emojiStatus: emojiStatus });
|
|
2397
2475
|
}
|
|
2398
2476
|
/**
|
|
2399
|
-
|
|
2400
|
-
|
|
2477
|
+
* Generate buffer from TLObject.
|
|
2478
|
+
*/
|
|
2401
2479
|
write() {
|
|
2402
2480
|
const b = new BytesIO();
|
|
2403
2481
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -2417,27 +2495,27 @@ export class SetBoostsToUnblockRestrictions extends TLObject {
|
|
|
2417
2495
|
boosts;
|
|
2418
2496
|
constructor(params) {
|
|
2419
2497
|
super();
|
|
2420
|
-
this.classType =
|
|
2421
|
-
this.className =
|
|
2498
|
+
this.classType = 'functions';
|
|
2499
|
+
this.className = 'channels.SetBoostsToUnblockRestrictions';
|
|
2422
2500
|
this.constructorId = 0xad399cee;
|
|
2423
2501
|
this.subclassOfId = 0x8af52aac;
|
|
2424
|
-
this._slots = [
|
|
2502
|
+
this._slots = ['channel', 'boosts'];
|
|
2425
2503
|
this.channel = params.channel;
|
|
2426
2504
|
this.boosts = params.boosts;
|
|
2427
2505
|
}
|
|
2428
2506
|
/**
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2507
|
+
* Generate the TLObject from buffer.
|
|
2508
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
2509
|
+
*/
|
|
2432
2510
|
static async read(_data, ..._args) {
|
|
2433
2511
|
// no flags
|
|
2434
2512
|
let channel = await TLObject.read(_data);
|
|
2435
2513
|
let boosts = await Primitive.Int.read(_data);
|
|
2436
|
-
return new SetBoostsToUnblockRestrictions({
|
|
2514
|
+
return new SetBoostsToUnblockRestrictions({ channel: channel, boosts: boosts });
|
|
2437
2515
|
}
|
|
2438
2516
|
/**
|
|
2439
|
-
|
|
2440
|
-
|
|
2517
|
+
* Generate buffer from TLObject.
|
|
2518
|
+
*/
|
|
2441
2519
|
write() {
|
|
2442
2520
|
const b = new BytesIO();
|
|
2443
2521
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -2446,7 +2524,7 @@ export class SetBoostsToUnblockRestrictions extends TLObject {
|
|
|
2446
2524
|
b.write(this.channel.write());
|
|
2447
2525
|
}
|
|
2448
2526
|
if (this.boosts !== undefined) {
|
|
2449
|
-
b.write(
|
|
2527
|
+
b.write(Primitive.Int.write(this.boosts));
|
|
2450
2528
|
}
|
|
2451
2529
|
return b.buffer;
|
|
2452
2530
|
}
|
|
@@ -2457,27 +2535,27 @@ export class SetEmojiStickers extends TLObject {
|
|
|
2457
2535
|
stickerset;
|
|
2458
2536
|
constructor(params) {
|
|
2459
2537
|
super();
|
|
2460
|
-
this.classType =
|
|
2461
|
-
this.className =
|
|
2538
|
+
this.classType = 'functions';
|
|
2539
|
+
this.className = 'channels.SetEmojiStickers';
|
|
2462
2540
|
this.constructorId = 0x3cd930b7;
|
|
2463
2541
|
this.subclassOfId = 0xf5b399ac;
|
|
2464
|
-
this._slots = [
|
|
2542
|
+
this._slots = ['channel', 'stickerset'];
|
|
2465
2543
|
this.channel = params.channel;
|
|
2466
2544
|
this.stickerset = params.stickerset;
|
|
2467
2545
|
}
|
|
2468
2546
|
/**
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2547
|
+
* Generate the TLObject from buffer.
|
|
2548
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
2549
|
+
*/
|
|
2472
2550
|
static async read(_data, ..._args) {
|
|
2473
2551
|
// no flags
|
|
2474
2552
|
let channel = await TLObject.read(_data);
|
|
2475
2553
|
let stickerset = await TLObject.read(_data);
|
|
2476
|
-
return new SetEmojiStickers({
|
|
2554
|
+
return new SetEmojiStickers({ channel: channel, stickerset: stickerset });
|
|
2477
2555
|
}
|
|
2478
2556
|
/**
|
|
2479
|
-
|
|
2480
|
-
|
|
2557
|
+
* Generate buffer from TLObject.
|
|
2558
|
+
*/
|
|
2481
2559
|
write() {
|
|
2482
2560
|
const b = new BytesIO();
|
|
2483
2561
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -2497,27 +2575,27 @@ export class RestrictSponsoredMessages extends TLObject {
|
|
|
2497
2575
|
restricted;
|
|
2498
2576
|
constructor(params) {
|
|
2499
2577
|
super();
|
|
2500
|
-
this.classType =
|
|
2501
|
-
this.className =
|
|
2578
|
+
this.classType = 'functions';
|
|
2579
|
+
this.className = 'channels.RestrictSponsoredMessages';
|
|
2502
2580
|
this.constructorId = 0x9ae91519;
|
|
2503
2581
|
this.subclassOfId = 0x8af52aac;
|
|
2504
|
-
this._slots = [
|
|
2582
|
+
this._slots = ['channel', 'restricted'];
|
|
2505
2583
|
this.channel = params.channel;
|
|
2506
2584
|
this.restricted = params.restricted;
|
|
2507
2585
|
}
|
|
2508
2586
|
/**
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2587
|
+
* Generate the TLObject from buffer.
|
|
2588
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
2589
|
+
*/
|
|
2512
2590
|
static async read(_data, ..._args) {
|
|
2513
2591
|
// no flags
|
|
2514
2592
|
let channel = await TLObject.read(_data);
|
|
2515
2593
|
let restricted = await Primitive.Bool.read(_data);
|
|
2516
|
-
return new RestrictSponsoredMessages({
|
|
2594
|
+
return new RestrictSponsoredMessages({ channel: channel, restricted: restricted });
|
|
2517
2595
|
}
|
|
2518
2596
|
/**
|
|
2519
|
-
|
|
2520
|
-
|
|
2597
|
+
* Generate buffer from TLObject.
|
|
2598
|
+
*/
|
|
2521
2599
|
write() {
|
|
2522
2600
|
const b = new BytesIO();
|
|
2523
2601
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -2526,7 +2604,7 @@ export class RestrictSponsoredMessages extends TLObject {
|
|
|
2526
2604
|
b.write(this.channel.write());
|
|
2527
2605
|
}
|
|
2528
2606
|
if (this.restricted !== undefined) {
|
|
2529
|
-
b.write(
|
|
2607
|
+
b.write(Primitive.Bool.write(this.restricted));
|
|
2530
2608
|
}
|
|
2531
2609
|
return b.buffer;
|
|
2532
2610
|
}
|
|
@@ -2542,11 +2620,19 @@ export class SearchPosts extends TLObject {
|
|
|
2542
2620
|
allowPaidStars;
|
|
2543
2621
|
constructor(params) {
|
|
2544
2622
|
super();
|
|
2545
|
-
this.classType =
|
|
2546
|
-
this.className =
|
|
2623
|
+
this.classType = 'functions';
|
|
2624
|
+
this.className = 'channels.SearchPosts';
|
|
2547
2625
|
this.constructorId = 0xf2c4f24d;
|
|
2548
2626
|
this.subclassOfId = 0xd4b40b5e;
|
|
2549
|
-
this._slots = [
|
|
2627
|
+
this._slots = [
|
|
2628
|
+
'hashtag',
|
|
2629
|
+
'query',
|
|
2630
|
+
'offsetRate',
|
|
2631
|
+
'offsetPeer',
|
|
2632
|
+
'offsetId',
|
|
2633
|
+
'limit',
|
|
2634
|
+
'allowPaidStars',
|
|
2635
|
+
];
|
|
2550
2636
|
this.hashtag = params.hashtag;
|
|
2551
2637
|
this.query = params.query;
|
|
2552
2638
|
this.offsetRate = params.offsetRate;
|
|
@@ -2556,53 +2642,61 @@ export class SearchPosts extends TLObject {
|
|
|
2556
2642
|
this.allowPaidStars = params.allowPaidStars;
|
|
2557
2643
|
}
|
|
2558
2644
|
/**
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2645
|
+
* Generate the TLObject from buffer.
|
|
2646
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
2647
|
+
*/
|
|
2562
2648
|
static async read(_data, ..._args) {
|
|
2563
2649
|
// @ts-ignore
|
|
2564
2650
|
let flags = await Primitive.Int.read(_data);
|
|
2565
|
-
let hashtag =
|
|
2566
|
-
let query =
|
|
2651
|
+
let hashtag = flags & (1 << 0) ? await Primitive.String.read(_data) : undefined;
|
|
2652
|
+
let query = flags & (1 << 1) ? await Primitive.String.read(_data) : undefined;
|
|
2567
2653
|
let offsetRate = await Primitive.Int.read(_data);
|
|
2568
2654
|
let offsetPeer = await TLObject.read(_data);
|
|
2569
2655
|
let offsetId = await Primitive.Int.read(_data);
|
|
2570
2656
|
let limit = await Primitive.Int.read(_data);
|
|
2571
|
-
let allowPaidStars =
|
|
2572
|
-
return new SearchPosts({
|
|
2657
|
+
let allowPaidStars = flags & (1 << 2) ? await Primitive.Long.read(_data) : undefined;
|
|
2658
|
+
return new SearchPosts({
|
|
2659
|
+
hashtag: hashtag,
|
|
2660
|
+
query: query,
|
|
2661
|
+
offsetRate: offsetRate,
|
|
2662
|
+
offsetPeer: offsetPeer,
|
|
2663
|
+
offsetId: offsetId,
|
|
2664
|
+
limit: limit,
|
|
2665
|
+
allowPaidStars: allowPaidStars,
|
|
2666
|
+
});
|
|
2573
2667
|
}
|
|
2574
2668
|
/**
|
|
2575
|
-
|
|
2576
|
-
|
|
2669
|
+
* Generate buffer from TLObject.
|
|
2670
|
+
*/
|
|
2577
2671
|
write() {
|
|
2578
2672
|
const b = new BytesIO();
|
|
2579
2673
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
2580
2674
|
// @ts-ignore
|
|
2581
2675
|
let flags = 0;
|
|
2582
|
-
flags |= this.hashtag !== undefined ?
|
|
2583
|
-
flags |= this.query !== undefined ?
|
|
2584
|
-
flags |= this.allowPaidStars !== undefined ?
|
|
2585
|
-
b.write(
|
|
2676
|
+
flags |= this.hashtag !== undefined ? 1 << 0 : 0;
|
|
2677
|
+
flags |= this.query !== undefined ? 1 << 1 : 0;
|
|
2678
|
+
flags |= this.allowPaidStars !== undefined ? 1 << 2 : 0;
|
|
2679
|
+
b.write(Primitive.Int.write(flags));
|
|
2586
2680
|
if (this.hashtag !== undefined) {
|
|
2587
|
-
b.write(
|
|
2681
|
+
b.write(Primitive.String.write(this.hashtag));
|
|
2588
2682
|
}
|
|
2589
2683
|
if (this.query !== undefined) {
|
|
2590
|
-
b.write(
|
|
2684
|
+
b.write(Primitive.String.write(this.query));
|
|
2591
2685
|
}
|
|
2592
2686
|
if (this.offsetRate !== undefined) {
|
|
2593
|
-
b.write(
|
|
2687
|
+
b.write(Primitive.Int.write(this.offsetRate));
|
|
2594
2688
|
}
|
|
2595
2689
|
if (this.offsetPeer !== undefined) {
|
|
2596
2690
|
b.write(this.offsetPeer.write());
|
|
2597
2691
|
}
|
|
2598
2692
|
if (this.offsetId !== undefined) {
|
|
2599
|
-
b.write(
|
|
2693
|
+
b.write(Primitive.Int.write(this.offsetId));
|
|
2600
2694
|
}
|
|
2601
2695
|
if (this.limit !== undefined) {
|
|
2602
|
-
b.write(
|
|
2696
|
+
b.write(Primitive.Int.write(this.limit));
|
|
2603
2697
|
}
|
|
2604
2698
|
if (this.allowPaidStars !== undefined) {
|
|
2605
|
-
b.write(
|
|
2699
|
+
b.write(Primitive.Long.write(this.allowPaidStars));
|
|
2606
2700
|
}
|
|
2607
2701
|
return b.buffer;
|
|
2608
2702
|
}
|
|
@@ -2614,42 +2708,46 @@ export class UpdatePaidMessagesPrice extends TLObject {
|
|
|
2614
2708
|
sendPaidMessagesStars;
|
|
2615
2709
|
constructor(params) {
|
|
2616
2710
|
super();
|
|
2617
|
-
this.classType =
|
|
2618
|
-
this.className =
|
|
2711
|
+
this.classType = 'functions';
|
|
2712
|
+
this.className = 'channels.UpdatePaidMessagesPrice';
|
|
2619
2713
|
this.constructorId = 0x4b12327b;
|
|
2620
2714
|
this.subclassOfId = 0x8af52aac;
|
|
2621
|
-
this._slots = [
|
|
2715
|
+
this._slots = ['broadcastMessagesAllowed', 'channel', 'sendPaidMessagesStars'];
|
|
2622
2716
|
this.broadcastMessagesAllowed = params.broadcastMessagesAllowed;
|
|
2623
2717
|
this.channel = params.channel;
|
|
2624
2718
|
this.sendPaidMessagesStars = params.sendPaidMessagesStars;
|
|
2625
2719
|
}
|
|
2626
2720
|
/**
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2721
|
+
* Generate the TLObject from buffer.
|
|
2722
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
2723
|
+
*/
|
|
2630
2724
|
static async read(_data, ..._args) {
|
|
2631
2725
|
// @ts-ignore
|
|
2632
2726
|
let flags = await Primitive.Int.read(_data);
|
|
2633
|
-
let broadcastMessagesAllowed =
|
|
2727
|
+
let broadcastMessagesAllowed = flags & (1 << 0) ? true : false;
|
|
2634
2728
|
let channel = await TLObject.read(_data);
|
|
2635
2729
|
let sendPaidMessagesStars = await Primitive.Long.read(_data);
|
|
2636
|
-
return new UpdatePaidMessagesPrice({
|
|
2730
|
+
return new UpdatePaidMessagesPrice({
|
|
2731
|
+
broadcastMessagesAllowed: broadcastMessagesAllowed,
|
|
2732
|
+
channel: channel,
|
|
2733
|
+
sendPaidMessagesStars: sendPaidMessagesStars,
|
|
2734
|
+
});
|
|
2637
2735
|
}
|
|
2638
2736
|
/**
|
|
2639
|
-
|
|
2640
|
-
|
|
2737
|
+
* Generate buffer from TLObject.
|
|
2738
|
+
*/
|
|
2641
2739
|
write() {
|
|
2642
2740
|
const b = new BytesIO();
|
|
2643
2741
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
2644
2742
|
// @ts-ignore
|
|
2645
2743
|
let flags = 0;
|
|
2646
|
-
flags |= this.broadcastMessagesAllowed ?
|
|
2647
|
-
b.write(
|
|
2744
|
+
flags |= this.broadcastMessagesAllowed ? 1 << 0 : 0;
|
|
2745
|
+
b.write(Primitive.Int.write(flags));
|
|
2648
2746
|
if (this.channel !== undefined) {
|
|
2649
2747
|
b.write(this.channel.write());
|
|
2650
2748
|
}
|
|
2651
2749
|
if (this.sendPaidMessagesStars !== undefined) {
|
|
2652
|
-
b.write(
|
|
2750
|
+
b.write(Primitive.Long.write(this.sendPaidMessagesStars));
|
|
2653
2751
|
}
|
|
2654
2752
|
return b.buffer;
|
|
2655
2753
|
}
|
|
@@ -2660,27 +2758,27 @@ export class ToggleAutotranslation extends TLObject {
|
|
|
2660
2758
|
enabled;
|
|
2661
2759
|
constructor(params) {
|
|
2662
2760
|
super();
|
|
2663
|
-
this.classType =
|
|
2664
|
-
this.className =
|
|
2761
|
+
this.classType = 'functions';
|
|
2762
|
+
this.className = 'channels.ToggleAutotranslation';
|
|
2665
2763
|
this.constructorId = 0x167fc0a1;
|
|
2666
2764
|
this.subclassOfId = 0x8af52aac;
|
|
2667
|
-
this._slots = [
|
|
2765
|
+
this._slots = ['channel', 'enabled'];
|
|
2668
2766
|
this.channel = params.channel;
|
|
2669
2767
|
this.enabled = params.enabled;
|
|
2670
2768
|
}
|
|
2671
2769
|
/**
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2770
|
+
* Generate the TLObject from buffer.
|
|
2771
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
2772
|
+
*/
|
|
2675
2773
|
static async read(_data, ..._args) {
|
|
2676
2774
|
// no flags
|
|
2677
2775
|
let channel = await TLObject.read(_data);
|
|
2678
2776
|
let enabled = await Primitive.Bool.read(_data);
|
|
2679
|
-
return new ToggleAutotranslation({
|
|
2777
|
+
return new ToggleAutotranslation({ channel: channel, enabled: enabled });
|
|
2680
2778
|
}
|
|
2681
2779
|
/**
|
|
2682
|
-
|
|
2683
|
-
|
|
2780
|
+
* Generate buffer from TLObject.
|
|
2781
|
+
*/
|
|
2684
2782
|
write() {
|
|
2685
2783
|
const b = new BytesIO();
|
|
2686
2784
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -2689,7 +2787,7 @@ export class ToggleAutotranslation extends TLObject {
|
|
|
2689
2787
|
b.write(this.channel.write());
|
|
2690
2788
|
}
|
|
2691
2789
|
if (this.enabled !== undefined) {
|
|
2692
|
-
b.write(
|
|
2790
|
+
b.write(Primitive.Bool.write(this.enabled));
|
|
2693
2791
|
}
|
|
2694
2792
|
return b.buffer;
|
|
2695
2793
|
}
|
|
@@ -2700,27 +2798,27 @@ export class GetMessageAuthor extends TLObject {
|
|
|
2700
2798
|
id;
|
|
2701
2799
|
constructor(params) {
|
|
2702
2800
|
super();
|
|
2703
|
-
this.classType =
|
|
2704
|
-
this.className =
|
|
2801
|
+
this.classType = 'functions';
|
|
2802
|
+
this.className = 'channels.GetMessageAuthor';
|
|
2705
2803
|
this.constructorId = 0xece2a0e6;
|
|
2706
2804
|
this.subclassOfId = 0x2da17977;
|
|
2707
|
-
this._slots = [
|
|
2805
|
+
this._slots = ['channel', 'id'];
|
|
2708
2806
|
this.channel = params.channel;
|
|
2709
2807
|
this.id = params.id;
|
|
2710
2808
|
}
|
|
2711
2809
|
/**
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2810
|
+
* Generate the TLObject from buffer.
|
|
2811
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
2812
|
+
*/
|
|
2715
2813
|
static async read(_data, ..._args) {
|
|
2716
2814
|
// no flags
|
|
2717
2815
|
let channel = await TLObject.read(_data);
|
|
2718
2816
|
let id = await Primitive.Int.read(_data);
|
|
2719
|
-
return new GetMessageAuthor({
|
|
2817
|
+
return new GetMessageAuthor({ channel: channel, id: id });
|
|
2720
2818
|
}
|
|
2721
2819
|
/**
|
|
2722
|
-
|
|
2723
|
-
|
|
2820
|
+
* Generate buffer from TLObject.
|
|
2821
|
+
*/
|
|
2724
2822
|
write() {
|
|
2725
2823
|
const b = new BytesIO();
|
|
2726
2824
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -2729,7 +2827,7 @@ export class GetMessageAuthor extends TLObject {
|
|
|
2729
2827
|
b.write(this.channel.write());
|
|
2730
2828
|
}
|
|
2731
2829
|
if (this.id !== undefined) {
|
|
2732
|
-
b.write(
|
|
2830
|
+
b.write(Primitive.Int.write(this.id));
|
|
2733
2831
|
}
|
|
2734
2832
|
return b.buffer;
|
|
2735
2833
|
}
|
|
@@ -2739,35 +2837,35 @@ export class CheckSearchPostsFlood extends TLObject {
|
|
|
2739
2837
|
query;
|
|
2740
2838
|
constructor(params) {
|
|
2741
2839
|
super();
|
|
2742
|
-
this.classType =
|
|
2743
|
-
this.className =
|
|
2840
|
+
this.classType = 'functions';
|
|
2841
|
+
this.className = 'channels.CheckSearchPostsFlood';
|
|
2744
2842
|
this.constructorId = 0x22567115;
|
|
2745
2843
|
this.subclassOfId = 0xc2c0ccc1;
|
|
2746
|
-
this._slots = [
|
|
2844
|
+
this._slots = ['query'];
|
|
2747
2845
|
this.query = params.query;
|
|
2748
2846
|
}
|
|
2749
2847
|
/**
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2848
|
+
* Generate the TLObject from buffer.
|
|
2849
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
2850
|
+
*/
|
|
2753
2851
|
static async read(_data, ..._args) {
|
|
2754
2852
|
// @ts-ignore
|
|
2755
2853
|
let flags = await Primitive.Int.read(_data);
|
|
2756
|
-
let query =
|
|
2757
|
-
return new CheckSearchPostsFlood({
|
|
2854
|
+
let query = flags & (1 << 0) ? await Primitive.String.read(_data) : undefined;
|
|
2855
|
+
return new CheckSearchPostsFlood({ query: query });
|
|
2758
2856
|
}
|
|
2759
2857
|
/**
|
|
2760
|
-
|
|
2761
|
-
|
|
2858
|
+
* Generate buffer from TLObject.
|
|
2859
|
+
*/
|
|
2762
2860
|
write() {
|
|
2763
2861
|
const b = new BytesIO();
|
|
2764
2862
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
2765
2863
|
// @ts-ignore
|
|
2766
2864
|
let flags = 0;
|
|
2767
|
-
flags |= this.query !== undefined ?
|
|
2768
|
-
b.write(
|
|
2865
|
+
flags |= this.query !== undefined ? 1 << 0 : 0;
|
|
2866
|
+
b.write(Primitive.Int.write(flags));
|
|
2769
2867
|
if (this.query !== undefined) {
|
|
2770
|
-
b.write(
|
|
2868
|
+
b.write(Primitive.String.write(this.query));
|
|
2771
2869
|
}
|
|
2772
2870
|
return b.buffer;
|
|
2773
2871
|
}
|
|
@@ -2778,27 +2876,27 @@ export class SetMainProfileTab extends TLObject {
|
|
|
2778
2876
|
tab;
|
|
2779
2877
|
constructor(params) {
|
|
2780
2878
|
super();
|
|
2781
|
-
this.classType =
|
|
2782
|
-
this.className =
|
|
2879
|
+
this.classType = 'functions';
|
|
2880
|
+
this.className = 'channels.SetMainProfileTab';
|
|
2783
2881
|
this.constructorId = 0x3583fcb1;
|
|
2784
2882
|
this.subclassOfId = 0xf5b399ac;
|
|
2785
|
-
this._slots = [
|
|
2883
|
+
this._slots = ['channel', 'tab'];
|
|
2786
2884
|
this.channel = params.channel;
|
|
2787
2885
|
this.tab = params.tab;
|
|
2788
2886
|
}
|
|
2789
2887
|
/**
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2888
|
+
* Generate the TLObject from buffer.
|
|
2889
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
2890
|
+
*/
|
|
2793
2891
|
static async read(_data, ..._args) {
|
|
2794
2892
|
// no flags
|
|
2795
2893
|
let channel = await TLObject.read(_data);
|
|
2796
2894
|
let tab = await TLObject.read(_data);
|
|
2797
|
-
return new SetMainProfileTab({
|
|
2895
|
+
return new SetMainProfileTab({ channel: channel, tab: tab });
|
|
2798
2896
|
}
|
|
2799
2897
|
/**
|
|
2800
|
-
|
|
2801
|
-
|
|
2898
|
+
* Generate buffer from TLObject.
|
|
2899
|
+
*/
|
|
2802
2900
|
write() {
|
|
2803
2901
|
const b = new BytesIO();
|
|
2804
2902
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -2812,3 +2910,43 @@ export class SetMainProfileTab extends TLObject {
|
|
|
2812
2910
|
return b.buffer;
|
|
2813
2911
|
}
|
|
2814
2912
|
}
|
|
2913
|
+
export class EditChannelNews extends TLObject {
|
|
2914
|
+
__response__;
|
|
2915
|
+
channel;
|
|
2916
|
+
news;
|
|
2917
|
+
constructor(params) {
|
|
2918
|
+
super();
|
|
2919
|
+
this.classType = 'functions';
|
|
2920
|
+
this.className = 'channels.EditChannelNews';
|
|
2921
|
+
this.constructorId = 0xd704f985;
|
|
2922
|
+
this.subclassOfId = 0x8af52aac;
|
|
2923
|
+
this._slots = ['channel', 'news'];
|
|
2924
|
+
this.channel = params.channel;
|
|
2925
|
+
this.news = params.news;
|
|
2926
|
+
}
|
|
2927
|
+
/**
|
|
2928
|
+
* Generate the TLObject from buffer.
|
|
2929
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
2930
|
+
*/
|
|
2931
|
+
static async read(_data, ..._args) {
|
|
2932
|
+
// no flags
|
|
2933
|
+
let channel = await TLObject.read(_data);
|
|
2934
|
+
let news = await Primitive.Bool.read(_data);
|
|
2935
|
+
return new EditChannelNews({ channel: channel, news: news });
|
|
2936
|
+
}
|
|
2937
|
+
/**
|
|
2938
|
+
* Generate buffer from TLObject.
|
|
2939
|
+
*/
|
|
2940
|
+
write() {
|
|
2941
|
+
const b = new BytesIO();
|
|
2942
|
+
b.write(Primitive.Int.write(this.constructorId, false));
|
|
2943
|
+
// no flags
|
|
2944
|
+
if (this.channel !== undefined) {
|
|
2945
|
+
b.write(this.channel.write());
|
|
2946
|
+
}
|
|
2947
|
+
if (this.news !== undefined) {
|
|
2948
|
+
b.write(Primitive.Bool.write(this.news));
|
|
2949
|
+
}
|
|
2950
|
+
return b.buffer;
|
|
2951
|
+
}
|
|
2952
|
+
}
|