|
@@ -0,0 +1,5464 @@
|
|
|
+/*! File generated by TLObjects' generator. All changes will be ERASED !*/
|
|
|
+const { TLObject } = require('../tlobject');
|
|
|
+const { TLRequest } = require('../tlobject');
|
|
|
+const struct = require('python-struct');
|
|
|
+const {InputPeerEmpty} = require("../types")
|
|
|
+const { readBigIntFromBuffer,
|
|
|
+ readBufferFromBigInt, generateRandomBytes } = require('../../Helpers')
|
|
|
+
|
|
|
+
|
|
|
+class GetMessagesRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x63c66506;
|
|
|
+ static SUBCLASS_OF_ID = 0xd4b40b5e;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.Messages: Instance of either Messages, MessagesSlice, ChannelMessages, MessagesNotModified
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x63c66506;
|
|
|
+ this.SUBCLASS_OF_ID = 0xd4b40b5e;
|
|
|
+
|
|
|
+ this.id = args.id;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ const _tmp = [];for (const _x of this.id) {
|
|
|
+ _tmp.push(utils.getInputMessage(_x));
|
|
|
+ }
|
|
|
+ this.id = _tmp;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("0665c663","hex"),
|
|
|
+ Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.id.length),Buffer.concat(this.id.map(x => x.getBytes())),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ reader.readInt();
|
|
|
+ _id = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.tgReadObject();
|
|
|
+ _id.push(_x);
|
|
|
+ }
|
|
|
+ return new this({id:_id})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class GetDialogsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xa0ee3b73;
|
|
|
+ static SUBCLASS_OF_ID = 0xe1b52ee;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.Dialogs: Instance of either Dialogs, DialogsSlice, DialogsNotModified
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xa0ee3b73;
|
|
|
+ this.SUBCLASS_OF_ID = 0xe1b52ee;
|
|
|
+
|
|
|
+ this.excludePinned = args.excludePinned || null;
|
|
|
+ this.folderId = args.folderId || null;
|
|
|
+ this.offsetDate = args.offsetDate;
|
|
|
+ this.offsetId = args.offsetId;
|
|
|
+ this.offsetPeer = args.offsetPeer || new InputPeerEmpty();
|
|
|
+ this.limit = args.limit;
|
|
|
+ this.hash = args.hash;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.offset_peer = utils.getInputPeer(await client.getInputEntity(this.offsetPeer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("733beea0","hex"),
|
|
|
+ struct.pack('<I', (this.excludePinned === undefined || this.excludePinned === false || this.excludePinned === null) ? 0 : 1 | (this.folderId === undefined || this.folderId === false || this.folderId === null) ? 0 : 2),
|
|
|
+ (this.folderId === undefined || this.folderId === false || this.folderId ===null) ? Buffer.alloc(0) : [struct.pack('<i', this.folderId)],
|
|
|
+ struct.pack('<i', this.offsetDate),
|
|
|
+ struct.pack('<i', this.offsetId),
|
|
|
+ this.offsetPeer.getBytes(),
|
|
|
+ struct.pack('<i', this.limit),
|
|
|
+ struct.pack('<i', this.hash),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _exclude_pinned;
|
|
|
+ let _folder_id;
|
|
|
+ let _offset_date;
|
|
|
+ let _offset_id;
|
|
|
+ let _offset_peer;
|
|
|
+ let _limit;
|
|
|
+ let _hash;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _exclude_pinned = Boolean(flags & 1);
|
|
|
+ if (flags & 2) {
|
|
|
+ _folder_id = reader.readInt();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _folder_id = null
|
|
|
+ }
|
|
|
+ _offset_date = reader.readInt();
|
|
|
+ _offset_id = reader.readInt();
|
|
|
+ _offset_peer = reader.tgReadObject();
|
|
|
+ _limit = reader.readInt();
|
|
|
+ _hash = reader.readInt();
|
|
|
+ return new this({excludePinned:_exclude_pinned,
|
|
|
+ folderId:_folder_id,
|
|
|
+ offsetDate:_offset_date,
|
|
|
+ offsetId:_offset_id,
|
|
|
+ offsetPeer:_offset_peer,
|
|
|
+ limit:_limit,
|
|
|
+ hash:_hash})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetHistoryRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xdcbb8260;
|
|
|
+ static SUBCLASS_OF_ID = 0xd4b40b5e;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.Messages: Instance of either Messages, MessagesSlice, ChannelMessages, MessagesNotModified
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xdcbb8260;
|
|
|
+ this.SUBCLASS_OF_ID = 0xd4b40b5e;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.offsetId = args.offsetId;
|
|
|
+ this.offsetDate = args.offsetDate;
|
|
|
+ this.addOffset = args.addOffset;
|
|
|
+ this.limit = args.limit;
|
|
|
+ this.maxId = args.maxId;
|
|
|
+ this.minId = args.minId;
|
|
|
+ this.hash = args.hash;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("6082bbdc","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ struct.pack('<i', this.offsetId),
|
|
|
+ struct.pack('<i', this.offsetDate),
|
|
|
+ struct.pack('<i', this.addOffset),
|
|
|
+ struct.pack('<i', this.limit),
|
|
|
+ struct.pack('<i', this.maxId),
|
|
|
+ struct.pack('<i', this.minId),
|
|
|
+ struct.pack('<i', this.hash),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _offset_id;
|
|
|
+ let _offset_date;
|
|
|
+ let _add_offset;
|
|
|
+ let _limit;
|
|
|
+ let _max_id;
|
|
|
+ let _min_id;
|
|
|
+ let _hash;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _offset_id = reader.readInt();
|
|
|
+ _offset_date = reader.readInt();
|
|
|
+ _add_offset = reader.readInt();
|
|
|
+ _limit = reader.readInt();
|
|
|
+ _max_id = reader.readInt();
|
|
|
+ _min_id = reader.readInt();
|
|
|
+ _hash = reader.readInt();
|
|
|
+ return new this({peer:_peer,
|
|
|
+ offsetId:_offset_id,
|
|
|
+ offsetDate:_offset_date,
|
|
|
+ addOffset:_add_offset,
|
|
|
+ limit:_limit,
|
|
|
+ maxId:_max_id,
|
|
|
+ minId:_min_id,
|
|
|
+ hash:_hash})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class SearchRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x8614ef68;
|
|
|
+ static SUBCLASS_OF_ID = 0xd4b40b5e;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.Messages: Instance of either Messages, MessagesSlice, ChannelMessages, MessagesNotModified
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x8614ef68;
|
|
|
+ this.SUBCLASS_OF_ID = 0xd4b40b5e;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.q = args.q;
|
|
|
+ this.fromId = args.fromId || null;
|
|
|
+ this.filter = args.filter;
|
|
|
+ this.minDate = args.minDate;
|
|
|
+ this.maxDate = args.maxDate;
|
|
|
+ this.offsetId = args.offsetId;
|
|
|
+ this.addOffset = args.addOffset;
|
|
|
+ this.limit = args.limit;
|
|
|
+ this.maxId = args.maxId;
|
|
|
+ this.minId = args.minId;
|
|
|
+ this.hash = args.hash;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ if (this.fromId) {
|
|
|
+ this.from_id = utils.getInputUser(await client.getInputEntity(this.fromId))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("68ef1486","hex"),
|
|
|
+ struct.pack('<I', (this.fromId === undefined || this.fromId === false || this.fromId === null) ? 0 : 1),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ TLObject.serializeBytes(this.q),
|
|
|
+ (this.fromId === undefined || this.fromId === false || this.fromId ===null) ? Buffer.alloc(0) : [this.fromId.getBytes()],
|
|
|
+ this.filter.getBytes(),
|
|
|
+ struct.pack('<i', this.minDate),
|
|
|
+ struct.pack('<i', this.maxDate),
|
|
|
+ struct.pack('<i', this.offsetId),
|
|
|
+ struct.pack('<i', this.addOffset),
|
|
|
+ struct.pack('<i', this.limit),
|
|
|
+ struct.pack('<i', this.maxId),
|
|
|
+ struct.pack('<i', this.minId),
|
|
|
+ struct.pack('<i', this.hash),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _peer;
|
|
|
+ let _q;
|
|
|
+ let _from_id;
|
|
|
+ let _filter;
|
|
|
+ let _min_date;
|
|
|
+ let _max_date;
|
|
|
+ let _offset_id;
|
|
|
+ let _add_offset;
|
|
|
+ let _limit;
|
|
|
+ let _max_id;
|
|
|
+ let _min_id;
|
|
|
+ let _hash;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _q = reader.tgReadString();
|
|
|
+ if (flags & 1) {
|
|
|
+ _from_id = reader.tgReadObject();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _from_id = null
|
|
|
+ }
|
|
|
+ _filter = reader.tgReadObject();
|
|
|
+ _min_date = reader.readInt();
|
|
|
+ _max_date = reader.readInt();
|
|
|
+ _offset_id = reader.readInt();
|
|
|
+ _add_offset = reader.readInt();
|
|
|
+ _limit = reader.readInt();
|
|
|
+ _max_id = reader.readInt();
|
|
|
+ _min_id = reader.readInt();
|
|
|
+ _hash = reader.readInt();
|
|
|
+ return new this({peer:_peer,
|
|
|
+ q:_q,
|
|
|
+ fromId:_from_id,
|
|
|
+ filter:_filter,
|
|
|
+ minDate:_min_date,
|
|
|
+ maxDate:_max_date,
|
|
|
+ offsetId:_offset_id,
|
|
|
+ addOffset:_add_offset,
|
|
|
+ limit:_limit,
|
|
|
+ maxId:_max_id,
|
|
|
+ minId:_min_id,
|
|
|
+ hash:_hash})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class ReadHistoryRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x0e306d3a;
|
|
|
+ static SUBCLASS_OF_ID = 0xced3c06e;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.AffectedMessages: Instance of AffectedMessages
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x0e306d3a;
|
|
|
+ this.SUBCLASS_OF_ID = 0xced3c06e;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.maxId = args.maxId;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("3a6d300e","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ struct.pack('<i', this.maxId),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _max_id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _max_id = reader.readInt();
|
|
|
+ return new this({peer:_peer,
|
|
|
+ maxId:_max_id})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class DeleteHistoryRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x1c015b09;
|
|
|
+ static SUBCLASS_OF_ID = 0x2c49c116;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.AffectedHistory: Instance of AffectedHistory
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x1c015b09;
|
|
|
+ this.SUBCLASS_OF_ID = 0x2c49c116;
|
|
|
+
|
|
|
+ this.justClear = args.justClear || null;
|
|
|
+ this.revoke = args.revoke || null;
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.maxId = args.maxId;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("095b011c","hex"),
|
|
|
+ struct.pack('<I', (this.justClear === undefined || this.justClear === false || this.justClear === null) ? 0 : 1 | (this.revoke === undefined || this.revoke === false || this.revoke === null) ? 0 : 2),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ struct.pack('<i', this.maxId),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _just_clear;
|
|
|
+ let _revoke;
|
|
|
+ let _peer;
|
|
|
+ let _max_id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _just_clear = Boolean(flags & 1);
|
|
|
+ _revoke = Boolean(flags & 2);
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _max_id = reader.readInt();
|
|
|
+ return new this({justClear:_just_clear,
|
|
|
+ revoke:_revoke,
|
|
|
+ peer:_peer,
|
|
|
+ maxId:_max_id})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class DeleteMessagesRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xe58e95d2;
|
|
|
+ static SUBCLASS_OF_ID = 0xced3c06e;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.AffectedMessages: Instance of AffectedMessages
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xe58e95d2;
|
|
|
+ this.SUBCLASS_OF_ID = 0xced3c06e;
|
|
|
+
|
|
|
+ this.revoke = args.revoke || null;
|
|
|
+ this.id = args.id;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("d2958ee5","hex"),
|
|
|
+ struct.pack('<I', (this.revoke === undefined || this.revoke === false || this.revoke === null) ? 0 : 1),
|
|
|
+ Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.id.length),Buffer.concat(this.id.map(x => struct.pack('<i', x))),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _revoke;
|
|
|
+ let _id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _revoke = Boolean(flags & 1);
|
|
|
+ reader.readInt();
|
|
|
+ _id = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.readInt();
|
|
|
+ _id.push(_x);
|
|
|
+ }
|
|
|
+ return new this({revoke:_revoke,
|
|
|
+ id:_id})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class ReceivedMessagesRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x05a954c0;
|
|
|
+ static SUBCLASS_OF_ID = 0x8565f897;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Vector<ReceivedNotifyMessage>: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x05a954c0;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8565f897;
|
|
|
+
|
|
|
+ this.maxId = args.maxId;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("c054a905","hex"),
|
|
|
+ struct.pack('<i', this.maxId),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _max_id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _max_id = reader.readInt();
|
|
|
+ return new this({maxId:_max_id})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class SetTypingRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xa3825e50;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xa3825e50;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.action = args.action;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("505e82a3","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ this.action.getBytes(),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _action;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _action = reader.tgReadObject();
|
|
|
+ return new this({peer:_peer,
|
|
|
+ action:_action})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class SendMessageRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x520c3870;
|
|
|
+ static SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x520c3870;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ this.noWebpage = args.noWebpage || null;
|
|
|
+ this.silent = args.silent || null;
|
|
|
+ this.background = args.background || null;
|
|
|
+ this.clearDraft = args.clearDraft || null;
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.replyToMsgId = args.replyToMsgId || null;
|
|
|
+ this.message = args.message;
|
|
|
+ this.randomId = args.randomId !== undefined ? args.randomId : readBigIntFromBuffer(generateRandomBytes(8),false,true);
|
|
|
+ this.replyMarkup = args.replyMarkup || null;
|
|
|
+ this.entities = args.entities || null;
|
|
|
+ this.scheduleDate = args.scheduleDate || null;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("70380c52","hex"),
|
|
|
+ struct.pack('<I', (this.noWebpage === undefined || this.noWebpage === false || this.noWebpage === null) ? 0 : 2 | (this.silent === undefined || this.silent === false || this.silent === null) ? 0 : 32 | (this.background === undefined || this.background === false || this.background === null) ? 0 : 64 | (this.clearDraft === undefined || this.clearDraft === false || this.clearDraft === null) ? 0 : 128 | (this.replyToMsgId === undefined || this.replyToMsgId === false || this.replyToMsgId === null) ? 0 : 1 | (this.replyMarkup === undefined || this.replyMarkup === false || this.replyMarkup === null) ? 0 : 4 | (this.entities === undefined || this.entities === false || this.entities === null) ? 0 : 8 | (this.scheduleDate === undefined || this.scheduleDate === false || this.scheduleDate === null) ? 0 : 1024),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ (this.replyToMsgId === undefined || this.replyToMsgId === false || this.replyToMsgId ===null) ? Buffer.alloc(0) : [struct.pack('<i', this.replyToMsgId)],
|
|
|
+ TLObject.serializeBytes(this.message),
|
|
|
+ readBufferFromBigInt(this.randomId,8,true,true),
|
|
|
+ (this.replyMarkup === undefined || this.replyMarkup === false || this.replyMarkup ===null) ? Buffer.alloc(0) : [this.replyMarkup.getBytes()],
|
|
|
+ (this.entities === undefined || this.entities === false || this.entities ===null) ? Buffer.alloc(0) :Buffer.concat([Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.entities.length),Buffer.concat(this.entities.map(x => x.getBytes()))]),
|
|
|
+ (this.scheduleDate === undefined || this.scheduleDate === false || this.scheduleDate ===null) ? Buffer.alloc(0) : [struct.pack('<i', this.scheduleDate)],
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _no_webpage;
|
|
|
+ let _silent;
|
|
|
+ let _background;
|
|
|
+ let _clear_draft;
|
|
|
+ let _peer;
|
|
|
+ let _reply_to_msg_id;
|
|
|
+ let _message;
|
|
|
+ let _random_id;
|
|
|
+ let _reply_markup;
|
|
|
+ let _entities;
|
|
|
+ let _schedule_date;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _no_webpage = Boolean(flags & 2);
|
|
|
+ _silent = Boolean(flags & 32);
|
|
|
+ _background = Boolean(flags & 64);
|
|
|
+ _clear_draft = Boolean(flags & 128);
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ if (flags & 1) {
|
|
|
+ _reply_to_msg_id = reader.readInt();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _reply_to_msg_id = null
|
|
|
+ }
|
|
|
+ _message = reader.tgReadString();
|
|
|
+ _random_id = reader.readLong();
|
|
|
+ if (flags & 4) {
|
|
|
+ _reply_markup = reader.tgReadObject();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _reply_markup = null
|
|
|
+ }
|
|
|
+ if (flags & 8) {
|
|
|
+ reader.readInt();
|
|
|
+ _entities = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.tgReadObject();
|
|
|
+ _entities.push(_x);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _entities = null
|
|
|
+ }
|
|
|
+ if (flags & 1024) {
|
|
|
+ _schedule_date = reader.readInt();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _schedule_date = null
|
|
|
+ }
|
|
|
+ return new this({noWebpage:_no_webpage,
|
|
|
+ silent:_silent,
|
|
|
+ background:_background,
|
|
|
+ clearDraft:_clear_draft,
|
|
|
+ peer:_peer,
|
|
|
+ replyToMsgId:_reply_to_msg_id,
|
|
|
+ message:_message,
|
|
|
+ randomId:_random_id,
|
|
|
+ replyMarkup:_reply_markup,
|
|
|
+ entities:_entities,
|
|
|
+ scheduleDate:_schedule_date})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class SendMediaRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x3491eba9;
|
|
|
+ static SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x3491eba9;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ this.silent = args.silent || null;
|
|
|
+ this.background = args.background || null;
|
|
|
+ this.clearDraft = args.clearDraft || null;
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.replyToMsgId = args.replyToMsgId || null;
|
|
|
+ this.media = args.media;
|
|
|
+ this.message = args.message;
|
|
|
+ this.randomId = args.randomId !== undefined ? args.randomId : readBigIntFromBuffer(generateRandomBytes(8),false,true);
|
|
|
+ this.replyMarkup = args.replyMarkup || null;
|
|
|
+ this.entities = args.entities || null;
|
|
|
+ this.scheduleDate = args.scheduleDate || null;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ this.media = utils.getInputMedia(this.media)
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("a9eb9134","hex"),
|
|
|
+ struct.pack('<I', (this.silent === undefined || this.silent === false || this.silent === null) ? 0 : 32 | (this.background === undefined || this.background === false || this.background === null) ? 0 : 64 | (this.clearDraft === undefined || this.clearDraft === false || this.clearDraft === null) ? 0 : 128 | (this.replyToMsgId === undefined || this.replyToMsgId === false || this.replyToMsgId === null) ? 0 : 1 | (this.replyMarkup === undefined || this.replyMarkup === false || this.replyMarkup === null) ? 0 : 4 | (this.entities === undefined || this.entities === false || this.entities === null) ? 0 : 8 | (this.scheduleDate === undefined || this.scheduleDate === false || this.scheduleDate === null) ? 0 : 1024),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ (this.replyToMsgId === undefined || this.replyToMsgId === false || this.replyToMsgId ===null) ? Buffer.alloc(0) : [struct.pack('<i', this.replyToMsgId)],
|
|
|
+ this.media.getBytes(),
|
|
|
+ TLObject.serializeBytes(this.message),
|
|
|
+ readBufferFromBigInt(this.randomId,8,true,true),
|
|
|
+ (this.replyMarkup === undefined || this.replyMarkup === false || this.replyMarkup ===null) ? Buffer.alloc(0) : [this.replyMarkup.getBytes()],
|
|
|
+ (this.entities === undefined || this.entities === false || this.entities ===null) ? Buffer.alloc(0) :Buffer.concat([Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.entities.length),Buffer.concat(this.entities.map(x => x.getBytes()))]),
|
|
|
+ (this.scheduleDate === undefined || this.scheduleDate === false || this.scheduleDate ===null) ? Buffer.alloc(0) : [struct.pack('<i', this.scheduleDate)],
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _silent;
|
|
|
+ let _background;
|
|
|
+ let _clear_draft;
|
|
|
+ let _peer;
|
|
|
+ let _reply_to_msg_id;
|
|
|
+ let _media;
|
|
|
+ let _message;
|
|
|
+ let _random_id;
|
|
|
+ let _reply_markup;
|
|
|
+ let _entities;
|
|
|
+ let _schedule_date;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _silent = Boolean(flags & 32);
|
|
|
+ _background = Boolean(flags & 64);
|
|
|
+ _clear_draft = Boolean(flags & 128);
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ if (flags & 1) {
|
|
|
+ _reply_to_msg_id = reader.readInt();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _reply_to_msg_id = null
|
|
|
+ }
|
|
|
+ _media = reader.tgReadObject();
|
|
|
+ _message = reader.tgReadString();
|
|
|
+ _random_id = reader.readLong();
|
|
|
+ if (flags & 4) {
|
|
|
+ _reply_markup = reader.tgReadObject();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _reply_markup = null
|
|
|
+ }
|
|
|
+ if (flags & 8) {
|
|
|
+ reader.readInt();
|
|
|
+ _entities = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.tgReadObject();
|
|
|
+ _entities.push(_x);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _entities = null
|
|
|
+ }
|
|
|
+ if (flags & 1024) {
|
|
|
+ _schedule_date = reader.readInt();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _schedule_date = null
|
|
|
+ }
|
|
|
+ return new this({silent:_silent,
|
|
|
+ background:_background,
|
|
|
+ clearDraft:_clear_draft,
|
|
|
+ peer:_peer,
|
|
|
+ replyToMsgId:_reply_to_msg_id,
|
|
|
+ media:_media,
|
|
|
+ message:_message,
|
|
|
+ randomId:_random_id,
|
|
|
+ replyMarkup:_reply_markup,
|
|
|
+ entities:_entities,
|
|
|
+ scheduleDate:_schedule_date})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class ForwardMessagesRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xd9fee60e;
|
|
|
+ static SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xd9fee60e;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ this.silent = args.silent || null;
|
|
|
+ this.background = args.background || null;
|
|
|
+ this.withMyScore = args.withMyScore || null;
|
|
|
+ this.grouped = args.grouped || null;
|
|
|
+ this.fromPeer = args.fromPeer;
|
|
|
+ this.id = args.id;
|
|
|
+ this.randomId = args.randomId !== undefined ? args.randomId : new Array(id.length).fill().map(_ => readBigIntFromBuffer(generateRandomBytes(8),false,true));
|
|
|
+ this.toPeer = args.toPeer;
|
|
|
+ this.scheduleDate = args.scheduleDate || null;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.from_peer = utils.getInputPeer(await client.getInputEntity(this.fromPeer))
|
|
|
+ this.to_peer = utils.getInputPeer(await client.getInputEntity(this.toPeer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("0ee6fed9","hex"),
|
|
|
+ struct.pack('<I', (this.silent === undefined || this.silent === false || this.silent === null) ? 0 : 32 | (this.background === undefined || this.background === false || this.background === null) ? 0 : 64 | (this.withMyScore === undefined || this.withMyScore === false || this.withMyScore === null) ? 0 : 256 | (this.grouped === undefined || this.grouped === false || this.grouped === null) ? 0 : 512 | (this.scheduleDate === undefined || this.scheduleDate === false || this.scheduleDate === null) ? 0 : 1024),
|
|
|
+ this.fromPeer.getBytes(),
|
|
|
+ Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.id.length),Buffer.concat(this.id.map(x => struct.pack('<i', x))),
|
|
|
+ Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.randomId.length),Buffer.concat(this.randomId.map(x => readBufferFromBigInt(x,8,true,true))),
|
|
|
+ this.toPeer.getBytes(),
|
|
|
+ (this.scheduleDate === undefined || this.scheduleDate === false || this.scheduleDate ===null) ? Buffer.alloc(0) : [struct.pack('<i', this.scheduleDate)],
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _silent;
|
|
|
+ let _background;
|
|
|
+ let _with_my_score;
|
|
|
+ let _grouped;
|
|
|
+ let _from_peer;
|
|
|
+ let _id;
|
|
|
+ let _random_id;
|
|
|
+ let _to_peer;
|
|
|
+ let _schedule_date;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _silent = Boolean(flags & 32);
|
|
|
+ _background = Boolean(flags & 64);
|
|
|
+ _with_my_score = Boolean(flags & 256);
|
|
|
+ _grouped = Boolean(flags & 512);
|
|
|
+ _from_peer = reader.tgReadObject();
|
|
|
+ reader.readInt();
|
|
|
+ _id = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.readInt();
|
|
|
+ _id.push(_x);
|
|
|
+ }
|
|
|
+ reader.readInt();
|
|
|
+ _random_id = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.readLong();
|
|
|
+ _random_id.push(_x);
|
|
|
+ }
|
|
|
+ _to_peer = reader.tgReadObject();
|
|
|
+ if (flags & 1024) {
|
|
|
+ _schedule_date = reader.readInt();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _schedule_date = null
|
|
|
+ }
|
|
|
+ return new this({silent:_silent,
|
|
|
+ background:_background,
|
|
|
+ withMyScore:_with_my_score,
|
|
|
+ grouped:_grouped,
|
|
|
+ fromPeer:_from_peer,
|
|
|
+ id:_id,
|
|
|
+ randomId:_random_id,
|
|
|
+ toPeer:_to_peer,
|
|
|
+ scheduleDate:_schedule_date})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class ReportSpamRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xcf1592db;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xcf1592db;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("db9215cf","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ return new this({peer:_peer})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetPeerSettingsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x3672e09c;
|
|
|
+ static SUBCLASS_OF_ID = 0xf6a79f84;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns PeerSettings: Instance of PeerSettings
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x3672e09c;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf6a79f84;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("9ce07236","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ return new this({peer:_peer})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class ReportRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xbd82b658;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xbd82b658;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.id = args.id;
|
|
|
+ this.reason = args.reason;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("58b682bd","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.id.length),Buffer.concat(this.id.map(x => struct.pack('<i', x))),
|
|
|
+ this.reason.getBytes(),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _id;
|
|
|
+ let _reason;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ reader.readInt();
|
|
|
+ _id = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.readInt();
|
|
|
+ _id.push(_x);
|
|
|
+ }
|
|
|
+ _reason = reader.tgReadObject();
|
|
|
+ return new this({peer:_peer,
|
|
|
+ id:_id,
|
|
|
+ reason:_reason})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class GetChatsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x3c6aa187;
|
|
|
+ static SUBCLASS_OF_ID = 0x99d5cb14;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.Chats: Instance of either Chats, ChatsSlice
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x3c6aa187;
|
|
|
+ this.SUBCLASS_OF_ID = 0x99d5cb14;
|
|
|
+
|
|
|
+ this.id = args.id;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("87a16a3c","hex"),
|
|
|
+ Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.id.length),Buffer.concat(this.id.map(x => struct.pack('<i', x))),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ reader.readInt();
|
|
|
+ _id = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.readInt();
|
|
|
+ _id.push(_x);
|
|
|
+ }
|
|
|
+ return new this({id:_id})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class GetFullChatRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x3b831c66;
|
|
|
+ static SUBCLASS_OF_ID = 0x225a5109;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.ChatFull: Instance of ChatFull
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x3b831c66;
|
|
|
+ this.SUBCLASS_OF_ID = 0x225a5109;
|
|
|
+
|
|
|
+ this.chatId = args.chatId;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("661c833b","hex"),
|
|
|
+ struct.pack('<i', this.chatId),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _chat_id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _chat_id = reader.readInt();
|
|
|
+ return new this({chatId:_chat_id})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class EditChatTitleRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xdc452855;
|
|
|
+ static SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xdc452855;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ this.chatId = args.chatId;
|
|
|
+ this.title = args.title;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("552845dc","hex"),
|
|
|
+ struct.pack('<i', this.chatId),
|
|
|
+ TLObject.serializeBytes(this.title),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _chat_id;
|
|
|
+ let _title;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _chat_id = reader.readInt();
|
|
|
+ _title = reader.tgReadString();
|
|
|
+ return new this({chatId:_chat_id,
|
|
|
+ title:_title})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class EditChatPhotoRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xca4c79d8;
|
|
|
+ static SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xca4c79d8;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ this.chatId = args.chatId;
|
|
|
+ this.photo = args.photo;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.chat_id = await client.getPeerId(this.chatId, add_mark=False)
|
|
|
+ this.photo = utils.getInputChatPhoto(this.photo)
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("d8794cca","hex"),
|
|
|
+ struct.pack('<i', this.chatId),
|
|
|
+ this.photo.getBytes(),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _chat_id;
|
|
|
+ let _photo;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _chat_id = reader.readInt();
|
|
|
+ _photo = reader.tgReadObject();
|
|
|
+ return new this({chatId:_chat_id,
|
|
|
+ photo:_photo})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class AddChatUserRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xf9a0aa09;
|
|
|
+ static SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xf9a0aa09;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ this.chatId = args.chatId;
|
|
|
+ this.userId = args.userId;
|
|
|
+ this.fwdLimit = args.fwdLimit;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.chat_id = await client.getPeerId(this.chatId, add_mark=False)
|
|
|
+ this.user_id = utils.getInputUser(await client.getInputEntity(this.userId))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("09aaa0f9","hex"),
|
|
|
+ struct.pack('<i', this.chatId),
|
|
|
+ this.userId.getBytes(),
|
|
|
+ struct.pack('<i', this.fwdLimit),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _chat_id;
|
|
|
+ let _user_id;
|
|
|
+ let _fwd_limit;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _chat_id = reader.readInt();
|
|
|
+ _user_id = reader.tgReadObject();
|
|
|
+ _fwd_limit = reader.readInt();
|
|
|
+ return new this({chatId:_chat_id,
|
|
|
+ userId:_user_id,
|
|
|
+ fwdLimit:_fwd_limit})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class DeleteChatUserRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xe0611f16;
|
|
|
+ static SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xe0611f16;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ this.chatId = args.chatId;
|
|
|
+ this.userId = args.userId;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.chat_id = await client.getPeerId(this.chatId, add_mark=False)
|
|
|
+ this.user_id = utils.getInputUser(await client.getInputEntity(this.userId))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("161f61e0","hex"),
|
|
|
+ struct.pack('<i', this.chatId),
|
|
|
+ this.userId.getBytes(),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _chat_id;
|
|
|
+ let _user_id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _chat_id = reader.readInt();
|
|
|
+ _user_id = reader.tgReadObject();
|
|
|
+ return new this({chatId:_chat_id,
|
|
|
+ userId:_user_id})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class CreateChatRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x09cb126e;
|
|
|
+ static SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x09cb126e;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ this.users = args.users;
|
|
|
+ this.title = args.title;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ const _tmp = [];for (const _x of this.users) {
|
|
|
+ _tmp.push(utils.getInputUser(await client.getInputEntity(_x)));
|
|
|
+ }
|
|
|
+ this.users = _tmp;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("6e12cb09","hex"),
|
|
|
+ Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.users.length),Buffer.concat(this.users.map(x => x.getBytes())),
|
|
|
+ TLObject.serializeBytes(this.title),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _users;
|
|
|
+ let _title;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ reader.readInt();
|
|
|
+ _users = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.tgReadObject();
|
|
|
+ _users.push(_x);
|
|
|
+ }
|
|
|
+ _title = reader.tgReadString();
|
|
|
+ return new this({users:_users,
|
|
|
+ title:_title})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class GetDhConfigRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x26cf8950;
|
|
|
+ static SUBCLASS_OF_ID = 0xe488ed8b;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.DhConfig: Instance of either DhConfigNotModified, DhConfig
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x26cf8950;
|
|
|
+ this.SUBCLASS_OF_ID = 0xe488ed8b;
|
|
|
+
|
|
|
+ this.version = args.version;
|
|
|
+ this.randomLength = args.randomLength;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("5089cf26","hex"),
|
|
|
+ struct.pack('<i', this.version),
|
|
|
+ struct.pack('<i', this.randomLength),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _version;
|
|
|
+ let _random_length;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _version = reader.readInt();
|
|
|
+ _random_length = reader.readInt();
|
|
|
+ return new this({version:_version,
|
|
|
+ randomLength:_random_length})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class RequestEncryptionRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xf64daf43;
|
|
|
+ static SUBCLASS_OF_ID = 0x6d28a37a;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns EncryptedChat: Instance of either EncryptedChatEmpty, EncryptedChatWaiting, EncryptedChatRequested, EncryptedChat, EncryptedChatDiscarded
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xf64daf43;
|
|
|
+ this.SUBCLASS_OF_ID = 0x6d28a37a;
|
|
|
+
|
|
|
+ this.userId = args.userId;
|
|
|
+ this.randomId = args.randomId !== undefined ? args.randomId : readBigIntFromBuffer(generateRandomBytes(4),false,true);
|
|
|
+ this.gA = args.gA;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.user_id = utils.getInputUser(await client.getInputEntity(this.userId))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("43af4df6","hex"),
|
|
|
+ this.userId.getBytes(),
|
|
|
+ struct.pack('<i', this.randomId),
|
|
|
+ TLObject.serializeBytes(this.gA),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _user_id;
|
|
|
+ let _random_id;
|
|
|
+ let _g_a;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _user_id = reader.tgReadObject();
|
|
|
+ _random_id = reader.readInt();
|
|
|
+ _g_a = reader.tgReadBytes();
|
|
|
+ return new this({userId:_user_id,
|
|
|
+ randomId:_random_id,
|
|
|
+ gA:_g_a})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class AcceptEncryptionRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x3dbc0415;
|
|
|
+ static SUBCLASS_OF_ID = 0x6d28a37a;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns EncryptedChat: Instance of either EncryptedChatEmpty, EncryptedChatWaiting, EncryptedChatRequested, EncryptedChat, EncryptedChatDiscarded
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x3dbc0415;
|
|
|
+ this.SUBCLASS_OF_ID = 0x6d28a37a;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.gB = args.gB;
|
|
|
+ this.keyFingerprint = args.keyFingerprint;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("1504bc3d","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ TLObject.serializeBytes(this.gB),
|
|
|
+ readBufferFromBigInt(this.keyFingerprint,8,true,true),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _g_b;
|
|
|
+ let _key_fingerprint;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _g_b = reader.tgReadBytes();
|
|
|
+ _key_fingerprint = reader.readLong();
|
|
|
+ return new this({peer:_peer,
|
|
|
+ gB:_g_b,
|
|
|
+ keyFingerprint:_key_fingerprint})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class DiscardEncryptionRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xedd923c5;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xedd923c5;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.chatId = args.chatId;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("c523d9ed","hex"),
|
|
|
+ struct.pack('<i', this.chatId),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _chat_id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _chat_id = reader.readInt();
|
|
|
+ return new this({chatId:_chat_id})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class SetEncryptedTypingRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x791451ed;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x791451ed;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.typing = args.typing;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("ed511479","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ this.typing ? 0xb5757299 : 0x379779bc,
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _typing;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _typing = reader.tgReadBool();
|
|
|
+ return new this({peer:_peer,
|
|
|
+ typing:_typing})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class ReadEncryptedHistoryRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x7f4b690a;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x7f4b690a;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.maxDate = args.maxDate;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("0a694b7f","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ struct.pack('<i', this.maxDate),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _max_date;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _max_date = reader.readInt();
|
|
|
+ return new this({peer:_peer,
|
|
|
+ maxDate:_max_date})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class SendEncryptedRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xa9776773;
|
|
|
+ static SUBCLASS_OF_ID = 0xc99e3e50;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.SentEncryptedMessage: Instance of either SentEncryptedMessage, SentEncryptedFile
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xa9776773;
|
|
|
+ this.SUBCLASS_OF_ID = 0xc99e3e50;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.randomId = args.randomId !== undefined ? args.randomId : readBigIntFromBuffer(generateRandomBytes(8),false,true);
|
|
|
+ this.data = args.data;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("736777a9","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ readBufferFromBigInt(this.randomId,8,true,true),
|
|
|
+ TLObject.serializeBytes(this.data),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _random_id;
|
|
|
+ let _data;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _random_id = reader.readLong();
|
|
|
+ _data = reader.tgReadBytes();
|
|
|
+ return new this({peer:_peer,
|
|
|
+ randomId:_random_id,
|
|
|
+ data:_data})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class SendEncryptedFileRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x9a901b66;
|
|
|
+ static SUBCLASS_OF_ID = 0xc99e3e50;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.SentEncryptedMessage: Instance of either SentEncryptedMessage, SentEncryptedFile
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x9a901b66;
|
|
|
+ this.SUBCLASS_OF_ID = 0xc99e3e50;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.randomId = args.randomId !== undefined ? args.randomId : readBigIntFromBuffer(generateRandomBytes(8),false,true);
|
|
|
+ this.data = args.data;
|
|
|
+ this.file = args.file;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("661b909a","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ readBufferFromBigInt(this.randomId,8,true,true),
|
|
|
+ TLObject.serializeBytes(this.data),
|
|
|
+ this.file.getBytes(),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _random_id;
|
|
|
+ let _data;
|
|
|
+ let _file;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _random_id = reader.readLong();
|
|
|
+ _data = reader.tgReadBytes();
|
|
|
+ _file = reader.tgReadObject();
|
|
|
+ return new this({peer:_peer,
|
|
|
+ randomId:_random_id,
|
|
|
+ data:_data,
|
|
|
+ file:_file})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class SendEncryptedServiceRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x32d439a4;
|
|
|
+ static SUBCLASS_OF_ID = 0xc99e3e50;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.SentEncryptedMessage: Instance of either SentEncryptedMessage, SentEncryptedFile
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x32d439a4;
|
|
|
+ this.SUBCLASS_OF_ID = 0xc99e3e50;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.randomId = args.randomId !== undefined ? args.randomId : readBigIntFromBuffer(generateRandomBytes(8),false,true);
|
|
|
+ this.data = args.data;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("a439d432","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ readBufferFromBigInt(this.randomId,8,true,true),
|
|
|
+ TLObject.serializeBytes(this.data),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _random_id;
|
|
|
+ let _data;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _random_id = reader.readLong();
|
|
|
+ _data = reader.tgReadBytes();
|
|
|
+ return new this({peer:_peer,
|
|
|
+ randomId:_random_id,
|
|
|
+ data:_data})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class ReceivedQueueRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x55a5bb66;
|
|
|
+ static SUBCLASS_OF_ID = 0x8918e168;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Vector<long>: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x55a5bb66;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8918e168;
|
|
|
+
|
|
|
+ this.maxQts = args.maxQts;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("66bba555","hex"),
|
|
|
+ struct.pack('<i', this.maxQts),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _max_qts;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _max_qts = reader.readInt();
|
|
|
+ return new this({maxQts:_max_qts})
|
|
|
+ }
|
|
|
+ readResult(reader){
|
|
|
+ reader.readInt(); // Vector ID
|
|
|
+ let temp = [];
|
|
|
+ let len = reader.readInt(); //fix this
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ temp.push(reader.readLong())
|
|
|
+ }
|
|
|
+ return temp
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class ReportEncryptedSpamRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x4b0c8c0f;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x4b0c8c0f;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("0f8c0c4b","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ return new this({peer:_peer})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class ReadMessageContentsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x36a73f77;
|
|
|
+ static SUBCLASS_OF_ID = 0xced3c06e;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.AffectedMessages: Instance of AffectedMessages
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x36a73f77;
|
|
|
+ this.SUBCLASS_OF_ID = 0xced3c06e;
|
|
|
+
|
|
|
+ this.id = args.id;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("773fa736","hex"),
|
|
|
+ Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.id.length),Buffer.concat(this.id.map(x => struct.pack('<i', x))),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ reader.readInt();
|
|
|
+ _id = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.readInt();
|
|
|
+ _id.push(_x);
|
|
|
+ }
|
|
|
+ return new this({id:_id})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class GetStickersRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x043d4f2c;
|
|
|
+ static SUBCLASS_OF_ID = 0xd73bb9de;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.Stickers: Instance of either StickersNotModified, Stickers
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x043d4f2c;
|
|
|
+ this.SUBCLASS_OF_ID = 0xd73bb9de;
|
|
|
+
|
|
|
+ this.emoticon = args.emoticon;
|
|
|
+ this.hash = args.hash;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("2c4f3d04","hex"),
|
|
|
+ TLObject.serializeBytes(this.emoticon),
|
|
|
+ struct.pack('<i', this.hash),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _emoticon;
|
|
|
+ let _hash;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _emoticon = reader.tgReadString();
|
|
|
+ _hash = reader.readInt();
|
|
|
+ return new this({emoticon:_emoticon,
|
|
|
+ hash:_hash})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetAllStickersRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x1c9618b1;
|
|
|
+ static SUBCLASS_OF_ID = 0x45834829;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.AllStickers: Instance of either AllStickersNotModified, AllStickers
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x1c9618b1;
|
|
|
+ this.SUBCLASS_OF_ID = 0x45834829;
|
|
|
+
|
|
|
+ this.hash = args.hash;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("b118961c","hex"),
|
|
|
+ struct.pack('<i', this.hash),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _hash;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _hash = reader.readInt();
|
|
|
+ return new this({hash:_hash})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetWebPagePreviewRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x8b68b0cc;
|
|
|
+ static SUBCLASS_OF_ID = 0x476cbe32;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns MessageMedia: Instance of either MessageMediaEmpty, MessageMediaPhoto, MessageMediaGeo, MessageMediaContact, MessageMediaUnsupported, MessageMediaDocument, MessageMediaWebPage, MessageMediaVenue, MessageMediaGame, MessageMediaInvoice, MessageMediaGeoLive, MessageMediaPoll
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x8b68b0cc;
|
|
|
+ this.SUBCLASS_OF_ID = 0x476cbe32;
|
|
|
+
|
|
|
+ this.message = args.message;
|
|
|
+ this.entities = args.entities || null;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("ccb0688b","hex"),
|
|
|
+ struct.pack('<I', (this.entities === undefined || this.entities === false || this.entities === null) ? 0 : 8),
|
|
|
+ TLObject.serializeBytes(this.message),
|
|
|
+ (this.entities === undefined || this.entities === false || this.entities ===null) ? Buffer.alloc(0) :Buffer.concat([Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.entities.length),Buffer.concat(this.entities.map(x => x.getBytes()))]),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _message;
|
|
|
+ let _entities;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _message = reader.tgReadString();
|
|
|
+ if (flags & 8) {
|
|
|
+ reader.readInt();
|
|
|
+ _entities = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.tgReadObject();
|
|
|
+ _entities.push(_x);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _entities = null
|
|
|
+ }
|
|
|
+ return new this({message:_message,
|
|
|
+ entities:_entities})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class ExportChatInviteRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x0df7534c;
|
|
|
+ static SUBCLASS_OF_ID = 0xb4748a58;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns ExportedChatInvite: Instance of either ChatInviteEmpty, ChatInviteExported
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x0df7534c;
|
|
|
+ this.SUBCLASS_OF_ID = 0xb4748a58;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("4c53f70d","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ return new this({peer:_peer})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class CheckChatInviteRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x3eadb1bb;
|
|
|
+ static SUBCLASS_OF_ID = 0x4561736;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns ChatInvite: Instance of either ChatInviteAlready, ChatInvite
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x3eadb1bb;
|
|
|
+ this.SUBCLASS_OF_ID = 0x4561736;
|
|
|
+
|
|
|
+ this.hash = args.hash;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("bbb1ad3e","hex"),
|
|
|
+ TLObject.serializeBytes(this.hash),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _hash;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _hash = reader.tgReadString();
|
|
|
+ return new this({hash:_hash})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class ImportChatInviteRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x6c50051c;
|
|
|
+ static SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x6c50051c;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ this.hash = args.hash;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("1c05506c","hex"),
|
|
|
+ TLObject.serializeBytes(this.hash),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _hash;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _hash = reader.tgReadString();
|
|
|
+ return new this({hash:_hash})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetStickerSetRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x2619a90e;
|
|
|
+ static SUBCLASS_OF_ID = 0x9b704a5a;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.StickerSet: Instance of StickerSet
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x2619a90e;
|
|
|
+ this.SUBCLASS_OF_ID = 0x9b704a5a;
|
|
|
+
|
|
|
+ this.stickerset = args.stickerset;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("0ea91926","hex"),
|
|
|
+ this.stickerset.getBytes(),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _stickerset;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _stickerset = reader.tgReadObject();
|
|
|
+ return new this({stickerset:_stickerset})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class InstallStickerSetRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xc78fe460;
|
|
|
+ static SUBCLASS_OF_ID = 0x67cb3fe8;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.StickerSetInstallResult: Instance of either StickerSetInstallResultSuccess, StickerSetInstallResultArchive
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xc78fe460;
|
|
|
+ this.SUBCLASS_OF_ID = 0x67cb3fe8;
|
|
|
+
|
|
|
+ this.stickerset = args.stickerset;
|
|
|
+ this.archived = args.archived;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("60e48fc7","hex"),
|
|
|
+ this.stickerset.getBytes(),
|
|
|
+ this.archived ? 0xb5757299 : 0x379779bc,
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _stickerset;
|
|
|
+ let _archived;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _stickerset = reader.tgReadObject();
|
|
|
+ _archived = reader.tgReadBool();
|
|
|
+ return new this({stickerset:_stickerset,
|
|
|
+ archived:_archived})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class UninstallStickerSetRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xf96e55de;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xf96e55de;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.stickerset = args.stickerset;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("de556ef9","hex"),
|
|
|
+ this.stickerset.getBytes(),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _stickerset;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _stickerset = reader.tgReadObject();
|
|
|
+ return new this({stickerset:_stickerset})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class StartBotRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xe6df7378;
|
|
|
+ static SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xe6df7378;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ this.bot = args.bot;
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.randomId = args.randomId !== undefined ? args.randomId : readBigIntFromBuffer(generateRandomBytes(8),false,true);
|
|
|
+ this.startParam = args.startParam;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.bot = utils.getInputUser(await client.getInputEntity(this.bot))
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("7873dfe6","hex"),
|
|
|
+ this.bot.getBytes(),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ readBufferFromBigInt(this.randomId,8,true,true),
|
|
|
+ TLObject.serializeBytes(this.startParam),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _bot;
|
|
|
+ let _peer;
|
|
|
+ let _random_id;
|
|
|
+ let _start_param;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _bot = reader.tgReadObject();
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _random_id = reader.readLong();
|
|
|
+ _start_param = reader.tgReadString();
|
|
|
+ return new this({bot:_bot,
|
|
|
+ peer:_peer,
|
|
|
+ randomId:_random_id,
|
|
|
+ startParam:_start_param})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetMessagesViewsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xc4c8a55d;
|
|
|
+ static SUBCLASS_OF_ID = 0x5026710f;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Vector<int>: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xc4c8a55d;
|
|
|
+ this.SUBCLASS_OF_ID = 0x5026710f;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.id = args.id;
|
|
|
+ this.increment = args.increment;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("5da5c8c4","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.id.length),Buffer.concat(this.id.map(x => struct.pack('<i', x))),
|
|
|
+ this.increment ? 0xb5757299 : 0x379779bc,
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _id;
|
|
|
+ let _increment;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ reader.readInt();
|
|
|
+ _id = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.readInt();
|
|
|
+ _id.push(_x);
|
|
|
+ }
|
|
|
+ _increment = reader.tgReadBool();
|
|
|
+ return new this({peer:_peer,
|
|
|
+ id:_id,
|
|
|
+ increment:_increment})
|
|
|
+ }
|
|
|
+ readResult(reader){
|
|
|
+ reader.readInt(); // Vector ID
|
|
|
+ let temp = [];
|
|
|
+ let len = reader.readInt(); //fix this
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ temp.push(reader.readInt())
|
|
|
+ }
|
|
|
+ return temp
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class EditChatAdminRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xa9e69f2e;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xa9e69f2e;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.chatId = args.chatId;
|
|
|
+ this.userId = args.userId;
|
|
|
+ this.isAdmin = args.isAdmin;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.chat_id = await client.getPeerId(this.chatId, add_mark=False)
|
|
|
+ this.user_id = utils.getInputUser(await client.getInputEntity(this.userId))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("2e9fe6a9","hex"),
|
|
|
+ struct.pack('<i', this.chatId),
|
|
|
+ this.userId.getBytes(),
|
|
|
+ this.isAdmin ? 0xb5757299 : 0x379779bc,
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _chat_id;
|
|
|
+ let _user_id;
|
|
|
+ let _is_admin;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _chat_id = reader.readInt();
|
|
|
+ _user_id = reader.tgReadObject();
|
|
|
+ _is_admin = reader.tgReadBool();
|
|
|
+ return new this({chatId:_chat_id,
|
|
|
+ userId:_user_id,
|
|
|
+ isAdmin:_is_admin})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class MigrateChatRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x15a3b8e3;
|
|
|
+ static SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x15a3b8e3;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ this.chatId = args.chatId;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("e3b8a315","hex"),
|
|
|
+ struct.pack('<i', this.chatId),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _chat_id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _chat_id = reader.readInt();
|
|
|
+ return new this({chatId:_chat_id})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class SearchGlobalRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xbf7225a4;
|
|
|
+ static SUBCLASS_OF_ID = 0xd4b40b5e;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.Messages: Instance of either Messages, MessagesSlice, ChannelMessages, MessagesNotModified
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xbf7225a4;
|
|
|
+ this.SUBCLASS_OF_ID = 0xd4b40b5e;
|
|
|
+
|
|
|
+ this.folderId = args.folderId || null;
|
|
|
+ this.q = args.q;
|
|
|
+ this.offsetRate = args.offsetRate;
|
|
|
+ this.offsetPeer = args.offsetPeer;
|
|
|
+ this.offsetId = args.offsetId;
|
|
|
+ this.limit = args.limit;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.offset_peer = utils.getInputPeer(await client.getInputEntity(this.offsetPeer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("a42572bf","hex"),
|
|
|
+ struct.pack('<I', (this.folderId === undefined || this.folderId === false || this.folderId === null) ? 0 : 1),
|
|
|
+ (this.folderId === undefined || this.folderId === false || this.folderId ===null) ? Buffer.alloc(0) : [struct.pack('<i', this.folderId)],
|
|
|
+ TLObject.serializeBytes(this.q),
|
|
|
+ struct.pack('<i', this.offsetRate),
|
|
|
+ this.offsetPeer.getBytes(),
|
|
|
+ struct.pack('<i', this.offsetId),
|
|
|
+ struct.pack('<i', this.limit),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _folder_id;
|
|
|
+ let _q;
|
|
|
+ let _offset_rate;
|
|
|
+ let _offset_peer;
|
|
|
+ let _offset_id;
|
|
|
+ let _limit;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ if (flags & 1) {
|
|
|
+ _folder_id = reader.readInt();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _folder_id = null
|
|
|
+ }
|
|
|
+ _q = reader.tgReadString();
|
|
|
+ _offset_rate = reader.readInt();
|
|
|
+ _offset_peer = reader.tgReadObject();
|
|
|
+ _offset_id = reader.readInt();
|
|
|
+ _limit = reader.readInt();
|
|
|
+ return new this({folderId:_folder_id,
|
|
|
+ q:_q,
|
|
|
+ offsetRate:_offset_rate,
|
|
|
+ offsetPeer:_offset_peer,
|
|
|
+ offsetId:_offset_id,
|
|
|
+ limit:_limit})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class ReorderStickerSetsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x78337739;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x78337739;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.masks = args.masks || null;
|
|
|
+ this.order = args.order;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("39773378","hex"),
|
|
|
+ struct.pack('<I', (this.masks === undefined || this.masks === false || this.masks === null) ? 0 : 1),
|
|
|
+ Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.order.length),Buffer.concat(this.order.map(x => readBufferFromBigInt(x,8,true,true))),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _masks;
|
|
|
+ let _order;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _masks = Boolean(flags & 1);
|
|
|
+ reader.readInt();
|
|
|
+ _order = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.readLong();
|
|
|
+ _order.push(_x);
|
|
|
+ }
|
|
|
+ return new this({masks:_masks,
|
|
|
+ order:_order})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class GetDocumentByHashRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x338e2464;
|
|
|
+ static SUBCLASS_OF_ID = 0x211fe820;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Document: Instance of either DocumentEmpty, Document
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x338e2464;
|
|
|
+ this.SUBCLASS_OF_ID = 0x211fe820;
|
|
|
+
|
|
|
+ this.sha256 = args.sha256;
|
|
|
+ this.size = args.size;
|
|
|
+ this.mimeType = args.mimeType;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("64248e33","hex"),
|
|
|
+ TLObject.serializeBytes(this.sha256),
|
|
|
+ struct.pack('<i', this.size),
|
|
|
+ TLObject.serializeBytes(this.mimeType),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _sha256;
|
|
|
+ let _size;
|
|
|
+ let _mime_type;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _sha256 = reader.tgReadBytes();
|
|
|
+ _size = reader.readInt();
|
|
|
+ _mime_type = reader.tgReadString();
|
|
|
+ return new this({sha256:_sha256,
|
|
|
+ size:_size,
|
|
|
+ mimeType:_mime_type})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class SearchGifsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xbf9a776b;
|
|
|
+ static SUBCLASS_OF_ID = 0xe799ea7;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.FoundGifs: Instance of FoundGifs
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xbf9a776b;
|
|
|
+ this.SUBCLASS_OF_ID = 0xe799ea7;
|
|
|
+
|
|
|
+ this.q = args.q;
|
|
|
+ this.offset = args.offset;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("6b779abf","hex"),
|
|
|
+ TLObject.serializeBytes(this.q),
|
|
|
+ struct.pack('<i', this.offset),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _q;
|
|
|
+ let _offset;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _q = reader.tgReadString();
|
|
|
+ _offset = reader.readInt();
|
|
|
+ return new this({q:_q,
|
|
|
+ offset:_offset})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetSavedGifsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x83bf3d52;
|
|
|
+ static SUBCLASS_OF_ID = 0xa68b61f5;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.SavedGifs: Instance of either SavedGifsNotModified, SavedGifs
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x83bf3d52;
|
|
|
+ this.SUBCLASS_OF_ID = 0xa68b61f5;
|
|
|
+
|
|
|
+ this.hash = args.hash;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("523dbf83","hex"),
|
|
|
+ struct.pack('<i', this.hash),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _hash;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _hash = reader.readInt();
|
|
|
+ return new this({hash:_hash})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class SaveGifRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x327a30cb;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x327a30cb;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.id = args.id;
|
|
|
+ this.unsave = args.unsave;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.id = utils.getInputDocument(this.id)
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("cb307a32","hex"),
|
|
|
+ this.id.getBytes(),
|
|
|
+ this.unsave ? 0xb5757299 : 0x379779bc,
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _id;
|
|
|
+ let _unsave;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _id = reader.tgReadObject();
|
|
|
+ _unsave = reader.tgReadBool();
|
|
|
+ return new this({id:_id,
|
|
|
+ unsave:_unsave})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetInlineBotResultsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x514e999d;
|
|
|
+ static SUBCLASS_OF_ID = 0x3ed4d9c9;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.BotResults: Instance of BotResults
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x514e999d;
|
|
|
+ this.SUBCLASS_OF_ID = 0x3ed4d9c9;
|
|
|
+
|
|
|
+ this.bot = args.bot;
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.geoPoint = args.geoPoint || null;
|
|
|
+ this.query = args.query;
|
|
|
+ this.offset = args.offset;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.bot = utils.getInputUser(await client.getInputEntity(this.bot))
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("9d994e51","hex"),
|
|
|
+ struct.pack('<I', (this.geoPoint === undefined || this.geoPoint === false || this.geoPoint === null) ? 0 : 1),
|
|
|
+ this.bot.getBytes(),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ (this.geoPoint === undefined || this.geoPoint === false || this.geoPoint ===null) ? Buffer.alloc(0) : [this.geoPoint.getBytes()],
|
|
|
+ TLObject.serializeBytes(this.query),
|
|
|
+ TLObject.serializeBytes(this.offset),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _bot;
|
|
|
+ let _peer;
|
|
|
+ let _geo_point;
|
|
|
+ let _query;
|
|
|
+ let _offset;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _bot = reader.tgReadObject();
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ if (flags & 1) {
|
|
|
+ _geo_point = reader.tgReadObject();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _geo_point = null
|
|
|
+ }
|
|
|
+ _query = reader.tgReadString();
|
|
|
+ _offset = reader.tgReadString();
|
|
|
+ return new this({bot:_bot,
|
|
|
+ peer:_peer,
|
|
|
+ geoPoint:_geo_point,
|
|
|
+ query:_query,
|
|
|
+ offset:_offset})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class SetInlineBotResultsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xeb5ea206;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xeb5ea206;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.gallery = args.gallery || null;
|
|
|
+ this.private = args.private || null;
|
|
|
+ this.queryId = args.queryId;
|
|
|
+ this.results = args.results;
|
|
|
+ this.cacheTime = args.cacheTime;
|
|
|
+ this.nextOffset = args.nextOffset || null;
|
|
|
+ this.switchPm = args.switchPm || null;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("06a25eeb","hex"),
|
|
|
+ struct.pack('<I', (this.gallery === undefined || this.gallery === false || this.gallery === null) ? 0 : 1 | (this.private === undefined || this.private === false || this.private === null) ? 0 : 2 | (this.nextOffset === undefined || this.nextOffset === false || this.nextOffset === null) ? 0 : 4 | (this.switchPm === undefined || this.switchPm === false || this.switchPm === null) ? 0 : 8),
|
|
|
+ readBufferFromBigInt(this.queryId,8,true,true),
|
|
|
+ Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.results.length),Buffer.concat(this.results.map(x => x.getBytes())),
|
|
|
+ struct.pack('<i', this.cacheTime),
|
|
|
+ (this.nextOffset === undefined || this.nextOffset === false || this.nextOffset ===null) ? Buffer.alloc(0) : [TLObject.serializeBytes(this.nextOffset)],
|
|
|
+ (this.switchPm === undefined || this.switchPm === false || this.switchPm ===null) ? Buffer.alloc(0) : [this.switchPm.getBytes()],
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _gallery;
|
|
|
+ let _private;
|
|
|
+ let _query_id;
|
|
|
+ let _results;
|
|
|
+ let _cache_time;
|
|
|
+ let _next_offset;
|
|
|
+ let _switch_pm;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _gallery = Boolean(flags & 1);
|
|
|
+ _private = Boolean(flags & 2);
|
|
|
+ _query_id = reader.readLong();
|
|
|
+ reader.readInt();
|
|
|
+ _results = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.tgReadObject();
|
|
|
+ _results.push(_x);
|
|
|
+ }
|
|
|
+ _cache_time = reader.readInt();
|
|
|
+ if (flags & 4) {
|
|
|
+ _next_offset = reader.tgReadString();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _next_offset = null
|
|
|
+ }
|
|
|
+ if (flags & 8) {
|
|
|
+ _switch_pm = reader.tgReadObject();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _switch_pm = null
|
|
|
+ }
|
|
|
+ return new this({gallery:_gallery,
|
|
|
+ private:_private,
|
|
|
+ queryId:_query_id,
|
|
|
+ results:_results,
|
|
|
+ cacheTime:_cache_time,
|
|
|
+ nextOffset:_next_offset,
|
|
|
+ switchPm:_switch_pm})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class SendInlineBotResultRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x220815b0;
|
|
|
+ static SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x220815b0;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ this.silent = args.silent || null;
|
|
|
+ this.background = args.background || null;
|
|
|
+ this.clearDraft = args.clearDraft || null;
|
|
|
+ this.hideVia = args.hideVia || null;
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.replyToMsgId = args.replyToMsgId || null;
|
|
|
+ this.randomId = args.randomId !== undefined ? args.randomId : readBigIntFromBuffer(generateRandomBytes(8),false,true);
|
|
|
+ this.queryId = args.queryId;
|
|
|
+ this.id = args.id;
|
|
|
+ this.scheduleDate = args.scheduleDate || null;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("b0150822","hex"),
|
|
|
+ struct.pack('<I', (this.silent === undefined || this.silent === false || this.silent === null) ? 0 : 32 | (this.background === undefined || this.background === false || this.background === null) ? 0 : 64 | (this.clearDraft === undefined || this.clearDraft === false || this.clearDraft === null) ? 0 : 128 | (this.hideVia === undefined || this.hideVia === false || this.hideVia === null) ? 0 : 2048 | (this.replyToMsgId === undefined || this.replyToMsgId === false || this.replyToMsgId === null) ? 0 : 1 | (this.scheduleDate === undefined || this.scheduleDate === false || this.scheduleDate === null) ? 0 : 1024),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ (this.replyToMsgId === undefined || this.replyToMsgId === false || this.replyToMsgId ===null) ? Buffer.alloc(0) : [struct.pack('<i', this.replyToMsgId)],
|
|
|
+ readBufferFromBigInt(this.randomId,8,true,true),
|
|
|
+ readBufferFromBigInt(this.queryId,8,true,true),
|
|
|
+ TLObject.serializeBytes(this.id),
|
|
|
+ (this.scheduleDate === undefined || this.scheduleDate === false || this.scheduleDate ===null) ? Buffer.alloc(0) : [struct.pack('<i', this.scheduleDate)],
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _silent;
|
|
|
+ let _background;
|
|
|
+ let _clear_draft;
|
|
|
+ let _hide_via;
|
|
|
+ let _peer;
|
|
|
+ let _reply_to_msg_id;
|
|
|
+ let _random_id;
|
|
|
+ let _query_id;
|
|
|
+ let _id;
|
|
|
+ let _schedule_date;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _silent = Boolean(flags & 32);
|
|
|
+ _background = Boolean(flags & 64);
|
|
|
+ _clear_draft = Boolean(flags & 128);
|
|
|
+ _hide_via = Boolean(flags & 2048);
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ if (flags & 1) {
|
|
|
+ _reply_to_msg_id = reader.readInt();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _reply_to_msg_id = null
|
|
|
+ }
|
|
|
+ _random_id = reader.readLong();
|
|
|
+ _query_id = reader.readLong();
|
|
|
+ _id = reader.tgReadString();
|
|
|
+ if (flags & 1024) {
|
|
|
+ _schedule_date = reader.readInt();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _schedule_date = null
|
|
|
+ }
|
|
|
+ return new this({silent:_silent,
|
|
|
+ background:_background,
|
|
|
+ clearDraft:_clear_draft,
|
|
|
+ hideVia:_hide_via,
|
|
|
+ peer:_peer,
|
|
|
+ replyToMsgId:_reply_to_msg_id,
|
|
|
+ randomId:_random_id,
|
|
|
+ queryId:_query_id,
|
|
|
+ id:_id,
|
|
|
+ scheduleDate:_schedule_date})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetMessageEditDataRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xfda68d36;
|
|
|
+ static SUBCLASS_OF_ID = 0xfb47949d;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.MessageEditData: Instance of MessageEditData
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xfda68d36;
|
|
|
+ this.SUBCLASS_OF_ID = 0xfb47949d;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.id = args.id;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("368da6fd","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ struct.pack('<i', this.id),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _id = reader.readInt();
|
|
|
+ return new this({peer:_peer,
|
|
|
+ id:_id})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class EditMessageRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x48f71778;
|
|
|
+ static SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x48f71778;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ this.noWebpage = args.noWebpage || null;
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.id = args.id;
|
|
|
+ this.message = args.message || null;
|
|
|
+ this.media = args.media || null;
|
|
|
+ this.replyMarkup = args.replyMarkup || null;
|
|
|
+ this.entities = args.entities || null;
|
|
|
+ this.scheduleDate = args.scheduleDate || null;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ if (this.media) {
|
|
|
+ this.media = utils.getInputMedia(this.media)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("7817f748","hex"),
|
|
|
+ struct.pack('<I', (this.noWebpage === undefined || this.noWebpage === false || this.noWebpage === null) ? 0 : 2 | (this.message === undefined || this.message === false || this.message === null) ? 0 : 2048 | (this.media === undefined || this.media === false || this.media === null) ? 0 : 16384 | (this.replyMarkup === undefined || this.replyMarkup === false || this.replyMarkup === null) ? 0 : 4 | (this.entities === undefined || this.entities === false || this.entities === null) ? 0 : 8 | (this.scheduleDate === undefined || this.scheduleDate === false || this.scheduleDate === null) ? 0 : 32768),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ struct.pack('<i', this.id),
|
|
|
+ (this.message === undefined || this.message === false || this.message ===null) ? Buffer.alloc(0) : [TLObject.serializeBytes(this.message)],
|
|
|
+ (this.media === undefined || this.media === false || this.media ===null) ? Buffer.alloc(0) : [this.media.getBytes()],
|
|
|
+ (this.replyMarkup === undefined || this.replyMarkup === false || this.replyMarkup ===null) ? Buffer.alloc(0) : [this.replyMarkup.getBytes()],
|
|
|
+ (this.entities === undefined || this.entities === false || this.entities ===null) ? Buffer.alloc(0) :Buffer.concat([Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.entities.length),Buffer.concat(this.entities.map(x => x.getBytes()))]),
|
|
|
+ (this.scheduleDate === undefined || this.scheduleDate === false || this.scheduleDate ===null) ? Buffer.alloc(0) : [struct.pack('<i', this.scheduleDate)],
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _no_webpage;
|
|
|
+ let _peer;
|
|
|
+ let _id;
|
|
|
+ let _message;
|
|
|
+ let _media;
|
|
|
+ let _reply_markup;
|
|
|
+ let _entities;
|
|
|
+ let _schedule_date;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _no_webpage = Boolean(flags & 2);
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _id = reader.readInt();
|
|
|
+ if (flags & 2048) {
|
|
|
+ _message = reader.tgReadString();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _message = null
|
|
|
+ }
|
|
|
+ if (flags & 16384) {
|
|
|
+ _media = reader.tgReadObject();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _media = null
|
|
|
+ }
|
|
|
+ if (flags & 4) {
|
|
|
+ _reply_markup = reader.tgReadObject();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _reply_markup = null
|
|
|
+ }
|
|
|
+ if (flags & 8) {
|
|
|
+ reader.readInt();
|
|
|
+ _entities = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.tgReadObject();
|
|
|
+ _entities.push(_x);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _entities = null
|
|
|
+ }
|
|
|
+ if (flags & 32768) {
|
|
|
+ _schedule_date = reader.readInt();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _schedule_date = null
|
|
|
+ }
|
|
|
+ return new this({noWebpage:_no_webpage,
|
|
|
+ peer:_peer,
|
|
|
+ id:_id,
|
|
|
+ message:_message,
|
|
|
+ media:_media,
|
|
|
+ replyMarkup:_reply_markup,
|
|
|
+ entities:_entities,
|
|
|
+ scheduleDate:_schedule_date})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class EditInlineBotMessageRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x83557dba;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x83557dba;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.noWebpage = args.noWebpage || null;
|
|
|
+ this.id = args.id;
|
|
|
+ this.message = args.message || null;
|
|
|
+ this.media = args.media || null;
|
|
|
+ this.replyMarkup = args.replyMarkup || null;
|
|
|
+ this.entities = args.entities || null;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ if (this.media) {
|
|
|
+ this.media = utils.getInputMedia(this.media)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("ba7d5583","hex"),
|
|
|
+ struct.pack('<I', (this.noWebpage === undefined || this.noWebpage === false || this.noWebpage === null) ? 0 : 2 | (this.message === undefined || this.message === false || this.message === null) ? 0 : 2048 | (this.media === undefined || this.media === false || this.media === null) ? 0 : 16384 | (this.replyMarkup === undefined || this.replyMarkup === false || this.replyMarkup === null) ? 0 : 4 | (this.entities === undefined || this.entities === false || this.entities === null) ? 0 : 8),
|
|
|
+ this.id.getBytes(),
|
|
|
+ (this.message === undefined || this.message === false || this.message ===null) ? Buffer.alloc(0) : [TLObject.serializeBytes(this.message)],
|
|
|
+ (this.media === undefined || this.media === false || this.media ===null) ? Buffer.alloc(0) : [this.media.getBytes()],
|
|
|
+ (this.replyMarkup === undefined || this.replyMarkup === false || this.replyMarkup ===null) ? Buffer.alloc(0) : [this.replyMarkup.getBytes()],
|
|
|
+ (this.entities === undefined || this.entities === false || this.entities ===null) ? Buffer.alloc(0) :Buffer.concat([Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.entities.length),Buffer.concat(this.entities.map(x => x.getBytes()))]),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _no_webpage;
|
|
|
+ let _id;
|
|
|
+ let _message;
|
|
|
+ let _media;
|
|
|
+ let _reply_markup;
|
|
|
+ let _entities;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _no_webpage = Boolean(flags & 2);
|
|
|
+ _id = reader.tgReadObject();
|
|
|
+ if (flags & 2048) {
|
|
|
+ _message = reader.tgReadString();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _message = null
|
|
|
+ }
|
|
|
+ if (flags & 16384) {
|
|
|
+ _media = reader.tgReadObject();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _media = null
|
|
|
+ }
|
|
|
+ if (flags & 4) {
|
|
|
+ _reply_markup = reader.tgReadObject();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _reply_markup = null
|
|
|
+ }
|
|
|
+ if (flags & 8) {
|
|
|
+ reader.readInt();
|
|
|
+ _entities = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.tgReadObject();
|
|
|
+ _entities.push(_x);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _entities = null
|
|
|
+ }
|
|
|
+ return new this({noWebpage:_no_webpage,
|
|
|
+ id:_id,
|
|
|
+ message:_message,
|
|
|
+ media:_media,
|
|
|
+ replyMarkup:_reply_markup,
|
|
|
+ entities:_entities})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class GetBotCallbackAnswerRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x810a9fec;
|
|
|
+ static SUBCLASS_OF_ID = 0x6c4dd18c;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.BotCallbackAnswer: Instance of BotCallbackAnswer
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x810a9fec;
|
|
|
+ this.SUBCLASS_OF_ID = 0x6c4dd18c;
|
|
|
+
|
|
|
+ this.game = args.game || null;
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.msgId = args.msgId;
|
|
|
+ this.data = args.data || null;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("ec9f0a81","hex"),
|
|
|
+ struct.pack('<I', (this.game === undefined || this.game === false || this.game === null) ? 0 : 2 | (this.data === undefined || this.data === false || this.data === null) ? 0 : 1),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ struct.pack('<i', this.msgId),
|
|
|
+ (this.data === undefined || this.data === false || this.data ===null) ? Buffer.alloc(0) : [TLObject.serializeBytes(this.data)],
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _game;
|
|
|
+ let _peer;
|
|
|
+ let _msg_id;
|
|
|
+ let _data;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _game = Boolean(flags & 2);
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _msg_id = reader.readInt();
|
|
|
+ if (flags & 1) {
|
|
|
+ _data = reader.tgReadBytes();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _data = null
|
|
|
+ }
|
|
|
+ return new this({game:_game,
|
|
|
+ peer:_peer,
|
|
|
+ msgId:_msg_id,
|
|
|
+ data:_data})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class SetBotCallbackAnswerRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xd58f130a;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xd58f130a;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.alert = args.alert || null;
|
|
|
+ this.queryId = args.queryId;
|
|
|
+ this.message = args.message || null;
|
|
|
+ this.url = args.url || null;
|
|
|
+ this.cacheTime = args.cacheTime;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("0a138fd5","hex"),
|
|
|
+ struct.pack('<I', (this.alert === undefined || this.alert === false || this.alert === null) ? 0 : 2 | (this.message === undefined || this.message === false || this.message === null) ? 0 : 1 | (this.url === undefined || this.url === false || this.url === null) ? 0 : 4),
|
|
|
+ readBufferFromBigInt(this.queryId,8,true,true),
|
|
|
+ (this.message === undefined || this.message === false || this.message ===null) ? Buffer.alloc(0) : [TLObject.serializeBytes(this.message)],
|
|
|
+ (this.url === undefined || this.url === false || this.url ===null) ? Buffer.alloc(0) : [TLObject.serializeBytes(this.url)],
|
|
|
+ struct.pack('<i', this.cacheTime),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _alert;
|
|
|
+ let _query_id;
|
|
|
+ let _message;
|
|
|
+ let _url;
|
|
|
+ let _cache_time;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _alert = Boolean(flags & 2);
|
|
|
+ _query_id = reader.readLong();
|
|
|
+ if (flags & 1) {
|
|
|
+ _message = reader.tgReadString();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _message = null
|
|
|
+ }
|
|
|
+ if (flags & 4) {
|
|
|
+ _url = reader.tgReadString();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _url = null
|
|
|
+ }
|
|
|
+ _cache_time = reader.readInt();
|
|
|
+ return new this({alert:_alert,
|
|
|
+ queryId:_query_id,
|
|
|
+ message:_message,
|
|
|
+ url:_url,
|
|
|
+ cacheTime:_cache_time})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetPeerDialogsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xe470bcfd;
|
|
|
+ static SUBCLASS_OF_ID = 0x3ac70132;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.PeerDialogs: Instance of PeerDialogs
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xe470bcfd;
|
|
|
+ this.SUBCLASS_OF_ID = 0x3ac70132;
|
|
|
+
|
|
|
+ this.peers = args.peers;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ const _tmp = [];for (const _x of this.peers) {
|
|
|
+ _tmp.push(await client._getInputDialog(_x));
|
|
|
+ }
|
|
|
+ this.peers = _tmp;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("fdbc70e4","hex"),
|
|
|
+ Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.peers.length),Buffer.concat(this.peers.map(x => x.getBytes())),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peers;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ reader.readInt();
|
|
|
+ _peers = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.tgReadObject();
|
|
|
+ _peers.push(_x);
|
|
|
+ }
|
|
|
+ return new this({peers:_peers})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class SaveDraftRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xbc39e14b;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xbc39e14b;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.noWebpage = args.noWebpage || null;
|
|
|
+ this.replyToMsgId = args.replyToMsgId || null;
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.message = args.message;
|
|
|
+ this.entities = args.entities || null;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("4be139bc","hex"),
|
|
|
+ struct.pack('<I', (this.noWebpage === undefined || this.noWebpage === false || this.noWebpage === null) ? 0 : 2 | (this.replyToMsgId === undefined || this.replyToMsgId === false || this.replyToMsgId === null) ? 0 : 1 | (this.entities === undefined || this.entities === false || this.entities === null) ? 0 : 8),
|
|
|
+ (this.replyToMsgId === undefined || this.replyToMsgId === false || this.replyToMsgId ===null) ? Buffer.alloc(0) : [struct.pack('<i', this.replyToMsgId)],
|
|
|
+ this.peer.getBytes(),
|
|
|
+ TLObject.serializeBytes(this.message),
|
|
|
+ (this.entities === undefined || this.entities === false || this.entities ===null) ? Buffer.alloc(0) :Buffer.concat([Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.entities.length),Buffer.concat(this.entities.map(x => x.getBytes()))]),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _no_webpage;
|
|
|
+ let _reply_to_msg_id;
|
|
|
+ let _peer;
|
|
|
+ let _message;
|
|
|
+ let _entities;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _no_webpage = Boolean(flags & 2);
|
|
|
+ if (flags & 1) {
|
|
|
+ _reply_to_msg_id = reader.readInt();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _reply_to_msg_id = null
|
|
|
+ }
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _message = reader.tgReadString();
|
|
|
+ if (flags & 8) {
|
|
|
+ reader.readInt();
|
|
|
+ _entities = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.tgReadObject();
|
|
|
+ _entities.push(_x);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _entities = null
|
|
|
+ }
|
|
|
+ return new this({noWebpage:_no_webpage,
|
|
|
+ replyToMsgId:_reply_to_msg_id,
|
|
|
+ peer:_peer,
|
|
|
+ message:_message,
|
|
|
+ entities:_entities})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class GetAllDraftsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x6a3f8d65;
|
|
|
+ static SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ constructor() {
|
|
|
+ super();
|
|
|
+ this.CONSTRUCTOR_ID = 0x6a3f8d65;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("658d3f6a","hex"),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ return new this({})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetFeaturedStickersRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x2dacca4f;
|
|
|
+ static SUBCLASS_OF_ID = 0x2614b722;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.FeaturedStickers: Instance of either FeaturedStickersNotModified, FeaturedStickers
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x2dacca4f;
|
|
|
+ this.SUBCLASS_OF_ID = 0x2614b722;
|
|
|
+
|
|
|
+ this.hash = args.hash;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("4fcaac2d","hex"),
|
|
|
+ struct.pack('<i', this.hash),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _hash;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _hash = reader.readInt();
|
|
|
+ return new this({hash:_hash})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class ReadFeaturedStickersRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x5b118126;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x5b118126;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.id = args.id;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("2681115b","hex"),
|
|
|
+ Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.id.length),Buffer.concat(this.id.map(x => readBufferFromBigInt(x,8,true,true))),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ reader.readInt();
|
|
|
+ _id = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.readLong();
|
|
|
+ _id.push(_x);
|
|
|
+ }
|
|
|
+ return new this({id:_id})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class GetRecentStickersRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x5ea192c9;
|
|
|
+ static SUBCLASS_OF_ID = 0xf76f8683;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.RecentStickers: Instance of either RecentStickersNotModified, RecentStickers
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x5ea192c9;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf76f8683;
|
|
|
+
|
|
|
+ this.attached = args.attached || null;
|
|
|
+ this.hash = args.hash;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("c992a15e","hex"),
|
|
|
+ struct.pack('<I', (this.attached === undefined || this.attached === false || this.attached === null) ? 0 : 1),
|
|
|
+ struct.pack('<i', this.hash),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _attached;
|
|
|
+ let _hash;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _attached = Boolean(flags & 1);
|
|
|
+ _hash = reader.readInt();
|
|
|
+ return new this({attached:_attached,
|
|
|
+ hash:_hash})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class SaveRecentStickerRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x392718f8;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x392718f8;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.attached = args.attached || null;
|
|
|
+ this.id = args.id;
|
|
|
+ this.unsave = args.unsave;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.id = utils.getInputDocument(this.id)
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("f8182739","hex"),
|
|
|
+ struct.pack('<I', (this.attached === undefined || this.attached === false || this.attached === null) ? 0 : 1),
|
|
|
+ this.id.getBytes(),
|
|
|
+ this.unsave ? 0xb5757299 : 0x379779bc,
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _attached;
|
|
|
+ let _id;
|
|
|
+ let _unsave;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _attached = Boolean(flags & 1);
|
|
|
+ _id = reader.tgReadObject();
|
|
|
+ _unsave = reader.tgReadBool();
|
|
|
+ return new this({attached:_attached,
|
|
|
+ id:_id,
|
|
|
+ unsave:_unsave})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class ClearRecentStickersRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x8999602d;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x8999602d;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.attached = args.attached || null;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("2d609989","hex"),
|
|
|
+ struct.pack('<I', (this.attached === undefined || this.attached === false || this.attached === null) ? 0 : 1),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _attached;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _attached = Boolean(flags & 1);
|
|
|
+ return new this({attached:_attached})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetArchivedStickersRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x57f17692;
|
|
|
+ static SUBCLASS_OF_ID = 0x7296d771;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.ArchivedStickers: Instance of ArchivedStickers
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x57f17692;
|
|
|
+ this.SUBCLASS_OF_ID = 0x7296d771;
|
|
|
+
|
|
|
+ this.masks = args.masks || null;
|
|
|
+ this.offsetId = args.offsetId;
|
|
|
+ this.limit = args.limit;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("9276f157","hex"),
|
|
|
+ struct.pack('<I', (this.masks === undefined || this.masks === false || this.masks === null) ? 0 : 1),
|
|
|
+ readBufferFromBigInt(this.offsetId,8,true,true),
|
|
|
+ struct.pack('<i', this.limit),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _masks;
|
|
|
+ let _offset_id;
|
|
|
+ let _limit;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _masks = Boolean(flags & 1);
|
|
|
+ _offset_id = reader.readLong();
|
|
|
+ _limit = reader.readInt();
|
|
|
+ return new this({masks:_masks,
|
|
|
+ offsetId:_offset_id,
|
|
|
+ limit:_limit})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetMaskStickersRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x65b8c79f;
|
|
|
+ static SUBCLASS_OF_ID = 0x45834829;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.AllStickers: Instance of either AllStickersNotModified, AllStickers
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x65b8c79f;
|
|
|
+ this.SUBCLASS_OF_ID = 0x45834829;
|
|
|
+
|
|
|
+ this.hash = args.hash;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("9fc7b865","hex"),
|
|
|
+ struct.pack('<i', this.hash),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _hash;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _hash = reader.readInt();
|
|
|
+ return new this({hash:_hash})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetAttachedStickersRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xcc5b67cc;
|
|
|
+ static SUBCLASS_OF_ID = 0xcc125f6b;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Vector<StickerSetCovered>: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xcc5b67cc;
|
|
|
+ this.SUBCLASS_OF_ID = 0xcc125f6b;
|
|
|
+
|
|
|
+ this.media = args.media;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("cc675bcc","hex"),
|
|
|
+ this.media.getBytes(),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _media;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _media = reader.tgReadObject();
|
|
|
+ return new this({media:_media})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class SetGameScoreRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x8ef8ecc0;
|
|
|
+ static SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x8ef8ecc0;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ this.editMessage = args.editMessage || null;
|
|
|
+ this.force = args.force || null;
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.id = args.id;
|
|
|
+ this.userId = args.userId;
|
|
|
+ this.score = args.score;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ this.user_id = utils.getInputUser(await client.getInputEntity(this.userId))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("c0ecf88e","hex"),
|
|
|
+ struct.pack('<I', (this.editMessage === undefined || this.editMessage === false || this.editMessage === null) ? 0 : 1 | (this.force === undefined || this.force === false || this.force === null) ? 0 : 2),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ struct.pack('<i', this.id),
|
|
|
+ this.userId.getBytes(),
|
|
|
+ struct.pack('<i', this.score),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _edit_message;
|
|
|
+ let _force;
|
|
|
+ let _peer;
|
|
|
+ let _id;
|
|
|
+ let _user_id;
|
|
|
+ let _score;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _edit_message = Boolean(flags & 1);
|
|
|
+ _force = Boolean(flags & 2);
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _id = reader.readInt();
|
|
|
+ _user_id = reader.tgReadObject();
|
|
|
+ _score = reader.readInt();
|
|
|
+ return new this({editMessage:_edit_message,
|
|
|
+ force:_force,
|
|
|
+ peer:_peer,
|
|
|
+ id:_id,
|
|
|
+ userId:_user_id,
|
|
|
+ score:_score})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class SetInlineGameScoreRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x15ad9f64;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x15ad9f64;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.editMessage = args.editMessage || null;
|
|
|
+ this.force = args.force || null;
|
|
|
+ this.id = args.id;
|
|
|
+ this.userId = args.userId;
|
|
|
+ this.score = args.score;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.user_id = utils.getInputUser(await client.getInputEntity(this.userId))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("649fad15","hex"),
|
|
|
+ struct.pack('<I', (this.editMessage === undefined || this.editMessage === false || this.editMessage === null) ? 0 : 1 | (this.force === undefined || this.force === false || this.force === null) ? 0 : 2),
|
|
|
+ this.id.getBytes(),
|
|
|
+ this.userId.getBytes(),
|
|
|
+ struct.pack('<i', this.score),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _edit_message;
|
|
|
+ let _force;
|
|
|
+ let _id;
|
|
|
+ let _user_id;
|
|
|
+ let _score;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _edit_message = Boolean(flags & 1);
|
|
|
+ _force = Boolean(flags & 2);
|
|
|
+ _id = reader.tgReadObject();
|
|
|
+ _user_id = reader.tgReadObject();
|
|
|
+ _score = reader.readInt();
|
|
|
+ return new this({editMessage:_edit_message,
|
|
|
+ force:_force,
|
|
|
+ id:_id,
|
|
|
+ userId:_user_id,
|
|
|
+ score:_score})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetGameHighScoresRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xe822649d;
|
|
|
+ static SUBCLASS_OF_ID = 0x6ccd95fd;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.HighScores: Instance of HighScores
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xe822649d;
|
|
|
+ this.SUBCLASS_OF_ID = 0x6ccd95fd;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.id = args.id;
|
|
|
+ this.userId = args.userId;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ this.user_id = utils.getInputUser(await client.getInputEntity(this.userId))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("9d6422e8","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ struct.pack('<i', this.id),
|
|
|
+ this.userId.getBytes(),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _id;
|
|
|
+ let _user_id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _id = reader.readInt();
|
|
|
+ _user_id = reader.tgReadObject();
|
|
|
+ return new this({peer:_peer,
|
|
|
+ id:_id,
|
|
|
+ userId:_user_id})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetInlineGameHighScoresRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x0f635e1b;
|
|
|
+ static SUBCLASS_OF_ID = 0x6ccd95fd;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.HighScores: Instance of HighScores
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x0f635e1b;
|
|
|
+ this.SUBCLASS_OF_ID = 0x6ccd95fd;
|
|
|
+
|
|
|
+ this.id = args.id;
|
|
|
+ this.userId = args.userId;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.user_id = utils.getInputUser(await client.getInputEntity(this.userId))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("1b5e630f","hex"),
|
|
|
+ this.id.getBytes(),
|
|
|
+ this.userId.getBytes(),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _id;
|
|
|
+ let _user_id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _id = reader.tgReadObject();
|
|
|
+ _user_id = reader.tgReadObject();
|
|
|
+ return new this({id:_id,
|
|
|
+ userId:_user_id})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetCommonChatsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x0d0a48c4;
|
|
|
+ static SUBCLASS_OF_ID = 0x99d5cb14;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.Chats: Instance of either Chats, ChatsSlice
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x0d0a48c4;
|
|
|
+ this.SUBCLASS_OF_ID = 0x99d5cb14;
|
|
|
+
|
|
|
+ this.userId = args.userId;
|
|
|
+ this.maxId = args.maxId;
|
|
|
+ this.limit = args.limit;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.user_id = utils.getInputUser(await client.getInputEntity(this.userId))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("c4480a0d","hex"),
|
|
|
+ this.userId.getBytes(),
|
|
|
+ struct.pack('<i', this.maxId),
|
|
|
+ struct.pack('<i', this.limit),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _user_id;
|
|
|
+ let _max_id;
|
|
|
+ let _limit;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _user_id = reader.tgReadObject();
|
|
|
+ _max_id = reader.readInt();
|
|
|
+ _limit = reader.readInt();
|
|
|
+ return new this({userId:_user_id,
|
|
|
+ maxId:_max_id,
|
|
|
+ limit:_limit})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetAllChatsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xeba80ff0;
|
|
|
+ static SUBCLASS_OF_ID = 0x99d5cb14;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.Chats: Instance of either Chats, ChatsSlice
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xeba80ff0;
|
|
|
+ this.SUBCLASS_OF_ID = 0x99d5cb14;
|
|
|
+
|
|
|
+ this.exceptIds = args.exceptIds;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("f00fa8eb","hex"),
|
|
|
+ Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.exceptIds.length),Buffer.concat(this.exceptIds.map(x => struct.pack('<i', x))),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _except_ids;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ reader.readInt();
|
|
|
+ _except_ids = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.readInt();
|
|
|
+ _except_ids.push(_x);
|
|
|
+ }
|
|
|
+ return new this({exceptIds:_except_ids})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class GetWebPageRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x32ca8f91;
|
|
|
+ static SUBCLASS_OF_ID = 0x55a97481;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns WebPage: Instance of either WebPageEmpty, WebPagePending, WebPage, WebPageNotModified
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x32ca8f91;
|
|
|
+ this.SUBCLASS_OF_ID = 0x55a97481;
|
|
|
+
|
|
|
+ this.url = args.url;
|
|
|
+ this.hash = args.hash;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("918fca32","hex"),
|
|
|
+ TLObject.serializeBytes(this.url),
|
|
|
+ struct.pack('<i', this.hash),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _url;
|
|
|
+ let _hash;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _url = reader.tgReadString();
|
|
|
+ _hash = reader.readInt();
|
|
|
+ return new this({url:_url,
|
|
|
+ hash:_hash})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class ToggleDialogPinRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xa731e257;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xa731e257;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.pinned = args.pinned || null;
|
|
|
+ this.peer = args.peer;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = await client._getInputDialog(this.peer)
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("57e231a7","hex"),
|
|
|
+ struct.pack('<I', (this.pinned === undefined || this.pinned === false || this.pinned === null) ? 0 : 1),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _pinned;
|
|
|
+ let _peer;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _pinned = Boolean(flags & 1);
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ return new this({pinned:_pinned,
|
|
|
+ peer:_peer})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class ReorderPinnedDialogsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x3b1adf37;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x3b1adf37;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.force = args.force || null;
|
|
|
+ this.folderId = args.folderId;
|
|
|
+ this.order = args.order;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ const _tmp = [];for (const _x of this.order) {
|
|
|
+ _tmp.push(await client._getInputDialog(_x));
|
|
|
+ }
|
|
|
+ this.order = _tmp;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("37df1a3b","hex"),
|
|
|
+ struct.pack('<I', (this.force === undefined || this.force === false || this.force === null) ? 0 : 1),
|
|
|
+ struct.pack('<i', this.folderId),
|
|
|
+ Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.order.length),Buffer.concat(this.order.map(x => x.getBytes())),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _force;
|
|
|
+ let _folder_id;
|
|
|
+ let _order;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _force = Boolean(flags & 1);
|
|
|
+ _folder_id = reader.readInt();
|
|
|
+ reader.readInt();
|
|
|
+ _order = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.tgReadObject();
|
|
|
+ _order.push(_x);
|
|
|
+ }
|
|
|
+ return new this({force:_force,
|
|
|
+ folderId:_folder_id,
|
|
|
+ order:_order})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class GetPinnedDialogsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xd6b94df2;
|
|
|
+ static SUBCLASS_OF_ID = 0x3ac70132;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.PeerDialogs: Instance of PeerDialogs
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xd6b94df2;
|
|
|
+ this.SUBCLASS_OF_ID = 0x3ac70132;
|
|
|
+
|
|
|
+ this.folderId = args.folderId;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("f24db9d6","hex"),
|
|
|
+ struct.pack('<i', this.folderId),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _folder_id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _folder_id = reader.readInt();
|
|
|
+ return new this({folderId:_folder_id})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class SetBotShippingResultsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xe5f672fa;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xe5f672fa;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.queryId = args.queryId;
|
|
|
+ this.error = args.error || null;
|
|
|
+ this.shippingOptions = args.shippingOptions || null;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("fa72f6e5","hex"),
|
|
|
+ struct.pack('<I', (this.error === undefined || this.error === false || this.error === null) ? 0 : 1 | (this.shippingOptions === undefined || this.shippingOptions === false || this.shippingOptions === null) ? 0 : 2),
|
|
|
+ readBufferFromBigInt(this.queryId,8,true,true),
|
|
|
+ (this.error === undefined || this.error === false || this.error ===null) ? Buffer.alloc(0) : [TLObject.serializeBytes(this.error)],
|
|
|
+ (this.shippingOptions === undefined || this.shippingOptions === false || this.shippingOptions ===null) ? Buffer.alloc(0) :Buffer.concat([Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.shippingOptions.length),Buffer.concat(this.shippingOptions.map(x => x.getBytes()))]),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _query_id;
|
|
|
+ let _error;
|
|
|
+ let _shipping_options;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _query_id = reader.readLong();
|
|
|
+ if (flags & 1) {
|
|
|
+ _error = reader.tgReadString();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _error = null
|
|
|
+ }
|
|
|
+ if (flags & 2) {
|
|
|
+ reader.readInt();
|
|
|
+ _shipping_options = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.tgReadObject();
|
|
|
+ _shipping_options.push(_x);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _shipping_options = null
|
|
|
+ }
|
|
|
+ return new this({queryId:_query_id,
|
|
|
+ error:_error,
|
|
|
+ shippingOptions:_shipping_options})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class SetBotPrecheckoutResultsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x09c2dd95;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x09c2dd95;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.success = args.success || null;
|
|
|
+ this.queryId = args.queryId;
|
|
|
+ this.error = args.error || null;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("95ddc209","hex"),
|
|
|
+ struct.pack('<I', (this.success === undefined || this.success === false || this.success === null) ? 0 : 2 | (this.error === undefined || this.error === false || this.error === null) ? 0 : 1),
|
|
|
+ readBufferFromBigInt(this.queryId,8,true,true),
|
|
|
+ (this.error === undefined || this.error === false || this.error ===null) ? Buffer.alloc(0) : [TLObject.serializeBytes(this.error)],
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _success;
|
|
|
+ let _query_id;
|
|
|
+ let _error;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _success = Boolean(flags & 2);
|
|
|
+ _query_id = reader.readLong();
|
|
|
+ if (flags & 1) {
|
|
|
+ _error = reader.tgReadString();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _error = null
|
|
|
+ }
|
|
|
+ return new this({success:_success,
|
|
|
+ queryId:_query_id,
|
|
|
+ error:_error})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class UploadMediaRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x519bc2b1;
|
|
|
+ static SUBCLASS_OF_ID = 0x476cbe32;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns MessageMedia: Instance of either MessageMediaEmpty, MessageMediaPhoto, MessageMediaGeo, MessageMediaContact, MessageMediaUnsupported, MessageMediaDocument, MessageMediaWebPage, MessageMediaVenue, MessageMediaGame, MessageMediaInvoice, MessageMediaGeoLive, MessageMediaPoll
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x519bc2b1;
|
|
|
+ this.SUBCLASS_OF_ID = 0x476cbe32;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.media = args.media;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ this.media = utils.getInputMedia(this.media)
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("b1c29b51","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ this.media.getBytes(),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _media;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _media = reader.tgReadObject();
|
|
|
+ return new this({peer:_peer,
|
|
|
+ media:_media})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class SendScreenshotNotificationRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xc97df020;
|
|
|
+ static SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xc97df020;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.replyToMsgId = args.replyToMsgId;
|
|
|
+ this.randomId = args.randomId !== undefined ? args.randomId : readBigIntFromBuffer(generateRandomBytes(8),false,true);
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("20f07dc9","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ struct.pack('<i', this.replyToMsgId),
|
|
|
+ readBufferFromBigInt(this.randomId,8,true,true),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _reply_to_msg_id;
|
|
|
+ let _random_id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _reply_to_msg_id = reader.readInt();
|
|
|
+ _random_id = reader.readLong();
|
|
|
+ return new this({peer:_peer,
|
|
|
+ replyToMsgId:_reply_to_msg_id,
|
|
|
+ randomId:_random_id})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetFavedStickersRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x21ce0b0e;
|
|
|
+ static SUBCLASS_OF_ID = 0x8e736fb9;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.FavedStickers: Instance of either FavedStickersNotModified, FavedStickers
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x21ce0b0e;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8e736fb9;
|
|
|
+
|
|
|
+ this.hash = args.hash;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("0e0bce21","hex"),
|
|
|
+ struct.pack('<i', this.hash),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _hash;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _hash = reader.readInt();
|
|
|
+ return new this({hash:_hash})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class FaveStickerRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xb9ffc55b;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xb9ffc55b;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.id = args.id;
|
|
|
+ this.unfave = args.unfave;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.id = utils.getInputDocument(this.id)
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("5bc5ffb9","hex"),
|
|
|
+ this.id.getBytes(),
|
|
|
+ this.unfave ? 0xb5757299 : 0x379779bc,
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _id;
|
|
|
+ let _unfave;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _id = reader.tgReadObject();
|
|
|
+ _unfave = reader.tgReadBool();
|
|
|
+ return new this({id:_id,
|
|
|
+ unfave:_unfave})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetUnreadMentionsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x46578472;
|
|
|
+ static SUBCLASS_OF_ID = 0xd4b40b5e;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.Messages: Instance of either Messages, MessagesSlice, ChannelMessages, MessagesNotModified
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x46578472;
|
|
|
+ this.SUBCLASS_OF_ID = 0xd4b40b5e;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.offsetId = args.offsetId;
|
|
|
+ this.addOffset = args.addOffset;
|
|
|
+ this.limit = args.limit;
|
|
|
+ this.maxId = args.maxId;
|
|
|
+ this.minId = args.minId;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("72845746","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ struct.pack('<i', this.offsetId),
|
|
|
+ struct.pack('<i', this.addOffset),
|
|
|
+ struct.pack('<i', this.limit),
|
|
|
+ struct.pack('<i', this.maxId),
|
|
|
+ struct.pack('<i', this.minId),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _offset_id;
|
|
|
+ let _add_offset;
|
|
|
+ let _limit;
|
|
|
+ let _max_id;
|
|
|
+ let _min_id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _offset_id = reader.readInt();
|
|
|
+ _add_offset = reader.readInt();
|
|
|
+ _limit = reader.readInt();
|
|
|
+ _max_id = reader.readInt();
|
|
|
+ _min_id = reader.readInt();
|
|
|
+ return new this({peer:_peer,
|
|
|
+ offsetId:_offset_id,
|
|
|
+ addOffset:_add_offset,
|
|
|
+ limit:_limit,
|
|
|
+ maxId:_max_id,
|
|
|
+ minId:_min_id})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class ReadMentionsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x0f0189d3;
|
|
|
+ static SUBCLASS_OF_ID = 0x2c49c116;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.AffectedHistory: Instance of AffectedHistory
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x0f0189d3;
|
|
|
+ this.SUBCLASS_OF_ID = 0x2c49c116;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("d389010f","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ return new this({peer:_peer})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetRecentLocationsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xbbc45b09;
|
|
|
+ static SUBCLASS_OF_ID = 0xd4b40b5e;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.Messages: Instance of either Messages, MessagesSlice, ChannelMessages, MessagesNotModified
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xbbc45b09;
|
|
|
+ this.SUBCLASS_OF_ID = 0xd4b40b5e;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.limit = args.limit;
|
|
|
+ this.hash = args.hash;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("095bc4bb","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ struct.pack('<i', this.limit),
|
|
|
+ struct.pack('<i', this.hash),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _limit;
|
|
|
+ let _hash;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _limit = reader.readInt();
|
|
|
+ _hash = reader.readInt();
|
|
|
+ return new this({peer:_peer,
|
|
|
+ limit:_limit,
|
|
|
+ hash:_hash})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class SendMultiMediaRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xcc0110cb;
|
|
|
+ static SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xcc0110cb;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ this.silent = args.silent || null;
|
|
|
+ this.background = args.background || null;
|
|
|
+ this.clearDraft = args.clearDraft || null;
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.replyToMsgId = args.replyToMsgId || null;
|
|
|
+ this.multiMedia = args.multiMedia;
|
|
|
+ this.scheduleDate = args.scheduleDate || null;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("cb1001cc","hex"),
|
|
|
+ struct.pack('<I', (this.silent === undefined || this.silent === false || this.silent === null) ? 0 : 32 | (this.background === undefined || this.background === false || this.background === null) ? 0 : 64 | (this.clearDraft === undefined || this.clearDraft === false || this.clearDraft === null) ? 0 : 128 | (this.replyToMsgId === undefined || this.replyToMsgId === false || this.replyToMsgId === null) ? 0 : 1 | (this.scheduleDate === undefined || this.scheduleDate === false || this.scheduleDate === null) ? 0 : 1024),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ (this.replyToMsgId === undefined || this.replyToMsgId === false || this.replyToMsgId ===null) ? Buffer.alloc(0) : [struct.pack('<i', this.replyToMsgId)],
|
|
|
+ Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.multiMedia.length),Buffer.concat(this.multiMedia.map(x => x.getBytes())),
|
|
|
+ (this.scheduleDate === undefined || this.scheduleDate === false || this.scheduleDate ===null) ? Buffer.alloc(0) : [struct.pack('<i', this.scheduleDate)],
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _silent;
|
|
|
+ let _background;
|
|
|
+ let _clear_draft;
|
|
|
+ let _peer;
|
|
|
+ let _reply_to_msg_id;
|
|
|
+ let _multi_media;
|
|
|
+ let _schedule_date;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _silent = Boolean(flags & 32);
|
|
|
+ _background = Boolean(flags & 64);
|
|
|
+ _clear_draft = Boolean(flags & 128);
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ if (flags & 1) {
|
|
|
+ _reply_to_msg_id = reader.readInt();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _reply_to_msg_id = null
|
|
|
+ }
|
|
|
+ reader.readInt();
|
|
|
+ _multi_media = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.tgReadObject();
|
|
|
+ _multi_media.push(_x);
|
|
|
+ }
|
|
|
+ if (flags & 1024) {
|
|
|
+ _schedule_date = reader.readInt();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _schedule_date = null
|
|
|
+ }
|
|
|
+ return new this({silent:_silent,
|
|
|
+ background:_background,
|
|
|
+ clearDraft:_clear_draft,
|
|
|
+ peer:_peer,
|
|
|
+ replyToMsgId:_reply_to_msg_id,
|
|
|
+ multiMedia:_multi_media,
|
|
|
+ scheduleDate:_schedule_date})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class UploadEncryptedFileRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x5057c497;
|
|
|
+ static SUBCLASS_OF_ID = 0x842a67c0;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns EncryptedFile: Instance of either EncryptedFileEmpty, EncryptedFile
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x5057c497;
|
|
|
+ this.SUBCLASS_OF_ID = 0x842a67c0;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.file = args.file;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("97c45750","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ this.file.getBytes(),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _file;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _file = reader.tgReadObject();
|
|
|
+ return new this({peer:_peer,
|
|
|
+ file:_file})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class SearchStickerSetsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xc2b7d08b;
|
|
|
+ static SUBCLASS_OF_ID = 0x40df361;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.FoundStickerSets: Instance of either FoundStickerSetsNotModified, FoundStickerSets
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xc2b7d08b;
|
|
|
+ this.SUBCLASS_OF_ID = 0x40df361;
|
|
|
+
|
|
|
+ this.excludeFeatured = args.excludeFeatured || null;
|
|
|
+ this.q = args.q;
|
|
|
+ this.hash = args.hash;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("8bd0b7c2","hex"),
|
|
|
+ struct.pack('<I', (this.excludeFeatured === undefined || this.excludeFeatured === false || this.excludeFeatured === null) ? 0 : 1),
|
|
|
+ TLObject.serializeBytes(this.q),
|
|
|
+ struct.pack('<i', this.hash),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _exclude_featured;
|
|
|
+ let _q;
|
|
|
+ let _hash;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _exclude_featured = Boolean(flags & 1);
|
|
|
+ _q = reader.tgReadString();
|
|
|
+ _hash = reader.readInt();
|
|
|
+ return new this({excludeFeatured:_exclude_featured,
|
|
|
+ q:_q,
|
|
|
+ hash:_hash})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetSplitRangesRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x1cff7e08;
|
|
|
+ static SUBCLASS_OF_ID = 0x5ba52504;
|
|
|
+
|
|
|
+ constructor() {
|
|
|
+ super();
|
|
|
+ this.CONSTRUCTOR_ID = 0x1cff7e08;
|
|
|
+ this.SUBCLASS_OF_ID = 0x5ba52504;
|
|
|
+
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("087eff1c","hex"),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ return new this({})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class MarkDialogUnreadRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xc286d98f;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xc286d98f;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.unread = args.unread || null;
|
|
|
+ this.peer = args.peer;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = await client._getInputDialog(this.peer)
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("8fd986c2","hex"),
|
|
|
+ struct.pack('<I', (this.unread === undefined || this.unread === false || this.unread === null) ? 0 : 1),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _unread;
|
|
|
+ let _peer;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _unread = Boolean(flags & 1);
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ return new this({unread:_unread,
|
|
|
+ peer:_peer})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetDialogUnreadMarksRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x22e24e22;
|
|
|
+ static SUBCLASS_OF_ID = 0xbec64ad9;
|
|
|
+
|
|
|
+ constructor() {
|
|
|
+ super();
|
|
|
+ this.CONSTRUCTOR_ID = 0x22e24e22;
|
|
|
+ this.SUBCLASS_OF_ID = 0xbec64ad9;
|
|
|
+
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("224ee222","hex"),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ return new this({})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class ClearAllDraftsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x7e58ee9c;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ constructor() {
|
|
|
+ super();
|
|
|
+ this.CONSTRUCTOR_ID = 0x7e58ee9c;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("9cee587e","hex"),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ return new this({})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class UpdatePinnedMessageRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xd2aaf7ec;
|
|
|
+ static SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xd2aaf7ec;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ this.silent = args.silent || null;
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.id = args.id;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("ecf7aad2","hex"),
|
|
|
+ struct.pack('<I', (this.silent === undefined || this.silent === false || this.silent === null) ? 0 : 1),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ struct.pack('<i', this.id),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _silent;
|
|
|
+ let _peer;
|
|
|
+ let _id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _silent = Boolean(flags & 1);
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _id = reader.readInt();
|
|
|
+ return new this({silent:_silent,
|
|
|
+ peer:_peer,
|
|
|
+ id:_id})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class SendVoteRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x10ea6184;
|
|
|
+ static SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x10ea6184;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.msgId = args.msgId;
|
|
|
+ this.options = args.options;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("8461ea10","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ struct.pack('<i', this.msgId),
|
|
|
+ Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.options.length),Buffer.concat(this.options.map(x => TLObject.serializeBytes(x))),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _msg_id;
|
|
|
+ let _options;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _msg_id = reader.readInt();
|
|
|
+ reader.readInt();
|
|
|
+ _options = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.tgReadBytes();
|
|
|
+ _options.push(_x);
|
|
|
+ }
|
|
|
+ return new this({peer:_peer,
|
|
|
+ msgId:_msg_id,
|
|
|
+ options:_options})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class GetPollResultsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x73bb643b;
|
|
|
+ static SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x73bb643b;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.msgId = args.msgId;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("3b64bb73","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ struct.pack('<i', this.msgId),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _msg_id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _msg_id = reader.readInt();
|
|
|
+ return new this({peer:_peer,
|
|
|
+ msgId:_msg_id})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetOnlinesRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x6e2be050;
|
|
|
+ static SUBCLASS_OF_ID = 0x8c81903a;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns ChatOnlines: Instance of ChatOnlines
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x6e2be050;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8c81903a;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("50e02b6e","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ return new this({peer:_peer})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetStatsURLRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x812c2ae6;
|
|
|
+ static SUBCLASS_OF_ID = 0x8d4c94c0;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns StatsURL: Instance of StatsURL
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x812c2ae6;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8d4c94c0;
|
|
|
+
|
|
|
+ this.dark = args.dark || null;
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.params = args.params;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("e62a2c81","hex"),
|
|
|
+ struct.pack('<I', (this.dark === undefined || this.dark === false || this.dark === null) ? 0 : 1),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ TLObject.serializeBytes(this.params),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _dark;
|
|
|
+ let _peer;
|
|
|
+ let _params;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _dark = Boolean(flags & 1);
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _params = reader.tgReadString();
|
|
|
+ return new this({dark:_dark,
|
|
|
+ peer:_peer,
|
|
|
+ params:_params})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class EditChatAboutRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xdef60797;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xdef60797;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.about = args.about;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("9707f6de","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ TLObject.serializeBytes(this.about),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _about;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _about = reader.tgReadString();
|
|
|
+ return new this({peer:_peer,
|
|
|
+ about:_about})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class EditChatDefaultBannedRightsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xa5866b41;
|
|
|
+ static SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xa5866b41;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.bannedRights = args.bannedRights;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("416b86a5","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ this.bannedRights.getBytes(),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _banned_rights;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _banned_rights = reader.tgReadObject();
|
|
|
+ return new this({peer:_peer,
|
|
|
+ bannedRights:_banned_rights})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetEmojiKeywordsRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x35a0e062;
|
|
|
+ static SUBCLASS_OF_ID = 0xd279c672;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns EmojiKeywordsDifference: Instance of EmojiKeywordsDifference
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x35a0e062;
|
|
|
+ this.SUBCLASS_OF_ID = 0xd279c672;
|
|
|
+
|
|
|
+ this.langCode = args.langCode;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("62e0a035","hex"),
|
|
|
+ TLObject.serializeBytes(this.langCode),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _lang_code;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _lang_code = reader.tgReadString();
|
|
|
+ return new this({langCode:_lang_code})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetEmojiKeywordsDifferenceRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x1508b6af;
|
|
|
+ static SUBCLASS_OF_ID = 0xd279c672;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns EmojiKeywordsDifference: Instance of EmojiKeywordsDifference
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x1508b6af;
|
|
|
+ this.SUBCLASS_OF_ID = 0xd279c672;
|
|
|
+
|
|
|
+ this.langCode = args.langCode;
|
|
|
+ this.fromVersion = args.fromVersion;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("afb60815","hex"),
|
|
|
+ TLObject.serializeBytes(this.langCode),
|
|
|
+ struct.pack('<i', this.fromVersion),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _lang_code;
|
|
|
+ let _from_version;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _lang_code = reader.tgReadString();
|
|
|
+ _from_version = reader.readInt();
|
|
|
+ return new this({langCode:_lang_code,
|
|
|
+ fromVersion:_from_version})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetEmojiKeywordsLanguagesRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x4e9963b2;
|
|
|
+ static SUBCLASS_OF_ID = 0xe795d387;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Vector<EmojiLanguage>: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x4e9963b2;
|
|
|
+ this.SUBCLASS_OF_ID = 0xe795d387;
|
|
|
+
|
|
|
+ this.langCodes = args.langCodes;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("b263994e","hex"),
|
|
|
+ Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.langCodes.length),Buffer.concat(this.langCodes.map(x => TLObject.serializeBytes(x))),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _lang_codes;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ reader.readInt();
|
|
|
+ _lang_codes = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.tgReadString();
|
|
|
+ _lang_codes.push(_x);
|
|
|
+ }
|
|
|
+ return new this({langCodes:_lang_codes})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class GetEmojiURLRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xd5b10c26;
|
|
|
+ static SUBCLASS_OF_ID = 0x1fa08a19;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns EmojiURL: Instance of EmojiURL
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xd5b10c26;
|
|
|
+ this.SUBCLASS_OF_ID = 0x1fa08a19;
|
|
|
+
|
|
|
+ this.langCode = args.langCode;
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("260cb1d5","hex"),
|
|
|
+ TLObject.serializeBytes(this.langCode),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _lang_code;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _lang_code = reader.tgReadString();
|
|
|
+ return new this({langCode:_lang_code})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetSearchCountersRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x732eef00;
|
|
|
+ static SUBCLASS_OF_ID = 0x6bde3c6e;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Vector<messages.SearchCounter>: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x732eef00;
|
|
|
+ this.SUBCLASS_OF_ID = 0x6bde3c6e;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.filters = args.filters;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("00ef2e73","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.filters.length),Buffer.concat(this.filters.map(x => x.getBytes())),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _filters;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ reader.readInt();
|
|
|
+ _filters = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.tgReadObject();
|
|
|
+ _filters.push(_x);
|
|
|
+ }
|
|
|
+ return new this({peer:_peer,
|
|
|
+ filters:_filters})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class RequestUrlAuthRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xe33f5613;
|
|
|
+ static SUBCLASS_OF_ID = 0x7765cb1e;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns UrlAuthResult: Instance of either UrlAuthResultRequest, UrlAuthResultAccepted, UrlAuthResultDefault
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xe33f5613;
|
|
|
+ this.SUBCLASS_OF_ID = 0x7765cb1e;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.msgId = args.msgId;
|
|
|
+ this.buttonId = args.buttonId;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("13563fe3","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ struct.pack('<i', this.msgId),
|
|
|
+ struct.pack('<i', this.buttonId),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _msg_id;
|
|
|
+ let _button_id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _msg_id = reader.readInt();
|
|
|
+ _button_id = reader.readInt();
|
|
|
+ return new this({peer:_peer,
|
|
|
+ msgId:_msg_id,
|
|
|
+ buttonId:_button_id})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class AcceptUrlAuthRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xf729ea98;
|
|
|
+ static SUBCLASS_OF_ID = 0x7765cb1e;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns UrlAuthResult: Instance of either UrlAuthResultRequest, UrlAuthResultAccepted, UrlAuthResultDefault
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xf729ea98;
|
|
|
+ this.SUBCLASS_OF_ID = 0x7765cb1e;
|
|
|
+
|
|
|
+ this.writeAllowed = args.writeAllowed || null;
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.msgId = args.msgId;
|
|
|
+ this.buttonId = args.buttonId;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("98ea29f7","hex"),
|
|
|
+ struct.pack('<I', (this.writeAllowed === undefined || this.writeAllowed === false || this.writeAllowed === null) ? 0 : 1),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ struct.pack('<i', this.msgId),
|
|
|
+ struct.pack('<i', this.buttonId),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _flags;
|
|
|
+ let _write_allowed;
|
|
|
+ let _peer;
|
|
|
+ let _msg_id;
|
|
|
+ let _button_id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ let flags = reader.readInt();
|
|
|
+
|
|
|
+ _write_allowed = Boolean(flags & 1);
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _msg_id = reader.readInt();
|
|
|
+ _button_id = reader.readInt();
|
|
|
+ return new this({writeAllowed:_write_allowed,
|
|
|
+ peer:_peer,
|
|
|
+ msgId:_msg_id,
|
|
|
+ buttonId:_button_id})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class HidePeerSettingsBarRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x4facb138;
|
|
|
+ static SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Bool: This type has no constructors.
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x4facb138;
|
|
|
+ this.SUBCLASS_OF_ID = 0xf5b399ac;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("38b1ac4f","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ return new this({peer:_peer})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetScheduledHistoryRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xe2c2685b;
|
|
|
+ static SUBCLASS_OF_ID = 0xd4b40b5e;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.Messages: Instance of either Messages, MessagesSlice, ChannelMessages, MessagesNotModified
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xe2c2685b;
|
|
|
+ this.SUBCLASS_OF_ID = 0xd4b40b5e;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.hash = args.hash;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("5b68c2e2","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ struct.pack('<i', this.hash),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _hash;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ _hash = reader.readInt();
|
|
|
+ return new this({peer:_peer,
|
|
|
+ hash:_hash})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+class GetScheduledMessagesRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xbdbb0464;
|
|
|
+ static SUBCLASS_OF_ID = 0xd4b40b5e;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns messages.Messages: Instance of either Messages, MessagesSlice, ChannelMessages, MessagesNotModified
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xbdbb0464;
|
|
|
+ this.SUBCLASS_OF_ID = 0xd4b40b5e;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.id = args.id;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("6404bbbd","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.id.length),Buffer.concat(this.id.map(x => struct.pack('<i', x))),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ reader.readInt();
|
|
|
+ _id = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.readInt();
|
|
|
+ _id.push(_x);
|
|
|
+ }
|
|
|
+ return new this({peer:_peer,
|
|
|
+ id:_id})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class SendScheduledMessagesRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0xbd38850a;
|
|
|
+ static SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0xbd38850a;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.id = args.id;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("0a8538bd","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.id.length),Buffer.concat(this.id.map(x => struct.pack('<i', x))),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ reader.readInt();
|
|
|
+ _id = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.readInt();
|
|
|
+ _id.push(_x);
|
|
|
+ }
|
|
|
+ return new this({peer:_peer,
|
|
|
+ id:_id})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+class DeleteScheduledMessagesRequest extends TLRequest {
|
|
|
+ static CONSTRUCTOR_ID = 0x59ae2b16;
|
|
|
+ static SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ /**
|
|
|
+ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage
|
|
|
+ */
|
|
|
+ constructor(args) {
|
|
|
+ super();
|
|
|
+ args = args || {}
|
|
|
+ this.CONSTRUCTOR_ID = 0x59ae2b16;
|
|
|
+ this.SUBCLASS_OF_ID = 0x8af52aac;
|
|
|
+
|
|
|
+ this.peer = args.peer;
|
|
|
+ this.id = args.id;
|
|
|
+ }
|
|
|
+ async resolve(client, utils) {
|
|
|
+ this.peer = utils.getInputPeer(await client.getInputEntity(this.peer))
|
|
|
+ }
|
|
|
+ getBytes() {
|
|
|
+ return Buffer.concat([
|
|
|
+ Buffer.from("162bae59","hex"),
|
|
|
+ this.peer.getBytes(),
|
|
|
+ Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.id.length),Buffer.concat(this.id.map(x => struct.pack('<i', x))),
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ static fromReader(reader) {
|
|
|
+ let _peer;
|
|
|
+ let _id;
|
|
|
+ let _x;
|
|
|
+ let len;
|
|
|
+ _peer = reader.tgReadObject();
|
|
|
+ reader.readInt();
|
|
|
+ _id = [];
|
|
|
+ len = reader.readInt();
|
|
|
+ for (let i=0;i<len;i++){
|
|
|
+ _x = reader.readInt();
|
|
|
+ _id.push(_x);
|
|
|
+ }
|
|
|
+ return new this({peer:_peer,
|
|
|
+ id:_id})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+module.exports = {
|
|
|
+ GetMessagesRequest,
|
|
|
+ GetDialogsRequest,
|
|
|
+ GetHistoryRequest,
|
|
|
+ SearchRequest,
|
|
|
+ ReadHistoryRequest,
|
|
|
+ DeleteHistoryRequest,
|
|
|
+ DeleteMessagesRequest,
|
|
|
+ ReceivedMessagesRequest,
|
|
|
+ SetTypingRequest,
|
|
|
+ SendMessageRequest,
|
|
|
+ SendMediaRequest,
|
|
|
+ ForwardMessagesRequest,
|
|
|
+ ReportSpamRequest,
|
|
|
+ GetPeerSettingsRequest,
|
|
|
+ ReportRequest,
|
|
|
+ GetChatsRequest,
|
|
|
+ GetFullChatRequest,
|
|
|
+ EditChatTitleRequest,
|
|
|
+ EditChatPhotoRequest,
|
|
|
+ AddChatUserRequest,
|
|
|
+ DeleteChatUserRequest,
|
|
|
+ CreateChatRequest,
|
|
|
+ GetDhConfigRequest,
|
|
|
+ RequestEncryptionRequest,
|
|
|
+ AcceptEncryptionRequest,
|
|
|
+ DiscardEncryptionRequest,
|
|
|
+ SetEncryptedTypingRequest,
|
|
|
+ ReadEncryptedHistoryRequest,
|
|
|
+ SendEncryptedRequest,
|
|
|
+ SendEncryptedFileRequest,
|
|
|
+ SendEncryptedServiceRequest,
|
|
|
+ ReceivedQueueRequest,
|
|
|
+ ReportEncryptedSpamRequest,
|
|
|
+ ReadMessageContentsRequest,
|
|
|
+ GetStickersRequest,
|
|
|
+ GetAllStickersRequest,
|
|
|
+ GetWebPagePreviewRequest,
|
|
|
+ ExportChatInviteRequest,
|
|
|
+ CheckChatInviteRequest,
|
|
|
+ ImportChatInviteRequest,
|
|
|
+ GetStickerSetRequest,
|
|
|
+ InstallStickerSetRequest,
|
|
|
+ UninstallStickerSetRequest,
|
|
|
+ StartBotRequest,
|
|
|
+ GetMessagesViewsRequest,
|
|
|
+ EditChatAdminRequest,
|
|
|
+ MigrateChatRequest,
|
|
|
+ SearchGlobalRequest,
|
|
|
+ ReorderStickerSetsRequest,
|
|
|
+ GetDocumentByHashRequest,
|
|
|
+ SearchGifsRequest,
|
|
|
+ GetSavedGifsRequest,
|
|
|
+ SaveGifRequest,
|
|
|
+ GetInlineBotResultsRequest,
|
|
|
+ SetInlineBotResultsRequest,
|
|
|
+ SendInlineBotResultRequest,
|
|
|
+ GetMessageEditDataRequest,
|
|
|
+ EditMessageRequest,
|
|
|
+ EditInlineBotMessageRequest,
|
|
|
+ GetBotCallbackAnswerRequest,
|
|
|
+ SetBotCallbackAnswerRequest,
|
|
|
+ GetPeerDialogsRequest,
|
|
|
+ SaveDraftRequest,
|
|
|
+ GetAllDraftsRequest,
|
|
|
+ GetFeaturedStickersRequest,
|
|
|
+ ReadFeaturedStickersRequest,
|
|
|
+ GetRecentStickersRequest,
|
|
|
+ SaveRecentStickerRequest,
|
|
|
+ ClearRecentStickersRequest,
|
|
|
+ GetArchivedStickersRequest,
|
|
|
+ GetMaskStickersRequest,
|
|
|
+ GetAttachedStickersRequest,
|
|
|
+ SetGameScoreRequest,
|
|
|
+ SetInlineGameScoreRequest,
|
|
|
+ GetGameHighScoresRequest,
|
|
|
+ GetInlineGameHighScoresRequest,
|
|
|
+ GetCommonChatsRequest,
|
|
|
+ GetAllChatsRequest,
|
|
|
+ GetWebPageRequest,
|
|
|
+ ToggleDialogPinRequest,
|
|
|
+ ReorderPinnedDialogsRequest,
|
|
|
+ GetPinnedDialogsRequest,
|
|
|
+ SetBotShippingResultsRequest,
|
|
|
+ SetBotPrecheckoutResultsRequest,
|
|
|
+ UploadMediaRequest,
|
|
|
+ SendScreenshotNotificationRequest,
|
|
|
+ GetFavedStickersRequest,
|
|
|
+ FaveStickerRequest,
|
|
|
+ GetUnreadMentionsRequest,
|
|
|
+ ReadMentionsRequest,
|
|
|
+ GetRecentLocationsRequest,
|
|
|
+ SendMultiMediaRequest,
|
|
|
+ UploadEncryptedFileRequest,
|
|
|
+ SearchStickerSetsRequest,
|
|
|
+ GetSplitRangesRequest,
|
|
|
+ MarkDialogUnreadRequest,
|
|
|
+ GetDialogUnreadMarksRequest,
|
|
|
+ ClearAllDraftsRequest,
|
|
|
+ UpdatePinnedMessageRequest,
|
|
|
+ SendVoteRequest,
|
|
|
+ GetPollResultsRequest,
|
|
|
+ GetOnlinesRequest,
|
|
|
+ GetStatsURLRequest,
|
|
|
+ EditChatAboutRequest,
|
|
|
+ EditChatDefaultBannedRightsRequest,
|
|
|
+ GetEmojiKeywordsRequest,
|
|
|
+ GetEmojiKeywordsDifferenceRequest,
|
|
|
+ GetEmojiKeywordsLanguagesRequest,
|
|
|
+ GetEmojiURLRequest,
|
|
|
+ GetSearchCountersRequest,
|
|
|
+ RequestUrlAuthRequest,
|
|
|
+ AcceptUrlAuthRequest,
|
|
|
+ HidePeerSettingsBarRequest,
|
|
|
+ GetScheduledHistoryRequest,
|
|
|
+ GetScheduledMessagesRequest,
|
|
|
+ SendScheduledMessagesRequest,
|
|
|
+ DeleteScheduledMessagesRequest,
|
|
|
+};
|