@tgsnake/skema 3.1.0-browser.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/deps.d.ts +3 -4
- package/dist/src/deps.js +4 -4
- package/dist/src/raw/class/All.d.ts +1 -1
- package/dist/src/raw/class/All.js +2739 -2739
- package/dist/src/raw/class/Raw.d.ts +7516 -7516
- package/dist/src/raw/class/Raw.js +20426 -26448
- package/dist/src/raw/class/tl/account.d.ts +841 -841
- package/dist/src/raw/class/tl/account.js +1813 -1983
- package/dist/src/raw/class/tl/aicompose.d.ts +51 -51
- package/dist/src/raw/class/tl/aicompose.js +117 -128
- package/dist/src/raw/class/tl/auth.d.ts +296 -296
- package/dist/src/raw/class/tl/auth.js +714 -849
- package/dist/src/raw/class/tl/bots.d.ts +231 -231
- package/dist/src/raw/class/tl/bots.js +504 -524
- package/dist/src/raw/class/tl/channels.d.ts +331 -331
- package/dist/src/raw/class/tl/channels.js +732 -823
- package/dist/src/raw/class/tl/chatlists.d.ts +81 -81
- package/dist/src/raw/class/tl/chatlists.js +183 -196
- package/dist/src/raw/class/tl/communities.d.ts +56 -56
- package/dist/src/raw/class/tl/communities.js +138 -159
- package/dist/src/raw/class/tl/contacts.d.ts +216 -216
- package/dist/src/raw/class/tl/contacts.js +492 -537
- package/dist/src/raw/class/tl/ephemeral.d.ts +51 -51
- package/dist/src/raw/class/tl/ephemeral.js +152 -204
- 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 +25 -32
- package/dist/src/raw/class/tl/help.d.ts +286 -286
- package/dist/src/raw/class/tl/help.js +618 -686
- 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 +1851 -1851
- package/dist/src/raw/class/tl/messages.js +4854 -5924
- package/dist/src/raw/class/tl/payments.d.ts +641 -641
- package/dist/src/raw/class/tl/payments.js +1734 -2198
- package/dist/src/raw/class/tl/phone.d.ts +256 -256
- package/dist/src/raw/class/tl/phone.js +644 -779
- package/dist/src/raw/class/tl/photos.d.ts +41 -41
- package/dist/src/raw/class/tl/photos.js +116 -139
- package/dist/src/raw/class/tl/premium.d.ts +41 -41
- package/dist/src/raw/class/tl/premium.js +111 -133
- package/dist/src/raw/class/tl/smsjobs.d.ts +46 -46
- package/dist/src/raw/class/tl/smsjobs.js +97 -115
- package/dist/src/raw/class/tl/stats.d.ts +71 -71
- package/dist/src/raw/class/tl/stats.js +169 -268
- package/dist/src/raw/class/tl/stickers.d.ts +61 -61
- package/dist/src/raw/class/tl/stickers.js +144 -173
- 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 +622 -781
- package/dist/src/raw/class/tl/toncenter.d.ts +21 -21
- package/dist/src/raw/class/tl/toncenter.js +47 -52
- package/dist/src/raw/class/tl/updates.d.ts +56 -56
- package/dist/src/raw/class/tl/updates.js +175 -246
- package/dist/src/raw/class/tl/upload.d.ts +66 -66
- package/dist/src/raw/class/tl/upload.js +155 -178
- 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 +206 -206
- package/dist/src/raw/class/tl/wallet.js +525 -591
- package/dist/src/raw/class/types.d.ts +1 -1
- package/dist/src/raw/class/types.js +1 -1
- package/package.json +4 -6
|
@@ -6,30 +6,30 @@
|
|
|
6
6
|
*
|
|
7
7
|
* tgsnake is a free software: you can redistribute it and/or modify
|
|
8
8
|
* it under the terms of the MIT License as published.
|
|
9
|
-
|
|
9
|
+
*/
|
|
10
10
|
// This file is auto generate. All change made in this file will be lost!
|
|
11
11
|
import { TLObject, Primitive } from '../../core/index.js';
|
|
12
12
|
import { BytesIO } from '../../../deps.js';
|
|
13
13
|
export class WelcomeMessagesNotModified extends TLObject {
|
|
14
14
|
constructor() {
|
|
15
15
|
super();
|
|
16
|
-
this.classType =
|
|
17
|
-
this.className =
|
|
16
|
+
this.classType = "types";
|
|
17
|
+
this.className = "ephemeral.WelcomeMessagesNotModified";
|
|
18
18
|
this.constructorId = 0x59ffdb31;
|
|
19
19
|
this.subclassOfId = 0x6f749a2d;
|
|
20
20
|
this._slots = [];
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
* Generate the TLObject from buffer.
|
|
24
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
25
|
+
*/
|
|
26
26
|
static async read(_data, ..._args) {
|
|
27
27
|
// no flags
|
|
28
28
|
return new WelcomeMessagesNotModified();
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
* Generate buffer from TLObject.
|
|
32
|
+
*/
|
|
33
33
|
write() {
|
|
34
34
|
const b = new BytesIO();
|
|
35
35
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -42,36 +42,36 @@ export class WelcomeMessages extends TLObject {
|
|
|
42
42
|
messages;
|
|
43
43
|
constructor(params) {
|
|
44
44
|
super();
|
|
45
|
-
this.classType =
|
|
46
|
-
this.className =
|
|
45
|
+
this.classType = "types";
|
|
46
|
+
this.className = "ephemeral.WelcomeMessages";
|
|
47
47
|
this.constructorId = 0x104fc872;
|
|
48
48
|
this.subclassOfId = 0x6f749a2d;
|
|
49
|
-
this._slots = [
|
|
49
|
+
this._slots = ["hash", "messages"];
|
|
50
50
|
this.hash = params.hash;
|
|
51
51
|
this.messages = params.messages;
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
* Generate the TLObject from buffer.
|
|
55
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
56
|
+
*/
|
|
57
57
|
static async read(_data, ..._args) {
|
|
58
58
|
// no flags
|
|
59
59
|
let hash = await Primitive.Long.read(_data);
|
|
60
60
|
let messages = await TLObject.read(_data);
|
|
61
|
-
return new WelcomeMessages({ hash: hash, messages: messages });
|
|
61
|
+
return new WelcomeMessages({ "hash": hash, "messages": messages });
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
* Generate buffer from TLObject.
|
|
65
|
+
*/
|
|
66
66
|
write() {
|
|
67
67
|
const b = new BytesIO();
|
|
68
68
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
69
69
|
// no flags
|
|
70
70
|
if (this.hash !== undefined) {
|
|
71
|
-
b.write(Primitive.Long.write(this.hash));
|
|
71
|
+
b.write((Primitive.Long.write(this.hash)));
|
|
72
72
|
}
|
|
73
73
|
if (this.messages) {
|
|
74
|
-
b.write(Primitive.Vector.write(this.messages));
|
|
74
|
+
b.write((Primitive.Vector.write(this.messages)));
|
|
75
75
|
}
|
|
76
76
|
return b.buffer;
|
|
77
77
|
}
|
|
@@ -94,26 +94,11 @@ export class SendMessage extends TLObject {
|
|
|
94
94
|
replyTo;
|
|
95
95
|
constructor(params) {
|
|
96
96
|
super();
|
|
97
|
-
this.classType =
|
|
98
|
-
this.className =
|
|
97
|
+
this.classType = "functions";
|
|
98
|
+
this.className = "ephemeral.SendMessage";
|
|
99
99
|
this.constructorId = 0xba8d5f35;
|
|
100
100
|
this.subclassOfId = 0x8af52aac;
|
|
101
|
-
this._slots = [
|
|
102
|
-
'invertMedia',
|
|
103
|
-
'welcome',
|
|
104
|
-
'anchor',
|
|
105
|
-
'noforwards',
|
|
106
|
-
'peer',
|
|
107
|
-
'receiverId',
|
|
108
|
-
'queryId',
|
|
109
|
-
'message',
|
|
110
|
-
'entities',
|
|
111
|
-
'media',
|
|
112
|
-
'replyMarkup',
|
|
113
|
-
'richMessage',
|
|
114
|
-
'randomId',
|
|
115
|
-
'replyTo',
|
|
116
|
-
];
|
|
101
|
+
this._slots = ["invertMedia", "welcome", "anchor", "noforwards", "peer", "receiverId", "queryId", "message", "entities", "media", "replyMarkup", "richMessage", "randomId", "replyTo"];
|
|
117
102
|
this.invertMedia = params.invertMedia;
|
|
118
103
|
this.welcome = params.welcome;
|
|
119
104
|
this.anchor = params.anchor;
|
|
@@ -130,63 +115,48 @@ export class SendMessage extends TLObject {
|
|
|
130
115
|
this.replyTo = params.replyTo;
|
|
131
116
|
}
|
|
132
117
|
/**
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
118
|
+
* Generate the TLObject from buffer.
|
|
119
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
120
|
+
*/
|
|
136
121
|
static async read(_data, ..._args) {
|
|
137
122
|
// @ts-ignore
|
|
138
123
|
let flags = await Primitive.Int.read(_data);
|
|
139
|
-
let invertMedia = flags & (1 << 6) ? true : false;
|
|
140
|
-
let welcome = flags & (1 << 7) ? true : false;
|
|
141
|
-
let anchor = flags & (1 << 9) ? true : false;
|
|
142
|
-
let noforwards = flags & (1 << 10) ? true : false;
|
|
143
|
-
let peer = flags & (1 << 8) ? await TLObject.read(_data) : undefined;
|
|
124
|
+
let invertMedia = (flags & (1 << 6)) ? true : false;
|
|
125
|
+
let welcome = (flags & (1 << 7)) ? true : false;
|
|
126
|
+
let anchor = (flags & (1 << 9)) ? true : false;
|
|
127
|
+
let noforwards = (flags & (1 << 10)) ? true : false;
|
|
128
|
+
let peer = (flags & (1 << 8)) ? await TLObject.read(_data) : undefined;
|
|
144
129
|
let receiverId = await TLObject.read(_data);
|
|
145
|
-
let queryId = flags & (1 << 0) ? await Primitive.Long.read(_data) : undefined;
|
|
130
|
+
let queryId = (flags & (1 << 0)) ? await Primitive.Long.read(_data) : undefined;
|
|
146
131
|
let message = await Primitive.String.read(_data);
|
|
147
|
-
let entities = flags & (1 << 1) ? await TLObject.read(_data) : [];
|
|
148
|
-
let media = flags & (1 << 2) ? await TLObject.read(_data) : undefined;
|
|
149
|
-
let replyMarkup = flags & (1 << 3) ? await TLObject.read(_data) : undefined;
|
|
150
|
-
let richMessage = flags & (1 << 4) ? await TLObject.read(_data) : undefined;
|
|
132
|
+
let entities = (flags & (1 << 1)) ? await TLObject.read(_data) : [];
|
|
133
|
+
let media = (flags & (1 << 2)) ? await TLObject.read(_data) : undefined;
|
|
134
|
+
let replyMarkup = (flags & (1 << 3)) ? await TLObject.read(_data) : undefined;
|
|
135
|
+
let richMessage = (flags & (1 << 4)) ? await TLObject.read(_data) : undefined;
|
|
151
136
|
let randomId = await Primitive.Long.read(_data);
|
|
152
|
-
let replyTo = flags & (1 << 5) ? await TLObject.read(_data) : undefined;
|
|
153
|
-
return new SendMessage({
|
|
154
|
-
invertMedia: invertMedia,
|
|
155
|
-
welcome: welcome,
|
|
156
|
-
anchor: anchor,
|
|
157
|
-
noforwards: noforwards,
|
|
158
|
-
peer: peer,
|
|
159
|
-
receiverId: receiverId,
|
|
160
|
-
queryId: queryId,
|
|
161
|
-
message: message,
|
|
162
|
-
entities: entities,
|
|
163
|
-
media: media,
|
|
164
|
-
replyMarkup: replyMarkup,
|
|
165
|
-
richMessage: richMessage,
|
|
166
|
-
randomId: randomId,
|
|
167
|
-
replyTo: replyTo,
|
|
168
|
-
});
|
|
137
|
+
let replyTo = (flags & (1 << 5)) ? await TLObject.read(_data) : undefined;
|
|
138
|
+
return new SendMessage({ "invertMedia": invertMedia, "welcome": welcome, "anchor": anchor, "noforwards": noforwards, "peer": peer, "receiverId": receiverId, "queryId": queryId, "message": message, "entities": entities, "media": media, "replyMarkup": replyMarkup, "richMessage": richMessage, "randomId": randomId, "replyTo": replyTo });
|
|
169
139
|
}
|
|
170
140
|
/**
|
|
171
|
-
|
|
172
|
-
|
|
141
|
+
* Generate buffer from TLObject.
|
|
142
|
+
*/
|
|
173
143
|
write() {
|
|
174
144
|
const b = new BytesIO();
|
|
175
145
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
176
146
|
// @ts-ignore
|
|
177
147
|
let flags = 0;
|
|
178
|
-
flags |= this.invertMedia ? 1 << 6 : 0;
|
|
179
|
-
flags |= this.welcome ? 1 << 7 : 0;
|
|
180
|
-
flags |= this.anchor ? 1 << 9 : 0;
|
|
181
|
-
flags |= this.noforwards ? 1 << 10 : 0;
|
|
182
|
-
flags |= this.peer !== undefined ? 1 << 8 : 0;
|
|
183
|
-
flags |= this.queryId !== undefined ? 1 << 0 : 0;
|
|
184
|
-
flags |= this.entities ? 1 << 1 : 0;
|
|
185
|
-
flags |= this.media !== undefined ? 1 << 2 : 0;
|
|
186
|
-
flags |= this.replyMarkup !== undefined ? 1 << 3 : 0;
|
|
187
|
-
flags |= this.richMessage !== undefined ? 1 << 4 : 0;
|
|
188
|
-
flags |= this.replyTo !== undefined ? 1 << 5 : 0;
|
|
189
|
-
b.write(Primitive.Int.write(flags));
|
|
148
|
+
flags |= this.invertMedia ? (1 << 6) : 0;
|
|
149
|
+
flags |= this.welcome ? (1 << 7) : 0;
|
|
150
|
+
flags |= this.anchor ? (1 << 9) : 0;
|
|
151
|
+
flags |= this.noforwards ? (1 << 10) : 0;
|
|
152
|
+
flags |= this.peer !== undefined ? (1 << 8) : 0;
|
|
153
|
+
flags |= this.queryId !== undefined ? (1 << 0) : 0;
|
|
154
|
+
flags |= this.entities ? (1 << 1) : 0;
|
|
155
|
+
flags |= this.media !== undefined ? (1 << 2) : 0;
|
|
156
|
+
flags |= this.replyMarkup !== undefined ? (1 << 3) : 0;
|
|
157
|
+
flags |= this.richMessage !== undefined ? (1 << 4) : 0;
|
|
158
|
+
flags |= this.replyTo !== undefined ? (1 << 5) : 0;
|
|
159
|
+
b.write((Primitive.Int.write(flags)));
|
|
190
160
|
if (this.peer !== undefined) {
|
|
191
161
|
b.write(this.peer.write());
|
|
192
162
|
}
|
|
@@ -194,13 +164,13 @@ export class SendMessage extends TLObject {
|
|
|
194
164
|
b.write(this.receiverId.write());
|
|
195
165
|
}
|
|
196
166
|
if (this.queryId !== undefined) {
|
|
197
|
-
b.write(Primitive.Long.write(this.queryId));
|
|
167
|
+
b.write((Primitive.Long.write(this.queryId)));
|
|
198
168
|
}
|
|
199
169
|
if (this.message !== undefined) {
|
|
200
|
-
b.write(Primitive.String.write(this.message));
|
|
170
|
+
b.write((Primitive.String.write(this.message)));
|
|
201
171
|
}
|
|
202
172
|
if (this.entities) {
|
|
203
|
-
b.write(Primitive.Vector.write(this.entities));
|
|
173
|
+
b.write((Primitive.Vector.write(this.entities)));
|
|
204
174
|
}
|
|
205
175
|
if (this.media !== undefined) {
|
|
206
176
|
b.write(this.media.write());
|
|
@@ -212,7 +182,7 @@ export class SendMessage extends TLObject {
|
|
|
212
182
|
b.write(this.richMessage.write());
|
|
213
183
|
}
|
|
214
184
|
if (this.randomId !== undefined) {
|
|
215
|
-
b.write(Primitive.Long.write(this.randomId));
|
|
185
|
+
b.write((Primitive.Long.write(this.randomId)));
|
|
216
186
|
}
|
|
217
187
|
if (this.replyTo !== undefined) {
|
|
218
188
|
b.write(this.replyTo.write());
|
|
@@ -227,37 +197,37 @@ export class DeleteMessage extends TLObject {
|
|
|
227
197
|
id;
|
|
228
198
|
constructor(params) {
|
|
229
199
|
super();
|
|
230
|
-
this.classType =
|
|
231
|
-
this.className =
|
|
200
|
+
this.classType = "functions";
|
|
201
|
+
this.className = "ephemeral.DeleteMessage";
|
|
232
202
|
this.constructorId = 0x92f6e797;
|
|
233
203
|
this.subclassOfId = 0xf5b399ac;
|
|
234
|
-
this._slots = [
|
|
204
|
+
this._slots = ["peer", "receiverId", "id"];
|
|
235
205
|
this.peer = params.peer;
|
|
236
206
|
this.receiverId = params.receiverId;
|
|
237
207
|
this.id = params.id;
|
|
238
208
|
}
|
|
239
209
|
/**
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
210
|
+
* Generate the TLObject from buffer.
|
|
211
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
212
|
+
*/
|
|
243
213
|
static async read(_data, ..._args) {
|
|
244
214
|
// @ts-ignore
|
|
245
215
|
let flags = await Primitive.Int.read(_data);
|
|
246
|
-
let peer = flags & (1 << 0) ? await TLObject.read(_data) : undefined;
|
|
216
|
+
let peer = (flags & (1 << 0)) ? await TLObject.read(_data) : undefined;
|
|
247
217
|
let receiverId = await TLObject.read(_data);
|
|
248
218
|
let id = await Primitive.Int.read(_data);
|
|
249
|
-
return new DeleteMessage({ peer: peer, receiverId: receiverId, id: id });
|
|
219
|
+
return new DeleteMessage({ "peer": peer, "receiverId": receiverId, "id": id });
|
|
250
220
|
}
|
|
251
221
|
/**
|
|
252
|
-
|
|
253
|
-
|
|
222
|
+
* Generate buffer from TLObject.
|
|
223
|
+
*/
|
|
254
224
|
write() {
|
|
255
225
|
const b = new BytesIO();
|
|
256
226
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
257
227
|
// @ts-ignore
|
|
258
228
|
let flags = 0;
|
|
259
|
-
flags |= this.peer !== undefined ? 1 << 0 : 0;
|
|
260
|
-
b.write(Primitive.Int.write(flags));
|
|
229
|
+
flags |= this.peer !== undefined ? (1 << 0) : 0;
|
|
230
|
+
b.write((Primitive.Int.write(flags)));
|
|
261
231
|
if (this.peer !== undefined) {
|
|
262
232
|
b.write(this.peer.write());
|
|
263
233
|
}
|
|
@@ -265,7 +235,7 @@ export class DeleteMessage extends TLObject {
|
|
|
265
235
|
b.write(this.receiverId.write());
|
|
266
236
|
}
|
|
267
237
|
if (this.id !== undefined) {
|
|
268
|
-
b.write(Primitive.Int.write(this.id));
|
|
238
|
+
b.write((Primitive.Int.write(this.id)));
|
|
269
239
|
}
|
|
270
240
|
return b.buffer;
|
|
271
241
|
}
|
|
@@ -278,31 +248,31 @@ export class ReportMessage extends TLObject {
|
|
|
278
248
|
message;
|
|
279
249
|
constructor(params) {
|
|
280
250
|
super();
|
|
281
|
-
this.classType =
|
|
282
|
-
this.className =
|
|
251
|
+
this.classType = "functions";
|
|
252
|
+
this.className = "ephemeral.ReportMessage";
|
|
283
253
|
this.constructorId = 0x8704f2bf;
|
|
284
254
|
this.subclassOfId = 0xacd3f438;
|
|
285
|
-
this._slots = [
|
|
255
|
+
this._slots = ["peer", "id", "option", "message"];
|
|
286
256
|
this.peer = params.peer;
|
|
287
257
|
this.id = params.id;
|
|
288
258
|
this.option = params.option;
|
|
289
259
|
this.message = params.message;
|
|
290
260
|
}
|
|
291
261
|
/**
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
262
|
+
* Generate the TLObject from buffer.
|
|
263
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
264
|
+
*/
|
|
295
265
|
static async read(_data, ..._args) {
|
|
296
266
|
// no flags
|
|
297
267
|
let peer = await TLObject.read(_data);
|
|
298
268
|
let id = await Primitive.Int.read(_data);
|
|
299
269
|
let option = await Primitive.Bytes.read(_data);
|
|
300
270
|
let message = await Primitive.String.read(_data);
|
|
301
|
-
return new ReportMessage({ peer: peer, id: id, option: option, message: message });
|
|
271
|
+
return new ReportMessage({ "peer": peer, "id": id, "option": option, "message": message });
|
|
302
272
|
}
|
|
303
273
|
/**
|
|
304
|
-
|
|
305
|
-
|
|
274
|
+
* Generate buffer from TLObject.
|
|
275
|
+
*/
|
|
306
276
|
write() {
|
|
307
277
|
const b = new BytesIO();
|
|
308
278
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -311,13 +281,13 @@ export class ReportMessage extends TLObject {
|
|
|
311
281
|
b.write(this.peer.write());
|
|
312
282
|
}
|
|
313
283
|
if (this.id !== undefined) {
|
|
314
|
-
b.write(Primitive.Int.write(this.id));
|
|
284
|
+
b.write((Primitive.Int.write(this.id)));
|
|
315
285
|
}
|
|
316
286
|
if (this.option !== undefined) {
|
|
317
|
-
b.write(Primitive.Bytes.write(this.option));
|
|
287
|
+
b.write((Primitive.Bytes.write(this.option)));
|
|
318
288
|
}
|
|
319
289
|
if (this.message !== undefined) {
|
|
320
|
-
b.write(Primitive.String.write(this.message));
|
|
290
|
+
b.write((Primitive.String.write(this.message)));
|
|
321
291
|
}
|
|
322
292
|
return b.buffer;
|
|
323
293
|
}
|
|
@@ -329,45 +299,45 @@ export class GetCallbackAnswer extends TLObject {
|
|
|
329
299
|
data;
|
|
330
300
|
constructor(params) {
|
|
331
301
|
super();
|
|
332
|
-
this.classType =
|
|
333
|
-
this.className =
|
|
302
|
+
this.classType = "functions";
|
|
303
|
+
this.className = "ephemeral.GetCallbackAnswer";
|
|
334
304
|
this.constructorId = 0x3fa464c8;
|
|
335
305
|
this.subclassOfId = 0x6c4dd18c;
|
|
336
|
-
this._slots = [
|
|
306
|
+
this._slots = ["peer", "id", "data"];
|
|
337
307
|
this.peer = params.peer;
|
|
338
308
|
this.id = params.id;
|
|
339
309
|
this.data = params.data;
|
|
340
310
|
}
|
|
341
311
|
/**
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
312
|
+
* Generate the TLObject from buffer.
|
|
313
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
314
|
+
*/
|
|
345
315
|
static async read(_data, ..._args) {
|
|
346
316
|
// @ts-ignore
|
|
347
317
|
let flags = await Primitive.Int.read(_data);
|
|
348
318
|
let peer = await TLObject.read(_data);
|
|
349
319
|
let id = await Primitive.Int.read(_data);
|
|
350
|
-
let data = flags & (1 << 1) ? await Primitive.Bytes.read(_data) : undefined;
|
|
351
|
-
return new GetCallbackAnswer({ peer: peer, id: id, data: data });
|
|
320
|
+
let data = (flags & (1 << 1)) ? await Primitive.Bytes.read(_data) : undefined;
|
|
321
|
+
return new GetCallbackAnswer({ "peer": peer, "id": id, "data": data });
|
|
352
322
|
}
|
|
353
323
|
/**
|
|
354
|
-
|
|
355
|
-
|
|
324
|
+
* Generate buffer from TLObject.
|
|
325
|
+
*/
|
|
356
326
|
write() {
|
|
357
327
|
const b = new BytesIO();
|
|
358
328
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
359
329
|
// @ts-ignore
|
|
360
330
|
let flags = 0;
|
|
361
|
-
flags |= this.data !== undefined ? 1 << 1 : 0;
|
|
362
|
-
b.write(Primitive.Int.write(flags));
|
|
331
|
+
flags |= this.data !== undefined ? (1 << 1) : 0;
|
|
332
|
+
b.write((Primitive.Int.write(flags)));
|
|
363
333
|
if (this.peer !== undefined) {
|
|
364
334
|
b.write(this.peer.write());
|
|
365
335
|
}
|
|
366
336
|
if (this.id !== undefined) {
|
|
367
|
-
b.write(Primitive.Int.write(this.id));
|
|
337
|
+
b.write((Primitive.Int.write(this.id)));
|
|
368
338
|
}
|
|
369
339
|
if (this.data !== undefined) {
|
|
370
|
-
b.write(Primitive.Bytes.write(this.data));
|
|
340
|
+
b.write((Primitive.Bytes.write(this.data)));
|
|
371
341
|
}
|
|
372
342
|
return b.buffer;
|
|
373
343
|
}
|
|
@@ -386,22 +356,11 @@ export class EditMessage extends TLObject {
|
|
|
386
356
|
richMessage;
|
|
387
357
|
constructor(params) {
|
|
388
358
|
super();
|
|
389
|
-
this.classType =
|
|
390
|
-
this.className =
|
|
359
|
+
this.classType = "functions";
|
|
360
|
+
this.className = "ephemeral.EditMessage";
|
|
391
361
|
this.constructorId = 0xcf9c725b;
|
|
392
362
|
this.subclassOfId = 0x8af52aac;
|
|
393
|
-
this._slots = [
|
|
394
|
-
'invertMedia',
|
|
395
|
-
'welcome',
|
|
396
|
-
'peer',
|
|
397
|
-
'receiverId',
|
|
398
|
-
'id',
|
|
399
|
-
'message',
|
|
400
|
-
'media',
|
|
401
|
-
'entities',
|
|
402
|
-
'replyMarkup',
|
|
403
|
-
'richMessage',
|
|
404
|
-
];
|
|
363
|
+
this._slots = ["invertMedia", "welcome", "peer", "receiverId", "id", "message", "media", "entities", "replyMarkup", "richMessage"];
|
|
405
364
|
this.invertMedia = params.invertMedia;
|
|
406
365
|
this.welcome = params.welcome;
|
|
407
366
|
this.peer = params.peer;
|
|
@@ -414,52 +373,41 @@ export class EditMessage extends TLObject {
|
|
|
414
373
|
this.richMessage = params.richMessage;
|
|
415
374
|
}
|
|
416
375
|
/**
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
376
|
+
* Generate the TLObject from buffer.
|
|
377
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
378
|
+
*/
|
|
420
379
|
static async read(_data, ..._args) {
|
|
421
380
|
// @ts-ignore
|
|
422
381
|
let flags = await Primitive.Int.read(_data);
|
|
423
|
-
let invertMedia = flags & (1 << 5) ? true : false;
|
|
424
|
-
let welcome = flags & (1 << 6) ? true : false;
|
|
425
|
-
let peer = flags & (1 << 7) ? await TLObject.read(_data) : undefined;
|
|
382
|
+
let invertMedia = (flags & (1 << 5)) ? true : false;
|
|
383
|
+
let welcome = (flags & (1 << 6)) ? true : false;
|
|
384
|
+
let peer = (flags & (1 << 7)) ? await TLObject.read(_data) : undefined;
|
|
426
385
|
let receiverId = await TLObject.read(_data);
|
|
427
386
|
let id = await Primitive.Int.read(_data);
|
|
428
|
-
let message = flags & (1 << 0) ? await Primitive.String.read(_data) : undefined;
|
|
429
|
-
let media = flags & (1 << 3) ? await TLObject.read(_data) : undefined;
|
|
430
|
-
let entities = flags & (1 << 1) ? await TLObject.read(_data) : [];
|
|
431
|
-
let replyMarkup = flags & (1 << 2) ? await TLObject.read(_data) : undefined;
|
|
432
|
-
let richMessage = flags & (1 << 4) ? await TLObject.read(_data) : undefined;
|
|
433
|
-
return new EditMessage({
|
|
434
|
-
invertMedia: invertMedia,
|
|
435
|
-
welcome: welcome,
|
|
436
|
-
peer: peer,
|
|
437
|
-
receiverId: receiverId,
|
|
438
|
-
id: id,
|
|
439
|
-
message: message,
|
|
440
|
-
media: media,
|
|
441
|
-
entities: entities,
|
|
442
|
-
replyMarkup: replyMarkup,
|
|
443
|
-
richMessage: richMessage,
|
|
444
|
-
});
|
|
387
|
+
let message = (flags & (1 << 0)) ? await Primitive.String.read(_data) : undefined;
|
|
388
|
+
let media = (flags & (1 << 3)) ? await TLObject.read(_data) : undefined;
|
|
389
|
+
let entities = (flags & (1 << 1)) ? await TLObject.read(_data) : [];
|
|
390
|
+
let replyMarkup = (flags & (1 << 2)) ? await TLObject.read(_data) : undefined;
|
|
391
|
+
let richMessage = (flags & (1 << 4)) ? await TLObject.read(_data) : undefined;
|
|
392
|
+
return new EditMessage({ "invertMedia": invertMedia, "welcome": welcome, "peer": peer, "receiverId": receiverId, "id": id, "message": message, "media": media, "entities": entities, "replyMarkup": replyMarkup, "richMessage": richMessage });
|
|
445
393
|
}
|
|
446
394
|
/**
|
|
447
|
-
|
|
448
|
-
|
|
395
|
+
* Generate buffer from TLObject.
|
|
396
|
+
*/
|
|
449
397
|
write() {
|
|
450
398
|
const b = new BytesIO();
|
|
451
399
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
452
400
|
// @ts-ignore
|
|
453
401
|
let flags = 0;
|
|
454
|
-
flags |= this.invertMedia ? 1 << 5 : 0;
|
|
455
|
-
flags |= this.welcome ? 1 << 6 : 0;
|
|
456
|
-
flags |= this.peer !== undefined ? 1 << 7 : 0;
|
|
457
|
-
flags |= this.message !== undefined ? 1 << 0 : 0;
|
|
458
|
-
flags |= this.media !== undefined ? 1 << 3 : 0;
|
|
459
|
-
flags |= this.entities ? 1 << 1 : 0;
|
|
460
|
-
flags |= this.replyMarkup !== undefined ? 1 << 2 : 0;
|
|
461
|
-
flags |= this.richMessage !== undefined ? 1 << 4 : 0;
|
|
462
|
-
b.write(Primitive.Int.write(flags));
|
|
402
|
+
flags |= this.invertMedia ? (1 << 5) : 0;
|
|
403
|
+
flags |= this.welcome ? (1 << 6) : 0;
|
|
404
|
+
flags |= this.peer !== undefined ? (1 << 7) : 0;
|
|
405
|
+
flags |= this.message !== undefined ? (1 << 0) : 0;
|
|
406
|
+
flags |= this.media !== undefined ? (1 << 3) : 0;
|
|
407
|
+
flags |= this.entities ? (1 << 1) : 0;
|
|
408
|
+
flags |= this.replyMarkup !== undefined ? (1 << 2) : 0;
|
|
409
|
+
flags |= this.richMessage !== undefined ? (1 << 4) : 0;
|
|
410
|
+
b.write((Primitive.Int.write(flags)));
|
|
463
411
|
if (this.peer !== undefined) {
|
|
464
412
|
b.write(this.peer.write());
|
|
465
413
|
}
|
|
@@ -467,16 +415,16 @@ export class EditMessage extends TLObject {
|
|
|
467
415
|
b.write(this.receiverId.write());
|
|
468
416
|
}
|
|
469
417
|
if (this.id !== undefined) {
|
|
470
|
-
b.write(Primitive.Int.write(this.id));
|
|
418
|
+
b.write((Primitive.Int.write(this.id)));
|
|
471
419
|
}
|
|
472
420
|
if (this.message !== undefined) {
|
|
473
|
-
b.write(Primitive.String.write(this.message));
|
|
421
|
+
b.write((Primitive.String.write(this.message)));
|
|
474
422
|
}
|
|
475
423
|
if (this.media !== undefined) {
|
|
476
424
|
b.write(this.media.write());
|
|
477
425
|
}
|
|
478
426
|
if (this.entities) {
|
|
479
|
-
b.write(Primitive.Vector.write(this.entities));
|
|
427
|
+
b.write((Primitive.Vector.write(this.entities)));
|
|
480
428
|
}
|
|
481
429
|
if (this.replyMarkup !== undefined) {
|
|
482
430
|
b.write(this.replyMarkup.write());
|
|
@@ -493,27 +441,27 @@ export class DeleteWelcomeMessage extends TLObject {
|
|
|
493
441
|
id;
|
|
494
442
|
constructor(params) {
|
|
495
443
|
super();
|
|
496
|
-
this.classType =
|
|
497
|
-
this.className =
|
|
444
|
+
this.classType = "functions";
|
|
445
|
+
this.className = "ephemeral.DeleteWelcomeMessage";
|
|
498
446
|
this.constructorId = 0xe882a9e1;
|
|
499
447
|
this.subclassOfId = 0xf5b399ac;
|
|
500
|
-
this._slots = [
|
|
448
|
+
this._slots = ["peer", "id"];
|
|
501
449
|
this.peer = params.peer;
|
|
502
450
|
this.id = params.id;
|
|
503
451
|
}
|
|
504
452
|
/**
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
453
|
+
* Generate the TLObject from buffer.
|
|
454
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
455
|
+
*/
|
|
508
456
|
static async read(_data, ..._args) {
|
|
509
457
|
// no flags
|
|
510
458
|
let peer = await TLObject.read(_data);
|
|
511
459
|
let id = await Primitive.Int.read(_data);
|
|
512
|
-
return new DeleteWelcomeMessage({ peer: peer, id: id });
|
|
460
|
+
return new DeleteWelcomeMessage({ "peer": peer, "id": id });
|
|
513
461
|
}
|
|
514
462
|
/**
|
|
515
|
-
|
|
516
|
-
|
|
463
|
+
* Generate buffer from TLObject.
|
|
464
|
+
*/
|
|
517
465
|
write() {
|
|
518
466
|
const b = new BytesIO();
|
|
519
467
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -522,7 +470,7 @@ export class DeleteWelcomeMessage extends TLObject {
|
|
|
522
470
|
b.write(this.peer.write());
|
|
523
471
|
}
|
|
524
472
|
if (this.id !== undefined) {
|
|
525
|
-
b.write(Primitive.Int.write(this.id));
|
|
473
|
+
b.write((Primitive.Int.write(this.id)));
|
|
526
474
|
}
|
|
527
475
|
return b.buffer;
|
|
528
476
|
}
|
|
@@ -532,25 +480,25 @@ export class DeleteAllWelcomeMessages extends TLObject {
|
|
|
532
480
|
peer;
|
|
533
481
|
constructor(params) {
|
|
534
482
|
super();
|
|
535
|
-
this.classType =
|
|
536
|
-
this.className =
|
|
483
|
+
this.classType = "functions";
|
|
484
|
+
this.className = "ephemeral.DeleteAllWelcomeMessages";
|
|
537
485
|
this.constructorId = 0x734f9721;
|
|
538
486
|
this.subclassOfId = 0xf5b399ac;
|
|
539
|
-
this._slots = [
|
|
487
|
+
this._slots = ["peer"];
|
|
540
488
|
this.peer = params.peer;
|
|
541
489
|
}
|
|
542
490
|
/**
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
491
|
+
* Generate the TLObject from buffer.
|
|
492
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
493
|
+
*/
|
|
546
494
|
static async read(_data, ..._args) {
|
|
547
495
|
// no flags
|
|
548
496
|
let peer = await TLObject.read(_data);
|
|
549
|
-
return new DeleteAllWelcomeMessages({ peer: peer });
|
|
497
|
+
return new DeleteAllWelcomeMessages({ "peer": peer });
|
|
550
498
|
}
|
|
551
499
|
/**
|
|
552
|
-
|
|
553
|
-
|
|
500
|
+
* Generate buffer from TLObject.
|
|
501
|
+
*/
|
|
554
502
|
write() {
|
|
555
503
|
const b = new BytesIO();
|
|
556
504
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -567,27 +515,27 @@ export class GetWelcomeMessages extends TLObject {
|
|
|
567
515
|
hash;
|
|
568
516
|
constructor(params) {
|
|
569
517
|
super();
|
|
570
|
-
this.classType =
|
|
571
|
-
this.className =
|
|
518
|
+
this.classType = "functions";
|
|
519
|
+
this.className = "ephemeral.GetWelcomeMessages";
|
|
572
520
|
this.constructorId = 0xdb9ac18d;
|
|
573
521
|
this.subclassOfId = 0x6f749a2d;
|
|
574
|
-
this._slots = [
|
|
522
|
+
this._slots = ["peer", "hash"];
|
|
575
523
|
this.peer = params.peer;
|
|
576
524
|
this.hash = params.hash;
|
|
577
525
|
}
|
|
578
526
|
/**
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
527
|
+
* Generate the TLObject from buffer.
|
|
528
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
529
|
+
*/
|
|
582
530
|
static async read(_data, ..._args) {
|
|
583
531
|
// no flags
|
|
584
532
|
let peer = await TLObject.read(_data);
|
|
585
533
|
let hash = await Primitive.Long.read(_data);
|
|
586
|
-
return new GetWelcomeMessages({ peer: peer, hash: hash });
|
|
534
|
+
return new GetWelcomeMessages({ "peer": peer, "hash": hash });
|
|
587
535
|
}
|
|
588
536
|
/**
|
|
589
|
-
|
|
590
|
-
|
|
537
|
+
* Generate buffer from TLObject.
|
|
538
|
+
*/
|
|
591
539
|
write() {
|
|
592
540
|
const b = new BytesIO();
|
|
593
541
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -596,7 +544,7 @@ export class GetWelcomeMessages extends TLObject {
|
|
|
596
544
|
b.write(this.peer.write());
|
|
597
545
|
}
|
|
598
546
|
if (this.hash !== undefined) {
|
|
599
|
-
b.write(Primitive.Long.write(this.hash));
|
|
547
|
+
b.write((Primitive.Long.write(this.hash)));
|
|
600
548
|
}
|
|
601
549
|
return b.buffer;
|
|
602
550
|
}
|