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