resPQ::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '63241605'; this._typeName = "mtproto.type.ResPQ"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeNonce(); this.__writeServer_nonce(); this.__writePq(); var server_public_key_fingerprintsBytes = this.server_public_key_fingerprints.serialize({isBare: false}); this._writeBytes(server_public_key_fingerprintsBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readNonce(); this.__readServer_nonce(); this.__readPq(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'mtproto.type', type: 'long', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.server_public_key_fingerprints = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeNonce = function __writeNonce() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'nonce', this.nonce); } this.writeInt128(this.nonce); }; this.__writeServer_nonce = function __writeServer_nonce() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'server_nonce', this.server_nonce); } this.writeInt128(this.server_nonce); }; this.__writePq = function __writePq() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pq', this.pq.toString('hex')); } this.writeBytes(this.pq); }; this.__readNonce = function __readNonce() { this.nonce = this.readInt128(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'nonce', this.nonce, this._readOffset); } }; this.__readServer_nonce = function __readServer_nonce() { this.server_nonce = this.readInt128(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'server_nonce', this.server_nonce, this._readOffset); } }; this.__readPq = function __readPq() { this.pq = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pq', this.pq.toString('hex'), this._readOffset); } }; }::false p_q_inner_data::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'ec5ac983'; this._typeName = "mtproto.type.P_q_inner_data"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writePq(); this.__writeP(); this.__writeQ(); this.__writeNonce(); this.__writeServer_nonce(); this.__writeNew_nonce(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readPq(); this.__readP(); this.__readQ(); this.__readNonce(); this.__readServer_nonce(); this.__readNew_nonce(); return this; }; this.__writePq = function __writePq() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pq', this.pq.toString('hex')); } this.writeBytes(this.pq); }; this.__writeP = function __writeP() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'p', this.p.toString('hex')); } this.writeBytes(this.p); }; this.__writeQ = function __writeQ() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'q', this.q.toString('hex')); } this.writeBytes(this.q); }; this.__writeNonce = function __writeNonce() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'nonce', this.nonce); } this.writeInt128(this.nonce); }; this.__writeServer_nonce = function __writeServer_nonce() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'server_nonce', this.server_nonce); } this.writeInt128(this.server_nonce); }; this.__writeNew_nonce = function __writeNew_nonce() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'new_nonce', this.new_nonce); } this.writeInt256(this.new_nonce); }; this.__readPq = function __readPq() { this.pq = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pq', this.pq.toString('hex'), this._readOffset); } }; this.__readP = function __readP() { this.p = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'p', this.p.toString('hex'), this._readOffset); } }; this.__readQ = function __readQ() { this.q = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'q', this.q.toString('hex'), this._readOffset); } }; this.__readNonce = function __readNonce() { this.nonce = this.readInt128(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'nonce', this.nonce, this._readOffset); } }; this.__readServer_nonce = function __readServer_nonce() { this.server_nonce = this.readInt128(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'server_nonce', this.server_nonce, this._readOffset); } }; this.__readNew_nonce = function __readNew_nonce() { this.new_nonce = this.readInt256(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'new_nonce', this.new_nonce, this._readOffset); } }; }::false server_DH_params_fail::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '5d04cb79'; this._typeName = "mtproto.type.Server_DH_params_fail"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeNonce(); this.__writeServer_nonce(); this.__writeNew_nonce_hash(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readNonce(); this.__readServer_nonce(); this.__readNew_nonce_hash(); return this; }; this.__writeNonce = function __writeNonce() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'nonce', this.nonce); } this.writeInt128(this.nonce); }; this.__writeServer_nonce = function __writeServer_nonce() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'server_nonce', this.server_nonce); } this.writeInt128(this.server_nonce); }; this.__writeNew_nonce_hash = function __writeNew_nonce_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'new_nonce_hash', this.new_nonce_hash); } this.writeInt128(this.new_nonce_hash); }; this.__readNonce = function __readNonce() { this.nonce = this.readInt128(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'nonce', this.nonce, this._readOffset); } }; this.__readServer_nonce = function __readServer_nonce() { this.server_nonce = this.readInt128(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'server_nonce', this.server_nonce, this._readOffset); } }; this.__readNew_nonce_hash = function __readNew_nonce_hash() { this.new_nonce_hash = this.readInt128(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'new_nonce_hash', this.new_nonce_hash, this._readOffset); } }; }::false server_DH_params_ok::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '5c07e8d0'; this._typeName = "mtproto.type.Server_DH_params_ok"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeNonce(); this.__writeServer_nonce(); this.__writeEncrypted_answer(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readNonce(); this.__readServer_nonce(); this.__readEncrypted_answer(); return this; }; this.__writeNonce = function __writeNonce() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'nonce', this.nonce); } this.writeInt128(this.nonce); }; this.__writeServer_nonce = function __writeServer_nonce() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'server_nonce', this.server_nonce); } this.writeInt128(this.server_nonce); }; this.__writeEncrypted_answer = function __writeEncrypted_answer() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'encrypted_answer', this.encrypted_answer.toString('hex')); } this.writeBytes(this.encrypted_answer); }; this.__readNonce = function __readNonce() { this.nonce = this.readInt128(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'nonce', this.nonce, this._readOffset); } }; this.__readServer_nonce = function __readServer_nonce() { this.server_nonce = this.readInt128(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'server_nonce', this.server_nonce, this._readOffset); } }; this.__readEncrypted_answer = function __readEncrypted_answer() { this.encrypted_answer = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'encrypted_answer', this.encrypted_answer.toString('hex'), this._readOffset); } }; }::false server_DH_inner_data::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'ba0d89b5'; this._typeName = "mtproto.type.Server_DH_inner_data"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeNonce(); this.__writeServer_nonce(); this.__writeG(); this.__writeDh_prime(); this.__writeG_a(); this.__writeServer_time(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readNonce(); this.__readServer_nonce(); this.__readG(); this.__readDh_prime(); this.__readG_a(); this.__readServer_time(); return this; }; this.__writeNonce = function __writeNonce() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'nonce', this.nonce); } this.writeInt128(this.nonce); }; this.__writeServer_nonce = function __writeServer_nonce() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'server_nonce', this.server_nonce); } this.writeInt128(this.server_nonce); }; this.__writeG = function __writeG() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'g', this.g); } this.writeInt(this.g); }; this.__writeDh_prime = function __writeDh_prime() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'dh_prime', this.dh_prime.toString('hex')); } this.writeBytes(this.dh_prime); }; this.__writeG_a = function __writeG_a() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'g_a', this.g_a.toString('hex')); } this.writeBytes(this.g_a); }; this.__writeServer_time = function __writeServer_time() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'server_time', this.server_time); } this.writeInt(this.server_time); }; this.__readNonce = function __readNonce() { this.nonce = this.readInt128(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'nonce', this.nonce, this._readOffset); } }; this.__readServer_nonce = function __readServer_nonce() { this.server_nonce = this.readInt128(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'server_nonce', this.server_nonce, this._readOffset); } }; this.__readG = function __readG() { this.g = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'g', this.g, this._readOffset); } }; this.__readDh_prime = function __readDh_prime() { this.dh_prime = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'dh_prime', this.dh_prime.toString('hex'), this._readOffset); } }; this.__readG_a = function __readG_a() { this.g_a = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'g_a', this.g_a.toString('hex'), this._readOffset); } }; this.__readServer_time = function __readServer_time() { this.server_time = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'server_time', this.server_time, this._readOffset); } }; }::false client_DH_inner_data::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '54b64366'; this._typeName = "mtproto.type.Client_DH_inner_data"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeNonce(); this.__writeServer_nonce(); this.__writeRetry_id(); this.__writeG_b(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readNonce(); this.__readServer_nonce(); this.__readRetry_id(); this.__readG_b(); return this; }; this.__writeNonce = function __writeNonce() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'nonce', this.nonce); } this.writeInt128(this.nonce); }; this.__writeServer_nonce = function __writeServer_nonce() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'server_nonce', this.server_nonce); } this.writeInt128(this.server_nonce); }; this.__writeRetry_id = function __writeRetry_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'retry_id', this.retry_id); } this.writeLong(this.retry_id); }; this.__writeG_b = function __writeG_b() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'g_b', this.g_b.toString('hex')); } this.writeBytes(this.g_b); }; this.__readNonce = function __readNonce() { this.nonce = this.readInt128(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'nonce', this.nonce, this._readOffset); } }; this.__readServer_nonce = function __readServer_nonce() { this.server_nonce = this.readInt128(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'server_nonce', this.server_nonce, this._readOffset); } }; this.__readRetry_id = function __readRetry_id() { this.retry_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'retry_id', this.retry_id, this._readOffset); } }; this.__readG_b = function __readG_b() { this.g_b = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'g_b', this.g_b.toString('hex'), this._readOffset); } }; }::false dh_gen_ok::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '34f7cb3b'; this._typeName = "mtproto.type.Dh_gen_ok"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeNonce(); this.__writeServer_nonce(); this.__writeNew_nonce_hash1(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readNonce(); this.__readServer_nonce(); this.__readNew_nonce_hash1(); return this; }; this.__writeNonce = function __writeNonce() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'nonce', this.nonce); } this.writeInt128(this.nonce); }; this.__writeServer_nonce = function __writeServer_nonce() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'server_nonce', this.server_nonce); } this.writeInt128(this.server_nonce); }; this.__writeNew_nonce_hash1 = function __writeNew_nonce_hash1() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'new_nonce_hash1', this.new_nonce_hash1); } this.writeInt128(this.new_nonce_hash1); }; this.__readNonce = function __readNonce() { this.nonce = this.readInt128(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'nonce', this.nonce, this._readOffset); } }; this.__readServer_nonce = function __readServer_nonce() { this.server_nonce = this.readInt128(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'server_nonce', this.server_nonce, this._readOffset); } }; this.__readNew_nonce_hash1 = function __readNew_nonce_hash1() { this.new_nonce_hash1 = this.readInt128(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'new_nonce_hash1', this.new_nonce_hash1, this._readOffset); } }; }::false dh_gen_retry::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'b91fdc46'; this._typeName = "mtproto.type.Dh_gen_retry"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeNonce(); this.__writeServer_nonce(); this.__writeNew_nonce_hash2(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readNonce(); this.__readServer_nonce(); this.__readNew_nonce_hash2(); return this; }; this.__writeNonce = function __writeNonce() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'nonce', this.nonce); } this.writeInt128(this.nonce); }; this.__writeServer_nonce = function __writeServer_nonce() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'server_nonce', this.server_nonce); } this.writeInt128(this.server_nonce); }; this.__writeNew_nonce_hash2 = function __writeNew_nonce_hash2() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'new_nonce_hash2', this.new_nonce_hash2); } this.writeInt128(this.new_nonce_hash2); }; this.__readNonce = function __readNonce() { this.nonce = this.readInt128(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'nonce', this.nonce, this._readOffset); } }; this.__readServer_nonce = function __readServer_nonce() { this.server_nonce = this.readInt128(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'server_nonce', this.server_nonce, this._readOffset); } }; this.__readNew_nonce_hash2 = function __readNew_nonce_hash2() { this.new_nonce_hash2 = this.readInt128(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'new_nonce_hash2', this.new_nonce_hash2, this._readOffset); } }; }::false dh_gen_fail::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '02ae9da6'; this._typeName = "mtproto.type.Dh_gen_fail"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeNonce(); this.__writeServer_nonce(); this.__writeNew_nonce_hash3(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readNonce(); this.__readServer_nonce(); this.__readNew_nonce_hash3(); return this; }; this.__writeNonce = function __writeNonce() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'nonce', this.nonce); } this.writeInt128(this.nonce); }; this.__writeServer_nonce = function __writeServer_nonce() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'server_nonce', this.server_nonce); } this.writeInt128(this.server_nonce); }; this.__writeNew_nonce_hash3 = function __writeNew_nonce_hash3() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'new_nonce_hash3', this.new_nonce_hash3); } this.writeInt128(this.new_nonce_hash3); }; this.__readNonce = function __readNonce() { this.nonce = this.readInt128(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'nonce', this.nonce, this._readOffset); } }; this.__readServer_nonce = function __readServer_nonce() { this.server_nonce = this.readInt128(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'server_nonce', this.server_nonce, this._readOffset); } }; this.__readNew_nonce_hash3 = function __readNew_nonce_hash3() { this.new_nonce_hash3 = this.readInt128(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'new_nonce_hash3', this.new_nonce_hash3, this._readOffset); } }; }::false rpc_result::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '016d5cf3'; this._typeName = "mtproto.type.Rpc_result"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeReq_msg_id(); var resultBytes = this.result.serialize({isBare: false}); this.bytes = resultBytes.length; this.__writeBytes(); this._writeBytes(resultBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readReq_msg_id(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Object, bytes.toString('hex'), 'Object'); } var Object = this.constructor.requireTypeFromBuffer(bytes); if (Object) { var obj = new Object({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.result = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Object and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeReq_msg_id = function __writeReq_msg_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'req_msg_id', this.req_msg_id); } this.writeLong(this.req_msg_id); }; this.__writeBytes = function __writeBytes() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'bytes', this.bytes); } this.writeInt(this.bytes); }; this.__readReq_msg_id = function __readReq_msg_id() { this.req_msg_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'req_msg_id', this.req_msg_id, this._readOffset); } }; }::false rpc_error::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '19ca4421'; this._typeName = "mtproto.type.Rpc_error"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeError_code(); this.__writeError_message(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readError_code(); this.__readError_message(); return this; }; this.__writeError_code = function __writeError_code() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'error_code', this.error_code); } this.writeInt(this.error_code); }; this.__writeError_message = function __writeError_message() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'error_message', this.error_message); } this.writeString(this.error_message); }; this.__readError_code = function __readError_code() { this.error_code = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'error_code', this.error_code, this._readOffset); } }; this.__readError_message = function __readError_message() { this.error_message = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'error_message', this.error_message, this._readOffset); } }; }::false rpc_answer_unknown::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '6ed32a5e'; this._typeName = "mtproto.type.Rpc_answer_unknown"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false rpc_answer_dropped_running::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '86e578cd'; this._typeName = "mtproto.type.Rpc_answer_dropped_running"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false rpc_answer_dropped::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'b7d83aa4'; this._typeName = "mtproto.type.Rpc_answer_dropped"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeMsg_id(); this.__writeSeq_no(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readMsg_id(); this.__readSeq_no(); this.__readBytes(); return this; }; this.__writeMsg_id = function __writeMsg_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'msg_id', this.msg_id); } this.writeLong(this.msg_id); }; this.__writeSeq_no = function __writeSeq_no() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'seq_no', this.seq_no); } this.writeInt(this.seq_no); }; this.__readMsg_id = function __readMsg_id() { this.msg_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'msg_id', this.msg_id, this._readOffset); } }; this.__readSeq_no = function __readSeq_no() { this.seq_no = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'seq_no', this.seq_no, this._readOffset); } }; this.__readBytes = function __readBytes() { this.bytes = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'bytes', this.bytes, this._readOffset); } }; }::false future_salt::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'dcd94909'; this._typeName = "mtproto.type.Future_salt"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeValid_since(); this.__writeValid_until(); this.__writeSalt(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readValid_since(); this.__readValid_until(); this.__readSalt(); return this; }; this.__writeValid_since = function __writeValid_since() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'valid_since', this.valid_since); } this.writeInt(this.valid_since); }; this.__writeValid_until = function __writeValid_until() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'valid_until', this.valid_until); } this.writeInt(this.valid_until); }; this.__writeSalt = function __writeSalt() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'salt', this.salt); } this.writeLong(this.salt); }; this.__readValid_since = function __readValid_since() { this.valid_since = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'valid_since', this.valid_since, this._readOffset); } }; this.__readValid_until = function __readValid_until() { this.valid_until = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'valid_until', this.valid_until, this._readOffset); } }; this.__readSalt = function __readSalt() { this.salt = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'salt', this.salt, this._readOffset); } }; }::false future_salts::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '950850ae'; this._typeName = "mtproto.type.Future_salts"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeReq_msg_id(); this.__writeNow(); var saltsBytes = this.salts.serialize({isBare: true}); this._writeBytes(saltsBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readReq_msg_id(); this.__readNow(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'mtproto.type', type: 'future_salt', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: true}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.salts = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeReq_msg_id = function __writeReq_msg_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'req_msg_id', this.req_msg_id); } this.writeLong(this.req_msg_id); }; this.__writeNow = function __writeNow() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'now', this.now); } this.writeInt(this.now); }; this.__readReq_msg_id = function __readReq_msg_id() { this.req_msg_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'req_msg_id', this.req_msg_id, this._readOffset); } }; this.__readNow = function __readNow() { this.now = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'now', this.now, this._readOffset); } }; }::false pong::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c5737734'; this._typeName = "mtproto.type.Pong"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeMsg_id(); this.__writePing_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readMsg_id(); this.__readPing_id(); return this; }; this.__writeMsg_id = function __writeMsg_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'msg_id', this.msg_id); } this.writeLong(this.msg_id); }; this.__writePing_id = function __writePing_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'ping_id', this.ping_id); } this.writeLong(this.ping_id); }; this.__readMsg_id = function __readMsg_id() { this.msg_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'msg_id', this.msg_id, this._readOffset); } }; this.__readPing_id = function __readPing_id() { this.ping_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'ping_id', this.ping_id, this._readOffset); } }; }::false destroy_session_ok::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'fc4520e2'; this._typeName = "mtproto.type.Destroy_session_ok"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeSession_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readSession_id(); return this; }; this.__writeSession_id = function __writeSession_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'session_id', this.session_id); } this.writeLong(this.session_id); }; this.__readSession_id = function __readSession_id() { this.session_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'session_id', this.session_id, this._readOffset); } }; }::false destroy_session_none::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c950d362'; this._typeName = "mtproto.type.Destroy_session_none"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeSession_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readSession_id(); return this; }; this.__writeSession_id = function __writeSession_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'session_id', this.session_id); } this.writeLong(this.session_id); }; this.__readSession_id = function __readSession_id() { this.session_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'session_id', this.session_id, this._readOffset); } }; }::false new_session_created::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '0809c29e'; this._typeName = "mtproto.type.New_session_created"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeFirst_msg_id(); this.__writeUnique_id(); this.__writeServer_salt(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFirst_msg_id(); this.__readUnique_id(); this.__readServer_salt(); return this; }; this.__writeFirst_msg_id = function __writeFirst_msg_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'first_msg_id', this.first_msg_id); } this.writeLong(this.first_msg_id); }; this.__writeUnique_id = function __writeUnique_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'unique_id', this.unique_id); } this.writeLong(this.unique_id); }; this.__writeServer_salt = function __writeServer_salt() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'server_salt', this.server_salt); } this.writeLong(this.server_salt); }; this.__readFirst_msg_id = function __readFirst_msg_id() { this.first_msg_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'first_msg_id', this.first_msg_id, this._readOffset); } }; this.__readUnique_id = function __readUnique_id() { this.unique_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'unique_id', this.unique_id, this._readOffset); } }; this.__readServer_salt = function __readServer_salt() { this.server_salt = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'server_salt', this.server_salt, this._readOffset); } }; }::false msg_container::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'dcf8f173'; this._typeName = "mtproto.type.Msg_container"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var messagesBytes = this.messages.serialize({isBare: true}); this._writeBytes(messagesBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'mtproto.type', type: '%Message', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: true}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.messages = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false message::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '11e5b85b'; this._typeName = "mtproto.type.Message"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeMsg_id(); this.__writeSeqno(); var bodyBytes = this.body.serialize({isBare: false}); this.bytes = bodyBytes.length; this.__writeBytes(); this._writeBytes(bodyBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readMsg_id(); this.__readSeqno(); this.__readBytes(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Object, bytes.toString('hex'), 'Object'); } var Object = this.constructor.requireTypeFromBuffer(bytes); if (Object) { var obj = new Object({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.body = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Object and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeMsg_id = function __writeMsg_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'msg_id', this.msg_id); } this.writeLong(this.msg_id); }; this.__writeSeqno = function __writeSeqno() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'seqno', this.seqno); } this.writeInt(this.seqno); }; this.__writeBytes = function __writeBytes() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'bytes', this.bytes); } this.writeInt(this.bytes); }; this.__readMsg_id = function __readMsg_id() { this.msg_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'msg_id', this.msg_id, this._readOffset); } }; this.__readSeqno = function __readSeqno() { this.seqno = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'seqno', this.seqno, this._readOffset); } }; this.__readBytes = function __readBytes() { this.bytes = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'bytes', this.bytes, this._readOffset); } }; }::false msg_copy::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'b24660e0'; this._typeName = "mtproto.type.Msg_copy"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var orig_messageBytes = this.orig_message.serialize({isBare: false}); this._writeBytes(orig_messageBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Message, bytes.toString('hex'), 'Message'); } var Message = this.constructor.requireTypeFromBuffer(bytes); if (Message) { var obj = new Message({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.orig_message = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Message and buffer:' + this._buffer.toString('hex')); } return this; }; }::false gzip_packed::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a1cf7230'; this._typeName = "mtproto.type.Gzip_packed"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writePacked_data(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readPacked_data(); return this; }; this.__writePacked_data = function __writePacked_data() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'packed_data', this.packed_data.toString('hex')); } this.writeBytes(this.packed_data); }; this.__readPacked_data = function __readPacked_data() { this.packed_data = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'packed_data', this.packed_data.toString('hex'), this._readOffset); } }; }::false msgs_ack::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '59b4d662'; this._typeName = "mtproto.type.Msgs_ack"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var msg_idsBytes = this.msg_ids.serialize({isBare: false}); this._writeBytes(msg_idsBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'mtproto.type', type: 'long', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.msg_ids = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false bad_msg_notification::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '11f8efa7'; this._typeName = "mtproto.type.Bad_msg_notification"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeBad_msg_id(); this.__writeBad_msg_seqno(); this.__writeError_code(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readBad_msg_id(); this.__readBad_msg_seqno(); this.__readError_code(); return this; }; this.__writeBad_msg_id = function __writeBad_msg_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'bad_msg_id', this.bad_msg_id); } this.writeLong(this.bad_msg_id); }; this.__writeBad_msg_seqno = function __writeBad_msg_seqno() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'bad_msg_seqno', this.bad_msg_seqno); } this.writeInt(this.bad_msg_seqno); }; this.__writeError_code = function __writeError_code() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'error_code', this.error_code); } this.writeInt(this.error_code); }; this.__readBad_msg_id = function __readBad_msg_id() { this.bad_msg_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'bad_msg_id', this.bad_msg_id, this._readOffset); } }; this.__readBad_msg_seqno = function __readBad_msg_seqno() { this.bad_msg_seqno = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'bad_msg_seqno', this.bad_msg_seqno, this._readOffset); } }; this.__readError_code = function __readError_code() { this.error_code = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'error_code', this.error_code, this._readOffset); } }; }::false bad_server_salt::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '7b44abed'; this._typeName = "mtproto.type.Bad_server_salt"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeBad_msg_id(); this.__writeBad_msg_seqno(); this.__writeError_code(); this.__writeNew_server_salt(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readBad_msg_id(); this.__readBad_msg_seqno(); this.__readError_code(); this.__readNew_server_salt(); return this; }; this.__writeBad_msg_id = function __writeBad_msg_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'bad_msg_id', this.bad_msg_id); } this.writeLong(this.bad_msg_id); }; this.__writeBad_msg_seqno = function __writeBad_msg_seqno() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'bad_msg_seqno', this.bad_msg_seqno); } this.writeInt(this.bad_msg_seqno); }; this.__writeError_code = function __writeError_code() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'error_code', this.error_code); } this.writeInt(this.error_code); }; this.__writeNew_server_salt = function __writeNew_server_salt() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'new_server_salt', this.new_server_salt); } this.writeLong(this.new_server_salt); }; this.__readBad_msg_id = function __readBad_msg_id() { this.bad_msg_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'bad_msg_id', this.bad_msg_id, this._readOffset); } }; this.__readBad_msg_seqno = function __readBad_msg_seqno() { this.bad_msg_seqno = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'bad_msg_seqno', this.bad_msg_seqno, this._readOffset); } }; this.__readError_code = function __readError_code() { this.error_code = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'error_code', this.error_code, this._readOffset); } }; this.__readNew_server_salt = function __readNew_server_salt() { this.new_server_salt = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'new_server_salt', this.new_server_salt, this._readOffset); } }; }::false msg_resend_req::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '081a867d'; this._typeName = "mtproto.type.Msg_resend_req"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var msg_idsBytes = this.msg_ids.serialize({isBare: false}); this._writeBytes(msg_idsBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'mtproto.type', type: 'long', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.msg_ids = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false msgs_state_req::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '52fb69da'; this._typeName = "mtproto.type.Msgs_state_req"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var msg_idsBytes = this.msg_ids.serialize({isBare: false}); this._writeBytes(msg_idsBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'mtproto.type', type: 'long', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.msg_ids = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false msgs_state_info::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '7db5de04'; this._typeName = "mtproto.type.Msgs_state_info"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeReq_msg_id(); this.__writeInfo(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readReq_msg_id(); this.__readInfo(); return this; }; this.__writeReq_msg_id = function __writeReq_msg_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'req_msg_id', this.req_msg_id); } this.writeLong(this.req_msg_id); }; this.__writeInfo = function __writeInfo() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'info', this.info.toString('hex')); } this.writeBytes(this.info); }; this.__readReq_msg_id = function __readReq_msg_id() { this.req_msg_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'req_msg_id', this.req_msg_id, this._readOffset); } }; this.__readInfo = function __readInfo() { this.info = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'info', this.info.toString('hex'), this._readOffset); } }; }::false msgs_all_info::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '31d1c08c'; this._typeName = "mtproto.type.Msgs_all_info"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var msg_idsBytes = this.msg_ids.serialize({isBare: false}); this._writeBytes(msg_idsBytes); this.__writeInfo(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'mtproto.type', type: 'long', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.msg_ids = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } this.__readInfo(); return this; }; this.__writeInfo = function __writeInfo() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'info', this.info.toString('hex')); } this.writeBytes(this.info); }; this.__readInfo = function __readInfo() { this.info = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'info', this.info.toString('hex'), this._readOffset); } }; }::false msg_detailed_info::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c63e6d27'; this._typeName = "mtproto.type.Msg_detailed_info"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeMsg_id(); this.__writeAnswer_msg_id(); this.__writeStatus(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readMsg_id(); this.__readAnswer_msg_id(); this.__readBytes(); this.__readStatus(); return this; }; this.__writeMsg_id = function __writeMsg_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'msg_id', this.msg_id); } this.writeLong(this.msg_id); }; this.__writeAnswer_msg_id = function __writeAnswer_msg_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'answer_msg_id', this.answer_msg_id); } this.writeLong(this.answer_msg_id); }; this.__writeStatus = function __writeStatus() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'status', this.status); } this.writeInt(this.status); }; this.__readMsg_id = function __readMsg_id() { this.msg_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'msg_id', this.msg_id, this._readOffset); } }; this.__readAnswer_msg_id = function __readAnswer_msg_id() { this.answer_msg_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'answer_msg_id', this.answer_msg_id, this._readOffset); } }; this.__readBytes = function __readBytes() { this.bytes = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'bytes', this.bytes, this._readOffset); } }; this.__readStatus = function __readStatus() { this.status = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'status', this.status, this._readOffset); } }; }::false msg_new_detailed_info::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'dfb69d80'; this._typeName = "mtproto.type.Msg_new_detailed_info"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeAnswer_msg_id(); this.__writeStatus(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readAnswer_msg_id(); this.__readBytes(); this.__readStatus(); return this; }; this.__writeAnswer_msg_id = function __writeAnswer_msg_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'answer_msg_id', this.answer_msg_id); } this.writeLong(this.answer_msg_id); }; this.__writeStatus = function __writeStatus() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'status', this.status); } this.writeInt(this.status); }; this.__readAnswer_msg_id = function __readAnswer_msg_id() { this.answer_msg_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'answer_msg_id', this.answer_msg_id, this._readOffset); } }; this.__readBytes = function __readBytes() { this.bytes = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'bytes', this.bytes, this._readOffset); } }; this.__readStatus = function __readStatus() { this.status = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'status', this.status, this._readOffset); } }; }::false req_pq::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true req_DH_params::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true set_client_DH_params::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true rpc_drop_answer::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true get_future_salts::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true ping::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true ping_delay_disconnect::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true destroy_session::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true http_wait::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true initConnection::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true invokeWithLayer::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true invokeAfterMsg::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true invokeAfterMsgs::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true boolFalse::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '379779bc'; this._typeName = "Telegram.type.BoolFalse"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false boolTrue::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'b5757299'; this._typeName = "Telegram.type.BoolTrue"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false true::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '39d3ed3f'; this._typeName = "Telegram.type.True"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false error::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'bbf9b9c4'; this._typeName = "Telegram.type.Error"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeCode(); this.__writeText(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readCode(); this.__readText(); return this; }; this.__writeCode = function __writeCode() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'code', this.code); } this.writeInt(this.code); }; this.__writeText = function __writeText() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'text', this.text); } this.writeString(this.text); }; this.__readCode = function __readCode() { this.code = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'code', this.code, this._readOffset); } }; this.__readText = function __readText() { this.text = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'text', this.text, this._readOffset); } }; }::false null::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'cc0b7356'; this._typeName = "Telegram.type.Null"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputPeerEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'ea183b7f'; this._typeName = "Telegram.type.InputPeerEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputPeerSelf::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c97ea07d'; this._typeName = "Telegram.type.InputPeerSelf"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputPeerChat::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '63e89b17'; this._typeName = "Telegram.type.InputPeerChat"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeChat_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readChat_id(); return this; }; this.__writeChat_id = function __writeChat_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'chat_id', this.chat_id); } this.writeInt(this.chat_id); }; this.__readChat_id = function __readChat_id() { this.chat_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'chat_id', this.chat_id, this._readOffset); } }; }::false inputUserEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'cf8688b9'; this._typeName = "Telegram.type.InputUserEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputUserSelf::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '3fb1c1f7'; this._typeName = "Telegram.type.InputUserSelf"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputPhoneContact::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'f4b792f3'; this._typeName = "Telegram.type.InputPhoneContact"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeClient_id(); this.__writePhone(); this.__writeFirst_name(); this.__writeLast_name(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readClient_id(); this.__readPhone(); this.__readFirst_name(); this.__readLast_name(); return this; }; this.__writeClient_id = function __writeClient_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'client_id', this.client_id); } this.writeLong(this.client_id); }; this.__writePhone = function __writePhone() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'phone', this.phone); } this.writeString(this.phone); }; this.__writeFirst_name = function __writeFirst_name() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'first_name', this.first_name); } this.writeString(this.first_name); }; this.__writeLast_name = function __writeLast_name() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'last_name', this.last_name); } this.writeString(this.last_name); }; this.__readClient_id = function __readClient_id() { this.client_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'client_id', this.client_id, this._readOffset); } }; this.__readPhone = function __readPhone() { this.phone = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'phone', this.phone, this._readOffset); } }; this.__readFirst_name = function __readFirst_name() { this.first_name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'first_name', this.first_name, this._readOffset); } }; this.__readLast_name = function __readLast_name() { this.last_name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'last_name', this.last_name, this._readOffset); } }; }::false inputFile::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '7ff22ff5'; this._typeName = "Telegram.type.InputFile"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeParts(); this.__writeName(); this.__writeMd5_checksum(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readParts(); this.__readName(); this.__readMd5_checksum(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeLong(this.id); }; this.__writeParts = function __writeParts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'parts', this.parts); } this.writeInt(this.parts); }; this.__writeName = function __writeName() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'name', this.name); } this.writeString(this.name); }; this.__writeMd5_checksum = function __writeMd5_checksum() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'md5_checksum', this.md5_checksum); } this.writeString(this.md5_checksum); }; this.__readId = function __readId() { this.id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readParts = function __readParts() { this.parts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'parts', this.parts, this._readOffset); } }; this.__readName = function __readName() { this.name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'name', this.name, this._readOffset); } }; this.__readMd5_checksum = function __readMd5_checksum() { this.md5_checksum = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'md5_checksum', this.md5_checksum, this._readOffset); } }; }::false inputMediaEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '7ff56496'; this._typeName = "Telegram.type.InputMediaEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputMediaUploadedPhoto::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'f19a0c63'; this._typeName = "Telegram.type.InputMediaUploadedPhoto"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.stickers !== null ? (this.flags | 1) : (this.flags & ~1); this.__writeFlags(); var fileBytes = this.file.serialize({isBare: false}); this._writeBytes(fileBytes); this.__writeCaption(); if (this.stickers) { var stickersBytes = this.stickers.serialize({isBare: false}); this._writeBytes(stickersBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputFile, bytes.toString('hex'), 'InputFile'); } var InputFile = this.constructor.requireTypeFromBuffer(bytes); if (InputFile) { var obj = new InputFile({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.file = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputFile and buffer:' + this._buffer.toString('hex')); } this.__readCaption(); if ((this.flags & (1 << 0)) !== 0) { var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'InputDocument', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.stickers = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeCaption = function __writeCaption() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'caption', this.caption); } this.writeString(this.caption); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readCaption = function __readCaption() { this.caption = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'caption', this.caption, this._readOffset); } }; }::false inputMediaPhoto::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'f3b4bfe9'; this._typeName = "Telegram.type.InputMediaPhoto"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var idBytes = this.id.serialize({isBare: false}); this._writeBytes(idBytes); this.__writeCaption(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputPhoto, bytes.toString('hex'), 'InputPhoto'); } var InputPhoto = this.constructor.requireTypeFromBuffer(bytes); if (InputPhoto) { var obj = new InputPhoto({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.id = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputPhoto and buffer:' + this._buffer.toString('hex')); } this.__readCaption(); return this; }; this.__writeCaption = function __writeCaption() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'caption', this.caption); } this.writeString(this.caption); }; this.__readCaption = function __readCaption() { this.caption = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'caption', this.caption, this._readOffset); } }; }::false inputMediaGeoPoint::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '4441c4f9'; this._typeName = "Telegram.type.InputMediaGeoPoint"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var geo_pointBytes = this.geo_point.serialize({isBare: false}); this._writeBytes(geo_pointBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputGeoPoint, bytes.toString('hex'), 'InputGeoPoint'); } var InputGeoPoint = this.constructor.requireTypeFromBuffer(bytes); if (InputGeoPoint) { var obj = new InputGeoPoint({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.geo_point = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputGeoPoint and buffer:' + this._buffer.toString('hex')); } return this; }; }::false inputMediaContact::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '8759e4a6'; this._typeName = "Telegram.type.InputMediaContact"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writePhone_number(); this.__writeFirst_name(); this.__writeLast_name(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readPhone_number(); this.__readFirst_name(); this.__readLast_name(); return this; }; this.__writePhone_number = function __writePhone_number() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'phone_number', this.phone_number); } this.writeString(this.phone_number); }; this.__writeFirst_name = function __writeFirst_name() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'first_name', this.first_name); } this.writeString(this.first_name); }; this.__writeLast_name = function __writeLast_name() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'last_name', this.last_name); } this.writeString(this.last_name); }; this.__readPhone_number = function __readPhone_number() { this.phone_number = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'phone_number', this.phone_number, this._readOffset); } }; this.__readFirst_name = function __readFirst_name() { this.first_name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'first_name', this.first_name, this._readOffset); } }; this.__readLast_name = function __readLast_name() { this.last_name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'last_name', this.last_name, this._readOffset); } }; }::false inputChatPhotoEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '578fa41c'; this._typeName = "Telegram.type.InputChatPhotoEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputChatUploadedPhoto::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'b4557c92'; this._typeName = "Telegram.type.InputChatUploadedPhoto"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var fileBytes = this.file.serialize({isBare: false}); this._writeBytes(fileBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputFile, bytes.toString('hex'), 'InputFile'); } var InputFile = this.constructor.requireTypeFromBuffer(bytes); if (InputFile) { var obj = new InputFile({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.file = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputFile and buffer:' + this._buffer.toString('hex')); } return this; }; }::false inputChatPhoto::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '37ad5389'; this._typeName = "Telegram.type.InputChatPhoto"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var idBytes = this.id.serialize({isBare: false}); this._writeBytes(idBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputPhoto, bytes.toString('hex'), 'InputPhoto'); } var InputPhoto = this.constructor.requireTypeFromBuffer(bytes); if (InputPhoto) { var obj = new InputPhoto({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.id = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputPhoto and buffer:' + this._buffer.toString('hex')); } return this; }; }::false inputGeoPointEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'd623c1e4'; this._typeName = "Telegram.type.InputGeoPointEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputGeoPoint::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c9acb7f3'; this._typeName = "Telegram.type.InputGeoPoint"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeLat(); this.__writeLong(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readLat(); this.__readLong(); return this; }; this.__writeLat = function __writeLat() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'lat', this.lat); } this.writeDouble(this.lat); }; this.__writeLong = function __writeLong() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'long', this.long); } this.writeDouble(this.long); }; this.__readLat = function __readLat() { this.lat = this.readDouble(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'lat', this.lat, this._readOffset); } }; this.__readLong = function __readLong() { this.long = this.readDouble(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'long', this.long, this._readOffset); } }; }::false inputPhotoEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '0dbfd71c'; this._typeName = "Telegram.type.InputPhotoEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputPhoto::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c4c695fb'; this._typeName = "Telegram.type.InputPhoto"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeAccess_hash(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readAccess_hash(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeLong(this.id); }; this.__writeAccess_hash = function __writeAccess_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'access_hash', this.access_hash); } this.writeLong(this.access_hash); }; this.__readId = function __readId() { this.id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readAccess_hash = function __readAccess_hash() { this.access_hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'access_hash', this.access_hash, this._readOffset); } }; }::false inputFileLocation::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '96716314'; this._typeName = "Telegram.type.InputFileLocation"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeVolume_id(); this.__writeLocal_id(); this.__writeSecret(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readVolume_id(); this.__readLocal_id(); this.__readSecret(); return this; }; this.__writeVolume_id = function __writeVolume_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'volume_id', this.volume_id); } this.writeLong(this.volume_id); }; this.__writeLocal_id = function __writeLocal_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'local_id', this.local_id); } this.writeInt(this.local_id); }; this.__writeSecret = function __writeSecret() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'secret', this.secret); } this.writeLong(this.secret); }; this.__readVolume_id = function __readVolume_id() { this.volume_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'volume_id', this.volume_id, this._readOffset); } }; this.__readLocal_id = function __readLocal_id() { this.local_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'local_id', this.local_id, this._readOffset); } }; this.__readSecret = function __readSecret() { this.secret = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'secret', this.secret, this._readOffset); } }; }::false inputAppEvent::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a8560677'; this._typeName = "Telegram.type.InputAppEvent"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeTime(); this.__writeType(); this.__writePeer(); this.__writeData(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readTime(); this.__readType(); this.__readPeer(); this.__readData(); return this; }; this.__writeTime = function __writeTime() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'time', this.time); } this.writeDouble(this.time); }; this.__writeType = function __writeType() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'type', this.type); } this.writeString(this.type); }; this.__writePeer = function __writePeer() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'peer', this.peer); } this.writeLong(this.peer); }; this.__writeData = function __writeData() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'data', this.data); } this.writeString(this.data); }; this.__readTime = function __readTime() { this.time = this.readDouble(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'time', this.time, this._readOffset); } }; this.__readType = function __readType() { this.type = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'type', this.type, this._readOffset); } }; this.__readPeer = function __readPeer() { this.peer = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'peer', this.peer, this._readOffset); } }; this.__readData = function __readData() { this.data = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'data', this.data, this._readOffset); } }; }::false peerUser::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '6dbcb19d'; this._typeName = "Telegram.type.PeerUser"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; }::false peerChat::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'bbe5d0ba'; this._typeName = "Telegram.type.PeerChat"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeChat_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readChat_id(); return this; }; this.__writeChat_id = function __writeChat_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'chat_id', this.chat_id); } this.writeInt(this.chat_id); }; this.__readChat_id = function __readChat_id() { this.chat_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'chat_id', this.chat_id, this._readOffset); } }; }::false storage.fileUnknown::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '053b96aa'; this._typeName = "Telegram.type.storage.FileUnknown"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false storage.fileJpeg::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '0efe7e00'; this._typeName = "Telegram.type.storage.FileJpeg"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false storage.fileGif::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'dfaae1ca'; this._typeName = "Telegram.type.storage.FileGif"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false storage.filePng::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c0634f0a'; this._typeName = "Telegram.type.storage.FilePng"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false storage.filePdf::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '8d501eae'; this._typeName = "Telegram.type.storage.FilePdf"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false storage.fileMp3::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '77068a52'; this._typeName = "Telegram.type.storage.FileMp3"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false storage.fileMov::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'bceb094b'; this._typeName = "Telegram.type.storage.FileMov"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false storage.filePartial::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '526fbc40'; this._typeName = "Telegram.type.storage.FilePartial"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false storage.fileMp4::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'e4a0ceb3'; this._typeName = "Telegram.type.storage.FileMp4"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false storage.fileWebp::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '4c468110'; this._typeName = "Telegram.type.storage.FileWebp"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false fileLocationUnavailable::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '466b597c'; this._typeName = "Telegram.type.FileLocationUnavailable"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeVolume_id(); this.__writeLocal_id(); this.__writeSecret(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readVolume_id(); this.__readLocal_id(); this.__readSecret(); return this; }; this.__writeVolume_id = function __writeVolume_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'volume_id', this.volume_id); } this.writeLong(this.volume_id); }; this.__writeLocal_id = function __writeLocal_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'local_id', this.local_id); } this.writeInt(this.local_id); }; this.__writeSecret = function __writeSecret() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'secret', this.secret); } this.writeLong(this.secret); }; this.__readVolume_id = function __readVolume_id() { this.volume_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'volume_id', this.volume_id, this._readOffset); } }; this.__readLocal_id = function __readLocal_id() { this.local_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'local_id', this.local_id, this._readOffset); } }; this.__readSecret = function __readSecret() { this.secret = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'secret', this.secret, this._readOffset); } }; }::false fileLocation::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '7690d653'; this._typeName = "Telegram.type.FileLocation"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeDc_id(); this.__writeVolume_id(); this.__writeLocal_id(); this.__writeSecret(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readDc_id(); this.__readVolume_id(); this.__readLocal_id(); this.__readSecret(); return this; }; this.__writeDc_id = function __writeDc_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'dc_id', this.dc_id); } this.writeInt(this.dc_id); }; this.__writeVolume_id = function __writeVolume_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'volume_id', this.volume_id); } this.writeLong(this.volume_id); }; this.__writeLocal_id = function __writeLocal_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'local_id', this.local_id); } this.writeInt(this.local_id); }; this.__writeSecret = function __writeSecret() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'secret', this.secret); } this.writeLong(this.secret); }; this.__readDc_id = function __readDc_id() { this.dc_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'dc_id', this.dc_id, this._readOffset); } }; this.__readVolume_id = function __readVolume_id() { this.volume_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'volume_id', this.volume_id, this._readOffset); } }; this.__readLocal_id = function __readLocal_id() { this.local_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'local_id', this.local_id, this._readOffset); } }; this.__readSecret = function __readSecret() { this.secret = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'secret', this.secret, this._readOffset); } }; }::false userEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'ba500220'; this._typeName = "Telegram.type.UserEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; }::false userProfilePhotoEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'e1ba114f'; this._typeName = "Telegram.type.UserProfilePhotoEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false userProfilePhoto::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c8d859d5'; this._typeName = "Telegram.type.UserProfilePhoto"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writePhoto_id(); var photo_smallBytes = this.photo_small.serialize({isBare: false}); this._writeBytes(photo_smallBytes); var photo_bigBytes = this.photo_big.serialize({isBare: false}); this._writeBytes(photo_bigBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readPhoto_id(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', FileLocation, bytes.toString('hex'), 'FileLocation'); } var FileLocation = this.constructor.requireTypeFromBuffer(bytes); if (FileLocation) { var obj = new FileLocation({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.photo_small = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type FileLocation and buffer:' + this._buffer.toString('hex')); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', FileLocation, bytes.toString('hex'), 'FileLocation'); } var FileLocation = this.constructor.requireTypeFromBuffer(bytes); if (FileLocation) { var obj = new FileLocation({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.photo_big = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type FileLocation and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writePhoto_id = function __writePhoto_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'photo_id', this.photo_id); } this.writeLong(this.photo_id); }; this.__readPhoto_id = function __readPhoto_id() { this.photo_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'photo_id', this.photo_id, this._readOffset); } }; }::false userStatusEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '4950d009'; this._typeName = "Telegram.type.UserStatusEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false userStatusOnline::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '4939b9ed'; this._typeName = "Telegram.type.UserStatusOnline"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeExpires(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readExpires(); return this; }; this.__writeExpires = function __writeExpires() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'expires', this.expires); } this.writeInt(this.expires); }; this.__readExpires = function __readExpires() { this.expires = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'expires', this.expires, this._readOffset); } }; }::false userStatusOffline::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '3f708c00'; this._typeName = "Telegram.type.UserStatusOffline"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeWas_online(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readWas_online(); return this; }; this.__writeWas_online = function __writeWas_online() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'was_online', this.was_online); } this.writeInt(this.was_online); }; this.__readWas_online = function __readWas_online() { this.was_online = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'was_online', this.was_online, this._readOffset); } }; }::false chatEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '00d8a29b'; this._typeName = "Telegram.type.ChatEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; }::false chat::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '54dd1cd9'; this._typeName = "Telegram.type.Chat"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.creator ? (this.flags | 1) : (this.flags & ~1); this.flags = this.kicked ? (this.flags | 2) : (this.flags & ~2); this.flags = this.left ? (this.flags | 4) : (this.flags & ~4); this.flags = this.admins_enabled ? (this.flags | 8) : (this.flags & ~8); this.flags = this.admin ? (this.flags | 16) : (this.flags & ~16); this.flags = this.deactivated ? (this.flags | 32) : (this.flags & ~32); this.flags = this.migrated_to !== null ? (this.flags | 64) : (this.flags & ~64); this.__writeFlags(); this.__writeId(); this.__writeTitle(); var photoBytes = this.photo.serialize({isBare: false}); this._writeBytes(photoBytes); this.__writeParticipants_count(); this.__writeDate(); this.__writeVersion(); if (this.migrated_to) { var migrated_toBytes = this.migrated_to.serialize({isBare: false}); this._writeBytes(migrated_toBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 0)) !== 0) { this.__readCreator(); } if ((this.flags & (1 << 1)) !== 0) { this.__readKicked(); } if ((this.flags & (1 << 2)) !== 0) { this.__readLeft(); } if ((this.flags & (1 << 3)) !== 0) { this.__readAdmins_enabled(); } if ((this.flags & (1 << 4)) !== 0) { this.__readAdmin(); } if ((this.flags & (1 << 5)) !== 0) { this.__readDeactivated(); } this.__readId(); this.__readTitle(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ChatPhoto, bytes.toString('hex'), 'ChatPhoto'); } var ChatPhoto = this.constructor.requireTypeFromBuffer(bytes); if (ChatPhoto) { var obj = new ChatPhoto({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.photo = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ChatPhoto and buffer:' + this._buffer.toString('hex')); } this.__readParticipants_count(); this.__readDate(); this.__readVersion(); if ((this.flags & (1 << 6)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputChannel, bytes.toString('hex'), 'InputChannel'); } var InputChannel = this.constructor.requireTypeFromBuffer(bytes); if (InputChannel) { var obj = new InputChannel({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.migrated_to = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputChannel and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__writeTitle = function __writeTitle() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'title', this.title); } this.writeString(this.title); }; this.__writeParticipants_count = function __writeParticipants_count() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'participants_count', this.participants_count); } this.writeInt(this.participants_count); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__writeVersion = function __writeVersion() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'version', this.version); } this.writeInt(this.version); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readCreator = function __readCreator() { this.creator = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'creator', this.creator, this._readOffset); } }; this.__readKicked = function __readKicked() { this.kicked = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'kicked', this.kicked, this._readOffset); } }; this.__readLeft = function __readLeft() { this.left = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'left', this.left, this._readOffset); } }; this.__readAdmins_enabled = function __readAdmins_enabled() { this.admins_enabled = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'admins_enabled', this.admins_enabled, this._readOffset); } }; this.__readAdmin = function __readAdmin() { this.admin = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'admin', this.admin, this._readOffset); } }; this.__readDeactivated = function __readDeactivated() { this.deactivated = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'deactivated', this.deactivated, this._readOffset); } }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readTitle = function __readTitle() { this.title = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'title', this.title, this._readOffset); } }; this.__readParticipants_count = function __readParticipants_count() { this.participants_count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'participants_count', this.participants_count, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; this.__readVersion = function __readVersion() { this.version = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'version', this.version, this._readOffset); } }; }::false chatForbidden::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'db8b3207'; this._typeName = "Telegram.type.ChatForbidden"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeTitle(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readTitle(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__writeTitle = function __writeTitle() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'title', this.title); } this.writeString(this.title); }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readTitle = function __readTitle() { this.title = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'title', this.title, this._readOffset); } }; }::false chatFull::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '14a6022e'; this._typeName = "Telegram.type.ChatFull"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); var participantsBytes = this.participants.serialize({isBare: false}); this._writeBytes(participantsBytes); var chat_photoBytes = this.chat_photo.serialize({isBare: false}); this._writeBytes(chat_photoBytes); var notify_settingsBytes = this.notify_settings.serialize({isBare: false}); this._writeBytes(notify_settingsBytes); var exported_inviteBytes = this.exported_invite.serialize({isBare: false}); this._writeBytes(exported_inviteBytes); var bot_infoBytes = this.bot_info.serialize({isBare: false}); this._writeBytes(bot_infoBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ChatParticipants, bytes.toString('hex'), 'ChatParticipants'); } var ChatParticipants = this.constructor.requireTypeFromBuffer(bytes); if (ChatParticipants) { var obj = new ChatParticipants({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.participants = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ChatParticipants and buffer:' + this._buffer.toString('hex')); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Photo, bytes.toString('hex'), 'Photo'); } var Photo = this.constructor.requireTypeFromBuffer(bytes); if (Photo) { var obj = new Photo({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.chat_photo = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Photo and buffer:' + this._buffer.toString('hex')); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', PeerNotifySettings, bytes.toString('hex'), 'PeerNotifySettings'); } var PeerNotifySettings = this.constructor.requireTypeFromBuffer(bytes); if (PeerNotifySettings) { var obj = new PeerNotifySettings({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.notify_settings = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type PeerNotifySettings and buffer:' + this._buffer.toString('hex')); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ExportedChatInvite, bytes.toString('hex'), 'ExportedChatInvite'); } var ExportedChatInvite = this.constructor.requireTypeFromBuffer(bytes); if (ExportedChatInvite) { var obj = new ExportedChatInvite({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.exported_invite = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ExportedChatInvite and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'BotInfo', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.bot_info = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; }::false chatParticipant::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '3e49d7c8'; this._typeName = "Telegram.type.ChatParticipant"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); this.__writeInviter_id(); this.__writeDate(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); this.__readInviter_id(); this.__readDate(); return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writeInviter_id = function __writeInviter_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'inviter_id', this.inviter_id); } this.writeInt(this.inviter_id); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readInviter_id = function __readInviter_id() { this.inviter_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'inviter_id', this.inviter_id, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; }::false chatParticipantsForbidden::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '2b0c90fc'; this._typeName = "Telegram.type.ChatParticipantsForbidden"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.self_participant !== null ? (this.flags | 1) : (this.flags & ~1); this.__writeFlags(); this.__writeChat_id(); if (this.self_participant) { var self_participantBytes = this.self_participant.serialize({isBare: false}); this._writeBytes(self_participantBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); this.__readChat_id(); if ((this.flags & (1 << 0)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ChatParticipant, bytes.toString('hex'), 'ChatParticipant'); } var ChatParticipant = this.constructor.requireTypeFromBuffer(bytes); if (ChatParticipant) { var obj = new ChatParticipant({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.self_participant = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ChatParticipant and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeChat_id = function __writeChat_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'chat_id', this.chat_id); } this.writeInt(this.chat_id); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readChat_id = function __readChat_id() { this.chat_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'chat_id', this.chat_id, this._readOffset); } }; }::false chatParticipants::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'ed0f463f'; this._typeName = "Telegram.type.ChatParticipants"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeChat_id(); var participantsBytes = this.participants.serialize({isBare: false}); this._writeBytes(participantsBytes); this.__writeVersion(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readChat_id(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'ChatParticipant', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.participants = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } this.__readVersion(); return this; }; this.__writeChat_id = function __writeChat_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'chat_id', this.chat_id); } this.writeInt(this.chat_id); }; this.__writeVersion = function __writeVersion() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'version', this.version); } this.writeInt(this.version); }; this.__readChat_id = function __readChat_id() { this.chat_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'chat_id', this.chat_id, this._readOffset); } }; this.__readVersion = function __readVersion() { this.version = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'version', this.version, this._readOffset); } }; }::false chatPhotoEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '1c01c137'; this._typeName = "Telegram.type.ChatPhotoEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false chatPhoto::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '6a275361'; this._typeName = "Telegram.type.ChatPhoto"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var photo_smallBytes = this.photo_small.serialize({isBare: false}); this._writeBytes(photo_smallBytes); var photo_bigBytes = this.photo_big.serialize({isBare: false}); this._writeBytes(photo_bigBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', FileLocation, bytes.toString('hex'), 'FileLocation'); } var FileLocation = this.constructor.requireTypeFromBuffer(bytes); if (FileLocation) { var obj = new FileLocation({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.photo_small = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type FileLocation and buffer:' + this._buffer.toString('hex')); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', FileLocation, bytes.toString('hex'), 'FileLocation'); } var FileLocation = this.constructor.requireTypeFromBuffer(bytes); if (FileLocation) { var obj = new FileLocation({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.photo_big = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type FileLocation and buffer:' + this._buffer.toString('hex')); } return this; }; }::false messageEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '54dee583'; this._typeName = "Telegram.type.MessageEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; }::false message::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '5fe49bc0'; this._typeName = "Telegram.type.Message"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.out ? (this.flags | 2) : (this.flags & ~2); this.flags = this.mentioned ? (this.flags | 16) : (this.flags & ~16); this.flags = this.media_unread ? (this.flags | 32) : (this.flags & ~32); this.flags = this.silent ? (this.flags | 8192) : (this.flags & ~8192); this.flags = this.post ? (this.flags | 16384) : (this.flags & ~16384); this.flags = this.from_id !== null ? (this.flags | 256) : (this.flags & ~256); this.flags = this.fwd_from !== null ? (this.flags | 4) : (this.flags & ~4); this.flags = this.via_bot_id !== null ? (this.flags | 2048) : (this.flags & ~2048); this.flags = this.reply_to_msg_id !== null ? (this.flags | 8) : (this.flags & ~8); this.flags = this.media !== null ? (this.flags | 512) : (this.flags & ~512); this.flags = this.reply_markup !== null ? (this.flags | 64) : (this.flags & ~64); this.flags = this.entities !== null ? (this.flags | 128) : (this.flags & ~128); this.flags = this.views !== null ? (this.flags | 1024) : (this.flags & ~1024); this.flags = this.edit_date !== null ? (this.flags | 32768) : (this.flags & ~32768); this.__writeFlags(); this.__writeId(); if (this.from_id) { this.__writeFrom_id(); } var to_idBytes = this.to_id.serialize({isBare: false}); this._writeBytes(to_idBytes); if (this.fwd_from) { var fwd_fromBytes = this.fwd_from.serialize({isBare: false}); this._writeBytes(fwd_fromBytes); } if (this.via_bot_id) { this.__writeVia_bot_id(); } if (this.reply_to_msg_id) { this.__writeReply_to_msg_id(); } this.__writeDate(); this.__writeMessage(); if (this.media) { var mediaBytes = this.media.serialize({isBare: false}); this._writeBytes(mediaBytes); } if (this.reply_markup) { var reply_markupBytes = this.reply_markup.serialize({isBare: false}); this._writeBytes(reply_markupBytes); } if (this.entities) { var entitiesBytes = this.entities.serialize({isBare: false}); this._writeBytes(entitiesBytes); } if (this.views) { this.__writeViews(); } if (this.edit_date) { this.__writeEdit_date(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 1)) !== 0) { this.__readOut(); } if ((this.flags & (1 << 4)) !== 0) { this.__readMentioned(); } if ((this.flags & (1 << 5)) !== 0) { this.__readMedia_unread(); } if ((this.flags & (1 << 13)) !== 0) { this.__readSilent(); } if ((this.flags & (1 << 14)) !== 0) { this.__readPost(); } this.__readId(); if ((this.flags & (1 << 8)) !== 0) { this.__readFrom_id(); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Peer, bytes.toString('hex'), 'Peer'); } var Peer = this.constructor.requireTypeFromBuffer(bytes); if (Peer) { var obj = new Peer({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.to_id = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Peer and buffer:' + this._buffer.toString('hex')); } if ((this.flags & (1 << 2)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', MessageFwdHeader, bytes.toString('hex'), 'MessageFwdHeader'); } var MessageFwdHeader = this.constructor.requireTypeFromBuffer(bytes); if (MessageFwdHeader) { var obj = new MessageFwdHeader({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.fwd_from = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type MessageFwdHeader and buffer:' + this._buffer.toString('hex')); } } if ((this.flags & (1 << 11)) !== 0) { this.__readVia_bot_id(); } if ((this.flags & (1 << 3)) !== 0) { this.__readReply_to_msg_id(); } this.__readDate(); this.__readMessage(); if ((this.flags & (1 << 9)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', MessageMedia, bytes.toString('hex'), 'MessageMedia'); } var MessageMedia = this.constructor.requireTypeFromBuffer(bytes); if (MessageMedia) { var obj = new MessageMedia({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.media = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type MessageMedia and buffer:' + this._buffer.toString('hex')); } } if ((this.flags & (1 << 6)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ReplyMarkup, bytes.toString('hex'), 'ReplyMarkup'); } var ReplyMarkup = this.constructor.requireTypeFromBuffer(bytes); if (ReplyMarkup) { var obj = new ReplyMarkup({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.reply_markup = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ReplyMarkup and buffer:' + this._buffer.toString('hex')); } } if ((this.flags & (1 << 7)) !== 0) { var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'MessageEntity', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.entities = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } } if ((this.flags & (1 << 10)) !== 0) { this.__readViews(); } if ((this.flags & (1 << 15)) !== 0) { this.__readEdit_date(); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__writeFrom_id = function __writeFrom_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'from_id', this.from_id); } this.writeInt(this.from_id); }; this.__writeVia_bot_id = function __writeVia_bot_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'via_bot_id', this.via_bot_id); } this.writeInt(this.via_bot_id); }; this.__writeReply_to_msg_id = function __writeReply_to_msg_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'reply_to_msg_id', this.reply_to_msg_id); } this.writeInt(this.reply_to_msg_id); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__writeMessage = function __writeMessage() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'message', this.message); } this.writeString(this.message); }; this.__writeViews = function __writeViews() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'views', this.views); } this.writeInt(this.views); }; this.__writeEdit_date = function __writeEdit_date() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'edit_date', this.edit_date); } this.writeInt(this.edit_date); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readOut = function __readOut() { this.out = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'out', this.out, this._readOffset); } }; this.__readMentioned = function __readMentioned() { this.mentioned = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'mentioned', this.mentioned, this._readOffset); } }; this.__readMedia_unread = function __readMedia_unread() { this.media_unread = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'media_unread', this.media_unread, this._readOffset); } }; this.__readSilent = function __readSilent() { this.silent = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'silent', this.silent, this._readOffset); } }; this.__readPost = function __readPost() { this.post = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'post', this.post, this._readOffset); } }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readFrom_id = function __readFrom_id() { this.from_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'from_id', this.from_id, this._readOffset); } }; this.__readVia_bot_id = function __readVia_bot_id() { this.via_bot_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'via_bot_id', this.via_bot_id, this._readOffset); } }; this.__readReply_to_msg_id = function __readReply_to_msg_id() { this.reply_to_msg_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'reply_to_msg_id', this.reply_to_msg_id, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; this.__readMessage = function __readMessage() { this.message = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'message', this.message, this._readOffset); } }; this.__readViews = function __readViews() { this.views = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'views', this.views, this._readOffset); } }; this.__readEdit_date = function __readEdit_date() { this.edit_date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'edit_date', this.edit_date, this._readOffset); } }; }::false messageService::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'f6a1199e'; this._typeName = "Telegram.type.MessageService"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.out ? (this.flags | 2) : (this.flags & ~2); this.flags = this.mentioned ? (this.flags | 16) : (this.flags & ~16); this.flags = this.media_unread ? (this.flags | 32) : (this.flags & ~32); this.flags = this.silent ? (this.flags | 8192) : (this.flags & ~8192); this.flags = this.post ? (this.flags | 16384) : (this.flags & ~16384); this.flags = this.from_id !== null ? (this.flags | 256) : (this.flags & ~256); this.flags = this.reply_to_msg_id !== null ? (this.flags | 8) : (this.flags & ~8); this.__writeFlags(); this.__writeId(); if (this.from_id) { this.__writeFrom_id(); } var to_idBytes = this.to_id.serialize({isBare: false}); this._writeBytes(to_idBytes); if (this.reply_to_msg_id) { this.__writeReply_to_msg_id(); } this.__writeDate(); var actionBytes = this.action.serialize({isBare: false}); this._writeBytes(actionBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 1)) !== 0) { this.__readOut(); } if ((this.flags & (1 << 4)) !== 0) { this.__readMentioned(); } if ((this.flags & (1 << 5)) !== 0) { this.__readMedia_unread(); } if ((this.flags & (1 << 13)) !== 0) { this.__readSilent(); } if ((this.flags & (1 << 14)) !== 0) { this.__readPost(); } this.__readId(); if ((this.flags & (1 << 8)) !== 0) { this.__readFrom_id(); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Peer, bytes.toString('hex'), 'Peer'); } var Peer = this.constructor.requireTypeFromBuffer(bytes); if (Peer) { var obj = new Peer({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.to_id = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Peer and buffer:' + this._buffer.toString('hex')); } if ((this.flags & (1 << 3)) !== 0) { this.__readReply_to_msg_id(); } this.__readDate(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', MessageAction, bytes.toString('hex'), 'MessageAction'); } var MessageAction = this.constructor.requireTypeFromBuffer(bytes); if (MessageAction) { var obj = new MessageAction({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.action = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type MessageAction and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__writeFrom_id = function __writeFrom_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'from_id', this.from_id); } this.writeInt(this.from_id); }; this.__writeReply_to_msg_id = function __writeReply_to_msg_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'reply_to_msg_id', this.reply_to_msg_id); } this.writeInt(this.reply_to_msg_id); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readOut = function __readOut() { this.out = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'out', this.out, this._readOffset); } }; this.__readMentioned = function __readMentioned() { this.mentioned = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'mentioned', this.mentioned, this._readOffset); } }; this.__readMedia_unread = function __readMedia_unread() { this.media_unread = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'media_unread', this.media_unread, this._readOffset); } }; this.__readSilent = function __readSilent() { this.silent = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'silent', this.silent, this._readOffset); } }; this.__readPost = function __readPost() { this.post = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'post', this.post, this._readOffset); } }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readFrom_id = function __readFrom_id() { this.from_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'from_id', this.from_id, this._readOffset); } }; this.__readReply_to_msg_id = function __readReply_to_msg_id() { this.reply_to_msg_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'reply_to_msg_id', this.reply_to_msg_id, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; }::false messageMediaEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '2063ed3d'; this._typeName = "Telegram.type.MessageMediaEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false messageMediaPhoto::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '3de58c3d'; this._typeName = "Telegram.type.MessageMediaPhoto"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var photoBytes = this.photo.serialize({isBare: false}); this._writeBytes(photoBytes); this.__writeCaption(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Photo, bytes.toString('hex'), 'Photo'); } var Photo = this.constructor.requireTypeFromBuffer(bytes); if (Photo) { var obj = new Photo({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.photo = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Photo and buffer:' + this._buffer.toString('hex')); } this.__readCaption(); return this; }; this.__writeCaption = function __writeCaption() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'caption', this.caption); } this.writeString(this.caption); }; this.__readCaption = function __readCaption() { this.caption = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'caption', this.caption, this._readOffset); } }; }::false messageMediaGeo::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '74d4e056'; this._typeName = "Telegram.type.MessageMediaGeo"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var geoBytes = this.geo.serialize({isBare: false}); this._writeBytes(geoBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', GeoPoint, bytes.toString('hex'), 'GeoPoint'); } var GeoPoint = this.constructor.requireTypeFromBuffer(bytes); if (GeoPoint) { var obj = new GeoPoint({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.geo = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type GeoPoint and buffer:' + this._buffer.toString('hex')); } return this; }; }::false messageMediaContact::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '392f7d5e'; this._typeName = "Telegram.type.MessageMediaContact"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writePhone_number(); this.__writeFirst_name(); this.__writeLast_name(); this.__writeUser_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readPhone_number(); this.__readFirst_name(); this.__readLast_name(); this.__readUser_id(); return this; }; this.__writePhone_number = function __writePhone_number() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'phone_number', this.phone_number); } this.writeString(this.phone_number); }; this.__writeFirst_name = function __writeFirst_name() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'first_name', this.first_name); } this.writeString(this.first_name); }; this.__writeLast_name = function __writeLast_name() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'last_name', this.last_name); } this.writeString(this.last_name); }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__readPhone_number = function __readPhone_number() { this.phone_number = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'phone_number', this.phone_number, this._readOffset); } }; this.__readFirst_name = function __readFirst_name() { this.first_name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'first_name', this.first_name, this._readOffset); } }; this.__readLast_name = function __readLast_name() { this.last_name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'last_name', this.last_name, this._readOffset); } }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; }::false messageMediaUnsupported::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '9ef4849f'; this._typeName = "Telegram.type.MessageMediaUnsupported"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false messageActionEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'b0f7aeb6'; this._typeName = "Telegram.type.MessageActionEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false messageActionChatCreate::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '9a8b63a6'; this._typeName = "Telegram.type.MessageActionChatCreate"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeTitle(); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readTitle(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'int', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeTitle = function __writeTitle() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'title', this.title); } this.writeString(this.title); }; this.__readTitle = function __readTitle() { this.title = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'title', this.title, this._readOffset); } }; }::false messageActionChatEditTitle::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '5acea1b5'; this._typeName = "Telegram.type.MessageActionChatEditTitle"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeTitle(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readTitle(); return this; }; this.__writeTitle = function __writeTitle() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'title', this.title); } this.writeString(this.title); }; this.__readTitle = function __readTitle() { this.title = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'title', this.title, this._readOffset); } }; }::false messageActionChatEditPhoto::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a813cb7f'; this._typeName = "Telegram.type.MessageActionChatEditPhoto"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var photoBytes = this.photo.serialize({isBare: false}); this._writeBytes(photoBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Photo, bytes.toString('hex'), 'Photo'); } var Photo = this.constructor.requireTypeFromBuffer(bytes); if (Photo) { var obj = new Photo({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.photo = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Photo and buffer:' + this._buffer.toString('hex')); } return this; }; }::false messageActionChatDeletePhoto::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'effbe395'; this._typeName = "Telegram.type.MessageActionChatDeletePhoto"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false messageActionChatAddUser::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '37738a48'; this._typeName = "Telegram.type.MessageActionChatAddUser"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'int', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false messageActionChatDeleteUser::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '0c9baeb2'; this._typeName = "Telegram.type.MessageActionChatDeleteUser"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; }::false dialog::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '14baff66'; this._typeName = "Telegram.type.Dialog"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.pts !== null ? (this.flags | 1) : (this.flags & ~1); this.flags = this.draft !== null ? (this.flags | 2) : (this.flags & ~2); this.__writeFlags(); var peerBytes = this.peer.serialize({isBare: false}); this._writeBytes(peerBytes); this.__writeTop_message(); this.__writeRead_inbox_max_id(); this.__writeRead_outbox_max_id(); this.__writeUnread_count(); var notify_settingsBytes = this.notify_settings.serialize({isBare: false}); this._writeBytes(notify_settingsBytes); if (this.pts) { this.__writePts(); } if (this.draft) { var draftBytes = this.draft.serialize({isBare: false}); this._writeBytes(draftBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Peer, bytes.toString('hex'), 'Peer'); } var Peer = this.constructor.requireTypeFromBuffer(bytes); if (Peer) { var obj = new Peer({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.peer = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Peer and buffer:' + this._buffer.toString('hex')); } this.__readTop_message(); this.__readRead_inbox_max_id(); this.__readRead_outbox_max_id(); this.__readUnread_count(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', PeerNotifySettings, bytes.toString('hex'), 'PeerNotifySettings'); } var PeerNotifySettings = this.constructor.requireTypeFromBuffer(bytes); if (PeerNotifySettings) { var obj = new PeerNotifySettings({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.notify_settings = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type PeerNotifySettings and buffer:' + this._buffer.toString('hex')); } if ((this.flags & (1 << 0)) !== 0) { this.__readPts(); } if ((this.flags & (1 << 1)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', DraftMessage, bytes.toString('hex'), 'DraftMessage'); } var DraftMessage = this.constructor.requireTypeFromBuffer(bytes); if (DraftMessage) { var obj = new DraftMessage({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.draft = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type DraftMessage and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeTop_message = function __writeTop_message() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'top_message', this.top_message); } this.writeInt(this.top_message); }; this.__writeRead_inbox_max_id = function __writeRead_inbox_max_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'read_inbox_max_id', this.read_inbox_max_id); } this.writeInt(this.read_inbox_max_id); }; this.__writeRead_outbox_max_id = function __writeRead_outbox_max_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'read_outbox_max_id', this.read_outbox_max_id); } this.writeInt(this.read_outbox_max_id); }; this.__writeUnread_count = function __writeUnread_count() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'unread_count', this.unread_count); } this.writeInt(this.unread_count); }; this.__writePts = function __writePts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts', this.pts); } this.writeInt(this.pts); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readTop_message = function __readTop_message() { this.top_message = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'top_message', this.top_message, this._readOffset); } }; this.__readRead_inbox_max_id = function __readRead_inbox_max_id() { this.read_inbox_max_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'read_inbox_max_id', this.read_inbox_max_id, this._readOffset); } }; this.__readRead_outbox_max_id = function __readRead_outbox_max_id() { this.read_outbox_max_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'read_outbox_max_id', this.read_outbox_max_id, this._readOffset); } }; this.__readUnread_count = function __readUnread_count() { this.unread_count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'unread_count', this.unread_count, this._readOffset); } }; this.__readPts = function __readPts() { this.pts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts', this.pts, this._readOffset); } }; }::false photoEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '2db23123'; this._typeName = "Telegram.type.PhotoEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeLong(this.id); }; this.__readId = function __readId() { this.id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; }::false photo::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '29dd8892'; this._typeName = "Telegram.type.Photo"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.has_stickers ? (this.flags | 1) : (this.flags & ~1); this.__writeFlags(); this.__writeId(); this.__writeAccess_hash(); this.__writeDate(); var sizesBytes = this.sizes.serialize({isBare: false}); this._writeBytes(sizesBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 0)) !== 0) { this.__readHas_stickers(); } this.__readId(); this.__readAccess_hash(); this.__readDate(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'PhotoSize', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.sizes = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeLong(this.id); }; this.__writeAccess_hash = function __writeAccess_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'access_hash', this.access_hash); } this.writeLong(this.access_hash); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readHas_stickers = function __readHas_stickers() { this.has_stickers = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'has_stickers', this.has_stickers, this._readOffset); } }; this.__readId = function __readId() { this.id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readAccess_hash = function __readAccess_hash() { this.access_hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'access_hash', this.access_hash, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; }::false photoSizeEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '3ce2170e'; this._typeName = "Telegram.type.PhotoSizeEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeType(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readType(); return this; }; this.__writeType = function __writeType() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'type', this.type); } this.writeString(this.type); }; this.__readType = function __readType() { this.type = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'type', this.type, this._readOffset); } }; }::false photoSize::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '1bb6bf77'; this._typeName = "Telegram.type.PhotoSize"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeType(); var locationBytes = this.location.serialize({isBare: false}); this._writeBytes(locationBytes); this.__writeW(); this.__writeH(); this.__writeSize(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readType(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', FileLocation, bytes.toString('hex'), 'FileLocation'); } var FileLocation = this.constructor.requireTypeFromBuffer(bytes); if (FileLocation) { var obj = new FileLocation({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.location = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type FileLocation and buffer:' + this._buffer.toString('hex')); } this.__readW(); this.__readH(); this.__readSize(); return this; }; this.__writeType = function __writeType() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'type', this.type); } this.writeString(this.type); }; this.__writeW = function __writeW() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'w', this.w); } this.writeInt(this.w); }; this.__writeH = function __writeH() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'h', this.h); } this.writeInt(this.h); }; this.__writeSize = function __writeSize() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'size', this.size); } this.writeInt(this.size); }; this.__readType = function __readType() { this.type = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'type', this.type, this._readOffset); } }; this.__readW = function __readW() { this.w = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'w', this.w, this._readOffset); } }; this.__readH = function __readH() { this.h = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'h', this.h, this._readOffset); } }; this.__readSize = function __readSize() { this.size = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'size', this.size, this._readOffset); } }; }::false photoCachedSize::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'fa34a7e9'; this._typeName = "Telegram.type.PhotoCachedSize"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeType(); var locationBytes = this.location.serialize({isBare: false}); this._writeBytes(locationBytes); this.__writeW(); this.__writeH(); this.__writeBytes(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readType(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', FileLocation, bytes.toString('hex'), 'FileLocation'); } var FileLocation = this.constructor.requireTypeFromBuffer(bytes); if (FileLocation) { var obj = new FileLocation({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.location = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type FileLocation and buffer:' + this._buffer.toString('hex')); } this.__readW(); this.__readH(); this.__readBytes(); return this; }; this.__writeType = function __writeType() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'type', this.type); } this.writeString(this.type); }; this.__writeW = function __writeW() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'w', this.w); } this.writeInt(this.w); }; this.__writeH = function __writeH() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'h', this.h); } this.writeInt(this.h); }; this.__writeBytes = function __writeBytes() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'bytes', this.bytes.toString('hex')); } this.writeBytes(this.bytes); }; this.__readType = function __readType() { this.type = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'type', this.type, this._readOffset); } }; this.__readW = function __readW() { this.w = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'w', this.w, this._readOffset); } }; this.__readH = function __readH() { this.h = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'h', this.h, this._readOffset); } }; this.__readBytes = function __readBytes() { this.bytes = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'bytes', this.bytes.toString('hex'), this._readOffset); } }; }::false geoPointEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '5fdd1711'; this._typeName = "Telegram.type.GeoPointEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false geoPoint::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '0cd74920'; this._typeName = "Telegram.type.GeoPoint"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeLong(); this.__writeLat(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readLong(); this.__readLat(); return this; }; this.__writeLong = function __writeLong() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'long', this.long); } this.writeDouble(this.long); }; this.__writeLat = function __writeLat() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'lat', this.lat); } this.writeDouble(this.lat); }; this.__readLong = function __readLong() { this.long = this.readDouble(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'long', this.long, this._readOffset); } }; this.__readLat = function __readLat() { this.lat = this.readDouble(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'lat', this.lat, this._readOffset); } }; }::false auth.checkedPhone::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '8ea21e81'; this._typeName = "Telegram.type.auth.CheckedPhone"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var phone_registeredBytes = this.phone_registered.serialize({isBare: false}); this._writeBytes(phone_registeredBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Bool, bytes.toString('hex'), 'Bool'); } var Bool = this.constructor.requireTypeFromBuffer(bytes); if (Bool) { var obj = new Bool({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.phone_registered = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Bool and buffer:' + this._buffer.toString('hex')); } return this; }; }::false auth.sentCode::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '0225005e'; this._typeName = "Telegram.type.auth.SentCode"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.phone_registered ? (this.flags | 1) : (this.flags & ~1); this.flags = this.next_type !== null ? (this.flags | 2) : (this.flags & ~2); this.flags = this.timeout !== null ? (this.flags | 4) : (this.flags & ~4); this.__writeFlags(); var typeBytes = this.type.serialize({isBare: false}); this._writeBytes(typeBytes); this.__writePhone_code_hash(); if (this.next_type) { var next_typeBytes = this.next_type.serialize({isBare: false}); this._writeBytes(next_typeBytes); } if (this.timeout) { this.__writeTimeout(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 0)) !== 0) { this.__readPhone_registered(); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', auth_SentCodeType, bytes.toString('hex'), 'auth_SentCodeType'); } var auth_SentCodeType = this.constructor.requireTypeFromBuffer(bytes); if (auth_SentCodeType) { var obj = new auth_SentCodeType({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.type = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type auth_SentCodeType and buffer:' + this._buffer.toString('hex')); } this.__readPhone_code_hash(); if ((this.flags & (1 << 1)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', auth_CodeType, bytes.toString('hex'), 'auth_CodeType'); } var auth_CodeType = this.constructor.requireTypeFromBuffer(bytes); if (auth_CodeType) { var obj = new auth_CodeType({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.next_type = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type auth_CodeType and buffer:' + this._buffer.toString('hex')); } } if ((this.flags & (1 << 2)) !== 0) { this.__readTimeout(); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writePhone_code_hash = function __writePhone_code_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'phone_code_hash', this.phone_code_hash); } this.writeString(this.phone_code_hash); }; this.__writeTimeout = function __writeTimeout() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'timeout', this.timeout); } this.writeInt(this.timeout); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readPhone_registered = function __readPhone_registered() { this.phone_registered = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'phone_registered', this.phone_registered, this._readOffset); } }; this.__readPhone_code_hash = function __readPhone_code_hash() { this.phone_code_hash = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'phone_code_hash', this.phone_code_hash, this._readOffset); } }; this.__readTimeout = function __readTimeout() { this.timeout = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'timeout', this.timeout, this._readOffset); } }; }::false auth.authorization::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '160905cd'; this._typeName = "Telegram.type.auth.Authorization"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.tmp_sessions !== null ? (this.flags | 1) : (this.flags & ~1); this.__writeFlags(); if (this.tmp_sessions) { this.__writeTmp_sessions(); } var userBytes = this.user.serialize({isBare: false}); this._writeBytes(userBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 0)) !== 0) { this.__readTmp_sessions(); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', User, bytes.toString('hex'), 'User'); } var User = this.constructor.requireTypeFromBuffer(bytes); if (User) { var obj = new User({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.user = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type User and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeTmp_sessions = function __writeTmp_sessions() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'tmp_sessions', this.tmp_sessions); } this.writeInt(this.tmp_sessions); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readTmp_sessions = function __readTmp_sessions() { this.tmp_sessions = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'tmp_sessions', this.tmp_sessions, this._readOffset); } }; }::false auth.exportedAuthorization::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '2d9c96df'; this._typeName = "Telegram.type.auth.ExportedAuthorization"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeBytes(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readBytes(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__writeBytes = function __writeBytes() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'bytes', this.bytes.toString('hex')); } this.writeBytes(this.bytes); }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readBytes = function __readBytes() { this.bytes = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'bytes', this.bytes.toString('hex'), this._readOffset); } }; }::false inputNotifyPeer::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '0c5bbcb8'; this._typeName = "Telegram.type.InputNotifyPeer"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var peerBytes = this.peer.serialize({isBare: false}); this._writeBytes(peerBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputPeer, bytes.toString('hex'), 'InputPeer'); } var InputPeer = this.constructor.requireTypeFromBuffer(bytes); if (InputPeer) { var obj = new InputPeer({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.peer = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputPeer and buffer:' + this._buffer.toString('hex')); } return this; }; }::false inputNotifyUsers::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '17443b19'; this._typeName = "Telegram.type.InputNotifyUsers"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputNotifyChats::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '4ee8954a'; this._typeName = "Telegram.type.InputNotifyChats"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputNotifyAll::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '86b829a4'; this._typeName = "Telegram.type.InputNotifyAll"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputPeerNotifyEventsEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'd86430f0'; this._typeName = "Telegram.type.InputPeerNotifyEventsEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputPeerNotifyEventsAll::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '742c6ae8'; this._typeName = "Telegram.type.InputPeerNotifyEventsAll"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputPeerNotifySettings::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'b25e9338'; this._typeName = "Telegram.type.InputPeerNotifySettings"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.show_previews ? (this.flags | 1) : (this.flags & ~1); this.flags = this.silent ? (this.flags | 2) : (this.flags & ~2); this.__writeFlags(); this.__writeMute_until(); this.__writeSound(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 0)) !== 0) { this.__readShow_previews(); } if ((this.flags & (1 << 1)) !== 0) { this.__readSilent(); } this.__readMute_until(); this.__readSound(); return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeMute_until = function __writeMute_until() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'mute_until', this.mute_until); } this.writeInt(this.mute_until); }; this.__writeSound = function __writeSound() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'sound', this.sound); } this.writeString(this.sound); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readShow_previews = function __readShow_previews() { this.show_previews = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'show_previews', this.show_previews, this._readOffset); } }; this.__readSilent = function __readSilent() { this.silent = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'silent', this.silent, this._readOffset); } }; this.__readMute_until = function __readMute_until() { this.mute_until = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'mute_until', this.mute_until, this._readOffset); } }; this.__readSound = function __readSound() { this.sound = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'sound', this.sound, this._readOffset); } }; }::false peerNotifyEventsEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'b33cd5ad'; this._typeName = "Telegram.type.PeerNotifyEventsEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false peerNotifyEventsAll::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '88ed1d6d'; this._typeName = "Telegram.type.PeerNotifyEventsAll"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false peerNotifySettingsEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '1285a670'; this._typeName = "Telegram.type.PeerNotifySettingsEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false peerNotifySettings::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c0a4cd9a'; this._typeName = "Telegram.type.PeerNotifySettings"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.show_previews ? (this.flags | 1) : (this.flags & ~1); this.flags = this.silent ? (this.flags | 2) : (this.flags & ~2); this.__writeFlags(); this.__writeMute_until(); this.__writeSound(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 0)) !== 0) { this.__readShow_previews(); } if ((this.flags & (1 << 1)) !== 0) { this.__readSilent(); } this.__readMute_until(); this.__readSound(); return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeMute_until = function __writeMute_until() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'mute_until', this.mute_until); } this.writeInt(this.mute_until); }; this.__writeSound = function __writeSound() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'sound', this.sound); } this.writeString(this.sound); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readShow_previews = function __readShow_previews() { this.show_previews = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'show_previews', this.show_previews, this._readOffset); } }; this.__readSilent = function __readSilent() { this.silent = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'silent', this.silent, this._readOffset); } }; this.__readMute_until = function __readMute_until() { this.mute_until = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'mute_until', this.mute_until, this._readOffset); } }; this.__readSound = function __readSound() { this.sound = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'sound', this.sound, this._readOffset); } }; }::false peerSettings::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'cd268481'; this._typeName = "Telegram.type.PeerSettings"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.report_spam ? (this.flags | 1) : (this.flags & ~1); this.__writeFlags(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 0)) !== 0) { this.__readReport_spam(); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readReport_spam = function __readReport_spam() { this.report_spam = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'report_spam', this.report_spam, this._readOffset); } }; }::false wallPaper::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '5736b0cc'; this._typeName = "Telegram.type.WallPaper"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeTitle(); var sizesBytes = this.sizes.serialize({isBare: false}); this._writeBytes(sizesBytes); this.__writeColor(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readTitle(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'PhotoSize', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.sizes = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } this.__readColor(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__writeTitle = function __writeTitle() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'title', this.title); } this.writeString(this.title); }; this.__writeColor = function __writeColor() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'color', this.color); } this.writeInt(this.color); }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readTitle = function __readTitle() { this.title = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'title', this.title, this._readOffset); } }; this.__readColor = function __readColor() { this.color = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'color', this.color, this._readOffset); } }; }::false inputReportReasonSpam::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'b8cadb58'; this._typeName = "Telegram.type.InputReportReasonSpam"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputReportReasonViolence::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '8dc7221e'; this._typeName = "Telegram.type.InputReportReasonViolence"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputReportReasonPornography::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '22d9592e'; this._typeName = "Telegram.type.InputReportReasonPornography"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputReportReasonOther::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '0a6d74e1'; this._typeName = "Telegram.type.InputReportReasonOther"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeText(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readText(); return this; }; this.__writeText = function __writeText() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'text', this.text); } this.writeString(this.text); }; this.__readText = function __readText() { this.text = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'text', this.text, this._readOffset); } }; }::false userFull::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '03fc3259'; this._typeName = "Telegram.type.UserFull"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.blocked ? (this.flags | 1) : (this.flags & ~1); this.flags = this.about !== null ? (this.flags | 2) : (this.flags & ~2); this.flags = this.profile_photo !== null ? (this.flags | 4) : (this.flags & ~4); this.flags = this.bot_info !== null ? (this.flags | 8) : (this.flags & ~8); this.__writeFlags(); var userBytes = this.user.serialize({isBare: false}); this._writeBytes(userBytes); if (this.about) { this.__writeAbout(); } var linkBytes = this.link.serialize({isBare: false}); this._writeBytes(linkBytes); if (this.profile_photo) { var profile_photoBytes = this.profile_photo.serialize({isBare: false}); this._writeBytes(profile_photoBytes); } var notify_settingsBytes = this.notify_settings.serialize({isBare: false}); this._writeBytes(notify_settingsBytes); if (this.bot_info) { var bot_infoBytes = this.bot_info.serialize({isBare: false}); this._writeBytes(bot_infoBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 0)) !== 0) { this.__readBlocked(); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', User, bytes.toString('hex'), 'User'); } var User = this.constructor.requireTypeFromBuffer(bytes); if (User) { var obj = new User({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.user = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type User and buffer:' + this._buffer.toString('hex')); } if ((this.flags & (1 << 1)) !== 0) { this.__readAbout(); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', contacts_Link, bytes.toString('hex'), 'contacts_Link'); } var contacts_Link = this.constructor.requireTypeFromBuffer(bytes); if (contacts_Link) { var obj = new contacts_Link({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.link = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type contacts_Link and buffer:' + this._buffer.toString('hex')); } if ((this.flags & (1 << 2)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Photo, bytes.toString('hex'), 'Photo'); } var Photo = this.constructor.requireTypeFromBuffer(bytes); if (Photo) { var obj = new Photo({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.profile_photo = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Photo and buffer:' + this._buffer.toString('hex')); } } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', PeerNotifySettings, bytes.toString('hex'), 'PeerNotifySettings'); } var PeerNotifySettings = this.constructor.requireTypeFromBuffer(bytes); if (PeerNotifySettings) { var obj = new PeerNotifySettings({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.notify_settings = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type PeerNotifySettings and buffer:' + this._buffer.toString('hex')); } if ((this.flags & (1 << 3)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', BotInfo, bytes.toString('hex'), 'BotInfo'); } var BotInfo = this.constructor.requireTypeFromBuffer(bytes); if (BotInfo) { var obj = new BotInfo({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.bot_info = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type BotInfo and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeAbout = function __writeAbout() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'about', this.about); } this.writeString(this.about); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readBlocked = function __readBlocked() { this.blocked = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'blocked', this.blocked, this._readOffset); } }; this.__readAbout = function __readAbout() { this.about = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'about', this.about, this._readOffset); } }; }::false contact::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '94c911f9'; this._typeName = "Telegram.type.Contact"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); var mutualBytes = this.mutual.serialize({isBare: false}); this._writeBytes(mutualBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Bool, bytes.toString('hex'), 'Bool'); } var Bool = this.constructor.requireTypeFromBuffer(bytes); if (Bool) { var obj = new Bool({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.mutual = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Bool and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; }::false importedContact::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '388402d0'; this._typeName = "Telegram.type.ImportedContact"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); this.__writeClient_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); this.__readClient_id(); return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writeClient_id = function __writeClient_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'client_id', this.client_id); } this.writeLong(this.client_id); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readClient_id = function __readClient_id() { this.client_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'client_id', this.client_id, this._readOffset); } }; }::false contactBlocked::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '79c81b56'; this._typeName = "Telegram.type.ContactBlocked"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); this.__writeDate(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); this.__readDate(); return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; }::false contactStatus::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '610c68d3'; this._typeName = "Telegram.type.ContactStatus"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); var statusBytes = this.status.serialize({isBare: false}); this._writeBytes(statusBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', UserStatus, bytes.toString('hex'), 'UserStatus'); } var UserStatus = this.constructor.requireTypeFromBuffer(bytes); if (UserStatus) { var obj = new UserStatus({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.status = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type UserStatus and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; }::false contacts.link::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '4c48ce3a'; this._typeName = "Telegram.type.contacts.Link"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var my_linkBytes = this.my_link.serialize({isBare: false}); this._writeBytes(my_linkBytes); var foreign_linkBytes = this.foreign_link.serialize({isBare: false}); this._writeBytes(foreign_linkBytes); var userBytes = this.user.serialize({isBare: false}); this._writeBytes(userBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ContactLink, bytes.toString('hex'), 'ContactLink'); } var ContactLink = this.constructor.requireTypeFromBuffer(bytes); if (ContactLink) { var obj = new ContactLink({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.my_link = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ContactLink and buffer:' + this._buffer.toString('hex')); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ContactLink, bytes.toString('hex'), 'ContactLink'); } var ContactLink = this.constructor.requireTypeFromBuffer(bytes); if (ContactLink) { var obj = new ContactLink({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.foreign_link = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ContactLink and buffer:' + this._buffer.toString('hex')); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', User, bytes.toString('hex'), 'User'); } var User = this.constructor.requireTypeFromBuffer(bytes); if (User) { var obj = new User({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.user = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type User and buffer:' + this._buffer.toString('hex')); } return this; }; }::false contacts.contactsNotModified::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'd2a94bb7'; this._typeName = "Telegram.type.contacts.ContactsNotModified"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false contacts.contacts::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'b28c8b6f'; this._typeName = "Telegram.type.contacts.Contacts"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var contactsBytes = this.contacts.serialize({isBare: false}); this._writeBytes(contactsBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Contact', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.contacts = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false contacts.importedContacts::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '154352ad'; this._typeName = "Telegram.type.contacts.ImportedContacts"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var importedBytes = this.imported.serialize({isBare: false}); this._writeBytes(importedBytes); var retry_contactsBytes = this.retry_contacts.serialize({isBare: false}); this._writeBytes(retry_contactsBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'ImportedContact', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.imported = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'long', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.retry_contacts = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false contacts.blocked::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '158d131c'; this._typeName = "Telegram.type.contacts.Blocked"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var blockedBytes = this.blocked.serialize({isBare: false}); this._writeBytes(blockedBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'ContactBlocked', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.blocked = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false contacts.blockedSlice::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a1020890'; this._typeName = "Telegram.type.contacts.BlockedSlice"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeCount(); var blockedBytes = this.blocked.serialize({isBare: false}); this._writeBytes(blockedBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readCount(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'ContactBlocked', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.blocked = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeCount = function __writeCount() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'count', this.count); } this.writeInt(this.count); }; this.__readCount = function __readCount() { this.count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'count', this.count, this._readOffset); } }; }::false messages.dialogs::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '406cba15'; this._typeName = "Telegram.type.messages.Dialogs"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var dialogsBytes = this.dialogs.serialize({isBare: false}); this._writeBytes(dialogsBytes); var messagesBytes = this.messages.serialize({isBare: false}); this._writeBytes(messagesBytes); var chatsBytes = this.chats.serialize({isBare: false}); this._writeBytes(chatsBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Dialog', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.dialogs = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Message', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.messages = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Chat', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.chats = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false messages.dialogsSlice::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'f394e071'; this._typeName = "Telegram.type.messages.DialogsSlice"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeCount(); var dialogsBytes = this.dialogs.serialize({isBare: false}); this._writeBytes(dialogsBytes); var messagesBytes = this.messages.serialize({isBare: false}); this._writeBytes(messagesBytes); var chatsBytes = this.chats.serialize({isBare: false}); this._writeBytes(chatsBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readCount(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Dialog', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.dialogs = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Message', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.messages = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Chat', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.chats = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeCount = function __writeCount() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'count', this.count); } this.writeInt(this.count); }; this.__readCount = function __readCount() { this.count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'count', this.count, this._readOffset); } }; }::false messages.messages::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '878e718c'; this._typeName = "Telegram.type.messages.Messages"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var messagesBytes = this.messages.serialize({isBare: false}); this._writeBytes(messagesBytes); var chatsBytes = this.chats.serialize({isBare: false}); this._writeBytes(chatsBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Message', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.messages = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Chat', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.chats = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false messages.messagesSlice::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'e36a440b'; this._typeName = "Telegram.type.messages.MessagesSlice"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeCount(); var messagesBytes = this.messages.serialize({isBare: false}); this._writeBytes(messagesBytes); var chatsBytes = this.chats.serialize({isBare: false}); this._writeBytes(chatsBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readCount(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Message', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.messages = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Chat', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.chats = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeCount = function __writeCount() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'count', this.count); } this.writeInt(this.count); }; this.__readCount = function __readCount() { this.count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'count', this.count, this._readOffset); } }; }::false messages.chats::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'd59fff64'; this._typeName = "Telegram.type.messages.Chats"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var chatsBytes = this.chats.serialize({isBare: false}); this._writeBytes(chatsBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Chat', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.chats = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false messages.chatFull::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '9cd1d7e5'; this._typeName = "Telegram.type.messages.ChatFull"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var full_chatBytes = this.full_chat.serialize({isBare: false}); this._writeBytes(full_chatBytes); var chatsBytes = this.chats.serialize({isBare: false}); this._writeBytes(chatsBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ChatFull, bytes.toString('hex'), 'ChatFull'); } var ChatFull = this.constructor.requireTypeFromBuffer(bytes); if (ChatFull) { var obj = new ChatFull({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.full_chat = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ChatFull and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Chat', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.chats = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false messages.affectedHistory::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'd1695cb4'; this._typeName = "Telegram.type.messages.AffectedHistory"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writePts(); this.__writePts_count(); this.__writeOffset(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readPts(); this.__readPts_count(); this.__readOffset(); return this; }; this.__writePts = function __writePts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts', this.pts); } this.writeInt(this.pts); }; this.__writePts_count = function __writePts_count() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts_count', this.pts_count); } this.writeInt(this.pts_count); }; this.__writeOffset = function __writeOffset() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'offset', this.offset); } this.writeInt(this.offset); }; this.__readPts = function __readPts() { this.pts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts', this.pts, this._readOffset); } }; this.__readPts_count = function __readPts_count() { this.pts_count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts_count', this.pts_count, this._readOffset); } }; this.__readOffset = function __readOffset() { this.offset = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'offset', this.offset, this._readOffset); } }; }::false inputMessagesFilterEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '6cf6e257'; this._typeName = "Telegram.type.InputMessagesFilterEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputMessagesFilterPhotos::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '1ca50996'; this._typeName = "Telegram.type.InputMessagesFilterPhotos"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputMessagesFilterVideo::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '650ec09f'; this._typeName = "Telegram.type.InputMessagesFilterVideo"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputMessagesFilterPhotoVideo::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'e4f0e956'; this._typeName = "Telegram.type.InputMessagesFilterPhotoVideo"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputMessagesFilterPhotoVideoDocuments::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'bb735ed9'; this._typeName = "Telegram.type.InputMessagesFilterPhotoVideoDocuments"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputMessagesFilterDocument::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '88f1dd9e'; this._typeName = "Telegram.type.InputMessagesFilterDocument"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputMessagesFilterUrl::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '87ddf07e'; this._typeName = "Telegram.type.InputMessagesFilterUrl"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputMessagesFilterGif::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '8765c8ff'; this._typeName = "Telegram.type.InputMessagesFilterGif"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false updateNewMessage::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'fd0a2b1f'; this._typeName = "Telegram.type.UpdateNewMessage"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var messageBytes = this.message.serialize({isBare: false}); this._writeBytes(messageBytes); this.__writePts(); this.__writePts_count(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Message, bytes.toString('hex'), 'Message'); } var Message = this.constructor.requireTypeFromBuffer(bytes); if (Message) { var obj = new Message({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.message = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Message and buffer:' + this._buffer.toString('hex')); } this.__readPts(); this.__readPts_count(); return this; }; this.__writePts = function __writePts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts', this.pts); } this.writeInt(this.pts); }; this.__writePts_count = function __writePts_count() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts_count', this.pts_count); } this.writeInt(this.pts_count); }; this.__readPts = function __readPts() { this.pts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts', this.pts, this._readOffset); } }; this.__readPts_count = function __readPts_count() { this.pts_count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts_count', this.pts_count, this._readOffset); } }; }::false updateMessageID::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'd6bf904e'; this._typeName = "Telegram.type.UpdateMessageID"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeRandom_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readRandom_id(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__writeRandom_id = function __writeRandom_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'random_id', this.random_id); } this.writeLong(this.random_id); }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readRandom_id = function __readRandom_id() { this.random_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'random_id', this.random_id, this._readOffset); } }; }::false updateDeleteMessages::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'e5b00da2'; this._typeName = "Telegram.type.UpdateDeleteMessages"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var messagesBytes = this.messages.serialize({isBare: false}); this._writeBytes(messagesBytes); this.__writePts(); this.__writePts_count(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'int', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.messages = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } this.__readPts(); this.__readPts_count(); return this; }; this.__writePts = function __writePts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts', this.pts); } this.writeInt(this.pts); }; this.__writePts_count = function __writePts_count() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts_count', this.pts_count); } this.writeInt(this.pts_count); }; this.__readPts = function __readPts() { this.pts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts', this.pts, this._readOffset); } }; this.__readPts_count = function __readPts_count() { this.pts_count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts_count', this.pts_count, this._readOffset); } }; }::false updateUserTyping::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '2769485c'; this._typeName = "Telegram.type.UpdateUserTyping"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); var actionBytes = this.action.serialize({isBare: false}); this._writeBytes(actionBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', SendMessageAction, bytes.toString('hex'), 'SendMessageAction'); } var SendMessageAction = this.constructor.requireTypeFromBuffer(bytes); if (SendMessageAction) { var obj = new SendMessageAction({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.action = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type SendMessageAction and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; }::false updateChatUserTyping::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '1fea659a'; this._typeName = "Telegram.type.UpdateChatUserTyping"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeChat_id(); this.__writeUser_id(); var actionBytes = this.action.serialize({isBare: false}); this._writeBytes(actionBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readChat_id(); this.__readUser_id(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', SendMessageAction, bytes.toString('hex'), 'SendMessageAction'); } var SendMessageAction = this.constructor.requireTypeFromBuffer(bytes); if (SendMessageAction) { var obj = new SendMessageAction({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.action = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type SendMessageAction and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeChat_id = function __writeChat_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'chat_id', this.chat_id); } this.writeInt(this.chat_id); }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__readChat_id = function __readChat_id() { this.chat_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'chat_id', this.chat_id, this._readOffset); } }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; }::false updateChatParticipants::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '98117607'; this._typeName = "Telegram.type.UpdateChatParticipants"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var participantsBytes = this.participants.serialize({isBare: false}); this._writeBytes(participantsBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ChatParticipants, bytes.toString('hex'), 'ChatParticipants'); } var ChatParticipants = this.constructor.requireTypeFromBuffer(bytes); if (ChatParticipants) { var obj = new ChatParticipants({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.participants = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ChatParticipants and buffer:' + this._buffer.toString('hex')); } return this; }; }::false updateUserStatus::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '23d8fb1b'; this._typeName = "Telegram.type.UpdateUserStatus"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); var statusBytes = this.status.serialize({isBare: false}); this._writeBytes(statusBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', UserStatus, bytes.toString('hex'), 'UserStatus'); } var UserStatus = this.constructor.requireTypeFromBuffer(bytes); if (UserStatus) { var obj = new UserStatus({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.status = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type UserStatus and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; }::false updateUserName::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '732b33a7'; this._typeName = "Telegram.type.UpdateUserName"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); this.__writeFirst_name(); this.__writeLast_name(); this.__writeUsername(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); this.__readFirst_name(); this.__readLast_name(); this.__readUsername(); return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writeFirst_name = function __writeFirst_name() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'first_name', this.first_name); } this.writeString(this.first_name); }; this.__writeLast_name = function __writeLast_name() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'last_name', this.last_name); } this.writeString(this.last_name); }; this.__writeUsername = function __writeUsername() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'username', this.username); } this.writeString(this.username); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readFirst_name = function __readFirst_name() { this.first_name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'first_name', this.first_name, this._readOffset); } }; this.__readLast_name = function __readLast_name() { this.last_name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'last_name', this.last_name, this._readOffset); } }; this.__readUsername = function __readUsername() { this.username = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'username', this.username, this._readOffset); } }; }::false updateUserPhoto::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '0c3b3195'; this._typeName = "Telegram.type.UpdateUserPhoto"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); this.__writeDate(); var photoBytes = this.photo.serialize({isBare: false}); this._writeBytes(photoBytes); var previousBytes = this.previous.serialize({isBare: false}); this._writeBytes(previousBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); this.__readDate(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', UserProfilePhoto, bytes.toString('hex'), 'UserProfilePhoto'); } var UserProfilePhoto = this.constructor.requireTypeFromBuffer(bytes); if (UserProfilePhoto) { var obj = new UserProfilePhoto({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.photo = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type UserProfilePhoto and buffer:' + this._buffer.toString('hex')); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Bool, bytes.toString('hex'), 'Bool'); } var Bool = this.constructor.requireTypeFromBuffer(bytes); if (Bool) { var obj = new Bool({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.previous = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Bool and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; }::false updateContactRegistered::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'b9bb7525'; this._typeName = "Telegram.type.UpdateContactRegistered"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); this.__writeDate(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); this.__readDate(); return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; }::false updateContactLink::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c5672e9d'; this._typeName = "Telegram.type.UpdateContactLink"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); var my_linkBytes = this.my_link.serialize({isBare: false}); this._writeBytes(my_linkBytes); var foreign_linkBytes = this.foreign_link.serialize({isBare: false}); this._writeBytes(foreign_linkBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ContactLink, bytes.toString('hex'), 'ContactLink'); } var ContactLink = this.constructor.requireTypeFromBuffer(bytes); if (ContactLink) { var obj = new ContactLink({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.my_link = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ContactLink and buffer:' + this._buffer.toString('hex')); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ContactLink, bytes.toString('hex'), 'ContactLink'); } var ContactLink = this.constructor.requireTypeFromBuffer(bytes); if (ContactLink) { var obj = new ContactLink({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.foreign_link = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ContactLink and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; }::false updateNewAuthorization::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '9a52068f'; this._typeName = "Telegram.type.UpdateNewAuthorization"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeAuth_key_id(); this.__writeDate(); this.__writeDevice(); this.__writeLocation(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readAuth_key_id(); this.__readDate(); this.__readDevice(); this.__readLocation(); return this; }; this.__writeAuth_key_id = function __writeAuth_key_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'auth_key_id', this.auth_key_id); } this.writeLong(this.auth_key_id); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__writeDevice = function __writeDevice() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'device', this.device); } this.writeString(this.device); }; this.__writeLocation = function __writeLocation() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'location', this.location); } this.writeString(this.location); }; this.__readAuth_key_id = function __readAuth_key_id() { this.auth_key_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'auth_key_id', this.auth_key_id, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; this.__readDevice = function __readDevice() { this.device = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'device', this.device, this._readOffset); } }; this.__readLocation = function __readLocation() { this.location = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'location', this.location, this._readOffset); } }; }::false updates.state::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '3e2a6ca5'; this._typeName = "Telegram.type.updates.State"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writePts(); this.__writeQts(); this.__writeDate(); this.__writeSeq(); this.__writeUnread_count(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readPts(); this.__readQts(); this.__readDate(); this.__readSeq(); this.__readUnread_count(); return this; }; this.__writePts = function __writePts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts', this.pts); } this.writeInt(this.pts); }; this.__writeQts = function __writeQts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'qts', this.qts); } this.writeInt(this.qts); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__writeSeq = function __writeSeq() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'seq', this.seq); } this.writeInt(this.seq); }; this.__writeUnread_count = function __writeUnread_count() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'unread_count', this.unread_count); } this.writeInt(this.unread_count); }; this.__readPts = function __readPts() { this.pts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts', this.pts, this._readOffset); } }; this.__readQts = function __readQts() { this.qts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'qts', this.qts, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; this.__readSeq = function __readSeq() { this.seq = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'seq', this.seq, this._readOffset); } }; this.__readUnread_count = function __readUnread_count() { this.unread_count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'unread_count', this.unread_count, this._readOffset); } }; }::false updates.differenceEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '38a1755d'; this._typeName = "Telegram.type.updates.DifferenceEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeDate(); this.__writeSeq(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readDate(); this.__readSeq(); return this; }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__writeSeq = function __writeSeq() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'seq', this.seq); } this.writeInt(this.seq); }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; this.__readSeq = function __readSeq() { this.seq = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'seq', this.seq, this._readOffset); } }; }::false updates.difference::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a09cf400'; this._typeName = "Telegram.type.updates.Difference"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var new_messagesBytes = this.new_messages.serialize({isBare: false}); this._writeBytes(new_messagesBytes); var new_encrypted_messagesBytes = this.new_encrypted_messages.serialize({isBare: false}); this._writeBytes(new_encrypted_messagesBytes); var other_updatesBytes = this.other_updates.serialize({isBare: false}); this._writeBytes(other_updatesBytes); var chatsBytes = this.chats.serialize({isBare: false}); this._writeBytes(chatsBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); var stateBytes = this.state.serialize({isBare: false}); this._writeBytes(stateBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Message', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.new_messages = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'EncryptedMessage', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.new_encrypted_messages = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Update', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.other_updates = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Chat', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.chats = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', updates_State, bytes.toString('hex'), 'updates_State'); } var updates_State = this.constructor.requireTypeFromBuffer(bytes); if (updates_State) { var obj = new updates_State({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.state = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type updates_State and buffer:' + this._buffer.toString('hex')); } return this; }; }::false updates.differenceSlice::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '8119fba8'; this._typeName = "Telegram.type.updates.DifferenceSlice"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var new_messagesBytes = this.new_messages.serialize({isBare: false}); this._writeBytes(new_messagesBytes); var new_encrypted_messagesBytes = this.new_encrypted_messages.serialize({isBare: false}); this._writeBytes(new_encrypted_messagesBytes); var other_updatesBytes = this.other_updates.serialize({isBare: false}); this._writeBytes(other_updatesBytes); var chatsBytes = this.chats.serialize({isBare: false}); this._writeBytes(chatsBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); var intermediate_stateBytes = this.intermediate_state.serialize({isBare: false}); this._writeBytes(intermediate_stateBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Message', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.new_messages = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'EncryptedMessage', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.new_encrypted_messages = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Update', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.other_updates = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Chat', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.chats = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', updates_State, bytes.toString('hex'), 'updates_State'); } var updates_State = this.constructor.requireTypeFromBuffer(bytes); if (updates_State) { var obj = new updates_State({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.intermediate_state = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type updates_State and buffer:' + this._buffer.toString('hex')); } return this; }; }::false updatesTooLong::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '7eaf17e3'; this._typeName = "Telegram.type.UpdatesTooLong"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false updateShortMessage::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '11bf4f91'; this._typeName = "Telegram.type.UpdateShortMessage"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.out ? (this.flags | 2) : (this.flags & ~2); this.flags = this.mentioned ? (this.flags | 16) : (this.flags & ~16); this.flags = this.media_unread ? (this.flags | 32) : (this.flags & ~32); this.flags = this.silent ? (this.flags | 8192) : (this.flags & ~8192); this.flags = this.fwd_from !== null ? (this.flags | 4) : (this.flags & ~4); this.flags = this.via_bot_id !== null ? (this.flags | 2048) : (this.flags & ~2048); this.flags = this.reply_to_msg_id !== null ? (this.flags | 8) : (this.flags & ~8); this.flags = this.entities !== null ? (this.flags | 128) : (this.flags & ~128); this.__writeFlags(); this.__writeId(); this.__writeUser_id(); this.__writeMessage(); this.__writePts(); this.__writePts_count(); this.__writeDate(); if (this.fwd_from) { var fwd_fromBytes = this.fwd_from.serialize({isBare: false}); this._writeBytes(fwd_fromBytes); } if (this.via_bot_id) { this.__writeVia_bot_id(); } if (this.reply_to_msg_id) { this.__writeReply_to_msg_id(); } if (this.entities) { var entitiesBytes = this.entities.serialize({isBare: false}); this._writeBytes(entitiesBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 1)) !== 0) { this.__readOut(); } if ((this.flags & (1 << 4)) !== 0) { this.__readMentioned(); } if ((this.flags & (1 << 5)) !== 0) { this.__readMedia_unread(); } if ((this.flags & (1 << 13)) !== 0) { this.__readSilent(); } this.__readId(); this.__readUser_id(); this.__readMessage(); this.__readPts(); this.__readPts_count(); this.__readDate(); if ((this.flags & (1 << 2)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', MessageFwdHeader, bytes.toString('hex'), 'MessageFwdHeader'); } var MessageFwdHeader = this.constructor.requireTypeFromBuffer(bytes); if (MessageFwdHeader) { var obj = new MessageFwdHeader({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.fwd_from = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type MessageFwdHeader and buffer:' + this._buffer.toString('hex')); } } if ((this.flags & (1 << 11)) !== 0) { this.__readVia_bot_id(); } if ((this.flags & (1 << 3)) !== 0) { this.__readReply_to_msg_id(); } if ((this.flags & (1 << 7)) !== 0) { var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'MessageEntity', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.entities = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writeMessage = function __writeMessage() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'message', this.message); } this.writeString(this.message); }; this.__writePts = function __writePts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts', this.pts); } this.writeInt(this.pts); }; this.__writePts_count = function __writePts_count() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts_count', this.pts_count); } this.writeInt(this.pts_count); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__writeVia_bot_id = function __writeVia_bot_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'via_bot_id', this.via_bot_id); } this.writeInt(this.via_bot_id); }; this.__writeReply_to_msg_id = function __writeReply_to_msg_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'reply_to_msg_id', this.reply_to_msg_id); } this.writeInt(this.reply_to_msg_id); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readOut = function __readOut() { this.out = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'out', this.out, this._readOffset); } }; this.__readMentioned = function __readMentioned() { this.mentioned = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'mentioned', this.mentioned, this._readOffset); } }; this.__readMedia_unread = function __readMedia_unread() { this.media_unread = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'media_unread', this.media_unread, this._readOffset); } }; this.__readSilent = function __readSilent() { this.silent = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'silent', this.silent, this._readOffset); } }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readMessage = function __readMessage() { this.message = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'message', this.message, this._readOffset); } }; this.__readPts = function __readPts() { this.pts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts', this.pts, this._readOffset); } }; this.__readPts_count = function __readPts_count() { this.pts_count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts_count', this.pts_count, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; this.__readVia_bot_id = function __readVia_bot_id() { this.via_bot_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'via_bot_id', this.via_bot_id, this._readOffset); } }; this.__readReply_to_msg_id = function __readReply_to_msg_id() { this.reply_to_msg_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'reply_to_msg_id', this.reply_to_msg_id, this._readOffset); } }; }::false updateShortChatMessage::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '88268116'; this._typeName = "Telegram.type.UpdateShortChatMessage"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.out ? (this.flags | 2) : (this.flags & ~2); this.flags = this.mentioned ? (this.flags | 16) : (this.flags & ~16); this.flags = this.media_unread ? (this.flags | 32) : (this.flags & ~32); this.flags = this.silent ? (this.flags | 8192) : (this.flags & ~8192); this.flags = this.fwd_from !== null ? (this.flags | 4) : (this.flags & ~4); this.flags = this.via_bot_id !== null ? (this.flags | 2048) : (this.flags & ~2048); this.flags = this.reply_to_msg_id !== null ? (this.flags | 8) : (this.flags & ~8); this.flags = this.entities !== null ? (this.flags | 128) : (this.flags & ~128); this.__writeFlags(); this.__writeId(); this.__writeFrom_id(); this.__writeChat_id(); this.__writeMessage(); this.__writePts(); this.__writePts_count(); this.__writeDate(); if (this.fwd_from) { var fwd_fromBytes = this.fwd_from.serialize({isBare: false}); this._writeBytes(fwd_fromBytes); } if (this.via_bot_id) { this.__writeVia_bot_id(); } if (this.reply_to_msg_id) { this.__writeReply_to_msg_id(); } if (this.entities) { var entitiesBytes = this.entities.serialize({isBare: false}); this._writeBytes(entitiesBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 1)) !== 0) { this.__readOut(); } if ((this.flags & (1 << 4)) !== 0) { this.__readMentioned(); } if ((this.flags & (1 << 5)) !== 0) { this.__readMedia_unread(); } if ((this.flags & (1 << 13)) !== 0) { this.__readSilent(); } this.__readId(); this.__readFrom_id(); this.__readChat_id(); this.__readMessage(); this.__readPts(); this.__readPts_count(); this.__readDate(); if ((this.flags & (1 << 2)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', MessageFwdHeader, bytes.toString('hex'), 'MessageFwdHeader'); } var MessageFwdHeader = this.constructor.requireTypeFromBuffer(bytes); if (MessageFwdHeader) { var obj = new MessageFwdHeader({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.fwd_from = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type MessageFwdHeader and buffer:' + this._buffer.toString('hex')); } } if ((this.flags & (1 << 11)) !== 0) { this.__readVia_bot_id(); } if ((this.flags & (1 << 3)) !== 0) { this.__readReply_to_msg_id(); } if ((this.flags & (1 << 7)) !== 0) { var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'MessageEntity', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.entities = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__writeFrom_id = function __writeFrom_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'from_id', this.from_id); } this.writeInt(this.from_id); }; this.__writeChat_id = function __writeChat_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'chat_id', this.chat_id); } this.writeInt(this.chat_id); }; this.__writeMessage = function __writeMessage() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'message', this.message); } this.writeString(this.message); }; this.__writePts = function __writePts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts', this.pts); } this.writeInt(this.pts); }; this.__writePts_count = function __writePts_count() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts_count', this.pts_count); } this.writeInt(this.pts_count); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__writeVia_bot_id = function __writeVia_bot_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'via_bot_id', this.via_bot_id); } this.writeInt(this.via_bot_id); }; this.__writeReply_to_msg_id = function __writeReply_to_msg_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'reply_to_msg_id', this.reply_to_msg_id); } this.writeInt(this.reply_to_msg_id); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readOut = function __readOut() { this.out = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'out', this.out, this._readOffset); } }; this.__readMentioned = function __readMentioned() { this.mentioned = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'mentioned', this.mentioned, this._readOffset); } }; this.__readMedia_unread = function __readMedia_unread() { this.media_unread = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'media_unread', this.media_unread, this._readOffset); } }; this.__readSilent = function __readSilent() { this.silent = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'silent', this.silent, this._readOffset); } }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readFrom_id = function __readFrom_id() { this.from_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'from_id', this.from_id, this._readOffset); } }; this.__readChat_id = function __readChat_id() { this.chat_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'chat_id', this.chat_id, this._readOffset); } }; this.__readMessage = function __readMessage() { this.message = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'message', this.message, this._readOffset); } }; this.__readPts = function __readPts() { this.pts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts', this.pts, this._readOffset); } }; this.__readPts_count = function __readPts_count() { this.pts_count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts_count', this.pts_count, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; this.__readVia_bot_id = function __readVia_bot_id() { this.via_bot_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'via_bot_id', this.via_bot_id, this._readOffset); } }; this.__readReply_to_msg_id = function __readReply_to_msg_id() { this.reply_to_msg_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'reply_to_msg_id', this.reply_to_msg_id, this._readOffset); } }; }::false updateShort::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c1ded478'; this._typeName = "Telegram.type.UpdateShort"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var updateBytes = this.update.serialize({isBare: false}); this._writeBytes(updateBytes); this.__writeDate(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Update, bytes.toString('hex'), 'Update'); } var Update = this.constructor.requireTypeFromBuffer(bytes); if (Update) { var obj = new Update({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.update = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Update and buffer:' + this._buffer.toString('hex')); } this.__readDate(); return this; }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; }::false updatesCombined::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c3045b72'; this._typeName = "Telegram.type.UpdatesCombined"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var updatesBytes = this.updates.serialize({isBare: false}); this._writeBytes(updatesBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); var chatsBytes = this.chats.serialize({isBare: false}); this._writeBytes(chatsBytes); this.__writeDate(); this.__writeSeq_start(); this.__writeSeq(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Update', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.updates = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Chat', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.chats = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } this.__readDate(); this.__readSeq_start(); this.__readSeq(); return this; }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__writeSeq_start = function __writeSeq_start() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'seq_start', this.seq_start); } this.writeInt(this.seq_start); }; this.__writeSeq = function __writeSeq() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'seq', this.seq); } this.writeInt(this.seq); }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; this.__readSeq_start = function __readSeq_start() { this.seq_start = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'seq_start', this.seq_start, this._readOffset); } }; this.__readSeq = function __readSeq() { this.seq = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'seq', this.seq, this._readOffset); } }; }::false updates::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '4042ae74'; this._typeName = "Telegram.type.Updates"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var updatesBytes = this.updates.serialize({isBare: false}); this._writeBytes(updatesBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); var chatsBytes = this.chats.serialize({isBare: false}); this._writeBytes(chatsBytes); this.__writeDate(); this.__writeSeq(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Update', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.updates = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Chat', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.chats = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } this.__readDate(); this.__readSeq(); return this; }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__writeSeq = function __writeSeq() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'seq', this.seq); } this.writeInt(this.seq); }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; this.__readSeq = function __readSeq() { this.seq = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'seq', this.seq, this._readOffset); } }; }::false photos.photos::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a56aca8d'; this._typeName = "Telegram.type.photos.Photos"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var photosBytes = this.photos.serialize({isBare: false}); this._writeBytes(photosBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Photo', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.photos = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false photos.photosSlice::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '541f0515'; this._typeName = "Telegram.type.photos.PhotosSlice"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeCount(); var photosBytes = this.photos.serialize({isBare: false}); this._writeBytes(photosBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readCount(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Photo', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.photos = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeCount = function __writeCount() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'count', this.count); } this.writeInt(this.count); }; this.__readCount = function __readCount() { this.count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'count', this.count, this._readOffset); } }; }::false photos.photo::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a82c2120'; this._typeName = "Telegram.type.photos.Photo"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var photoBytes = this.photo.serialize({isBare: false}); this._writeBytes(photoBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Photo, bytes.toString('hex'), 'Photo'); } var Photo = this.constructor.requireTypeFromBuffer(bytes); if (Photo) { var obj = new Photo({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.photo = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Photo and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false upload.file::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'd5186a09'; this._typeName = "Telegram.type.upload.File"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var typeBytes = this.type.serialize({isBare: false}); this._writeBytes(typeBytes); this.__writeMtime(); this.__writeBytes(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', storage_FileType, bytes.toString('hex'), 'storage_FileType'); } var storage_FileType = this.constructor.requireTypeFromBuffer(bytes); if (storage_FileType) { var obj = new storage_FileType({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.type = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type storage_FileType and buffer:' + this._buffer.toString('hex')); } this.__readMtime(); this.__readBytes(); return this; }; this.__writeMtime = function __writeMtime() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'mtime', this.mtime); } this.writeInt(this.mtime); }; this.__writeBytes = function __writeBytes() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'bytes', this.bytes.toString('hex')); } this.writeBytes(this.bytes); }; this.__readMtime = function __readMtime() { this.mtime = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'mtime', this.mtime, this._readOffset); } }; this.__readBytes = function __readBytes() { this.bytes = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'bytes', this.bytes.toString('hex'), this._readOffset); } }; }::false dcOption::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'ccc6d805'; this._typeName = "Telegram.type.DcOption"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.ipv6 ? (this.flags | 1) : (this.flags & ~1); this.flags = this.media_only ? (this.flags | 2) : (this.flags & ~2); this.flags = this.tcpo_only ? (this.flags | 4) : (this.flags & ~4); this.__writeFlags(); this.__writeId(); this.__writeIp_address(); this.__writePort(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 0)) !== 0) { this.__readIpv6(); } if ((this.flags & (1 << 1)) !== 0) { this.__readMedia_only(); } if ((this.flags & (1 << 2)) !== 0) { this.__readTcpo_only(); } this.__readId(); this.__readIp_address(); this.__readPort(); return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__writeIp_address = function __writeIp_address() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'ip_address', this.ip_address); } this.writeString(this.ip_address); }; this.__writePort = function __writePort() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'port', this.port); } this.writeInt(this.port); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readIpv6 = function __readIpv6() { this.ipv6 = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'ipv6', this.ipv6, this._readOffset); } }; this.__readMedia_only = function __readMedia_only() { this.media_only = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'media_only', this.media_only, this._readOffset); } }; this.__readTcpo_only = function __readTcpo_only() { this.tcpo_only = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'tcpo_only', this.tcpo_only, this._readOffset); } }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readIp_address = function __readIp_address() { this.ip_address = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'ip_address', this.ip_address, this._readOffset); } }; this.__readPort = function __readPort() { this.port = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'port', this.port, this._readOffset); } }; }::false config::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '2a2e6b9a'; this._typeName = "Telegram.type.Config"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.tmp_sessions !== null ? (this.flags | 1) : (this.flags & ~1); this.__writeFlags(); this.__writeDate(); this.__writeExpires(); var test_modeBytes = this.test_mode.serialize({isBare: false}); this._writeBytes(test_modeBytes); this.__writeThis_dc(); var dc_optionsBytes = this.dc_options.serialize({isBare: false}); this._writeBytes(dc_optionsBytes); this.__writeChat_size_max(); this.__writeMegagroup_size_max(); this.__writeForwarded_count_max(); this.__writeOnline_update_period_ms(); this.__writeOffline_blur_timeout_ms(); this.__writeOffline_idle_timeout_ms(); this.__writeOnline_cloud_timeout_ms(); this.__writeNotify_cloud_delay_ms(); this.__writeNotify_default_delay_ms(); this.__writeChat_big_size(); this.__writePush_chat_period_ms(); this.__writePush_chat_limit(); this.__writeSaved_gifs_limit(); this.__writeEdit_time_limit(); this.__writeRating_e_decay(); this.__writeStickers_recent_limit(); if (this.tmp_sessions) { this.__writeTmp_sessions(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); this.__readDate(); this.__readExpires(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Bool, bytes.toString('hex'), 'Bool'); } var Bool = this.constructor.requireTypeFromBuffer(bytes); if (Bool) { var obj = new Bool({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.test_mode = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Bool and buffer:' + this._buffer.toString('hex')); } this.__readThis_dc(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'DcOption', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.dc_options = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } this.__readChat_size_max(); this.__readMegagroup_size_max(); this.__readForwarded_count_max(); this.__readOnline_update_period_ms(); this.__readOffline_blur_timeout_ms(); this.__readOffline_idle_timeout_ms(); this.__readOnline_cloud_timeout_ms(); this.__readNotify_cloud_delay_ms(); this.__readNotify_default_delay_ms(); this.__readChat_big_size(); this.__readPush_chat_period_ms(); this.__readPush_chat_limit(); this.__readSaved_gifs_limit(); this.__readEdit_time_limit(); this.__readRating_e_decay(); this.__readStickers_recent_limit(); if ((this.flags & (1 << 0)) !== 0) { this.__readTmp_sessions(); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__writeExpires = function __writeExpires() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'expires', this.expires); } this.writeInt(this.expires); }; this.__writeThis_dc = function __writeThis_dc() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'this_dc', this.this_dc); } this.writeInt(this.this_dc); }; this.__writeChat_size_max = function __writeChat_size_max() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'chat_size_max', this.chat_size_max); } this.writeInt(this.chat_size_max); }; this.__writeMegagroup_size_max = function __writeMegagroup_size_max() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'megagroup_size_max', this.megagroup_size_max); } this.writeInt(this.megagroup_size_max); }; this.__writeForwarded_count_max = function __writeForwarded_count_max() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'forwarded_count_max', this.forwarded_count_max); } this.writeInt(this.forwarded_count_max); }; this.__writeOnline_update_period_ms = function __writeOnline_update_period_ms() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'online_update_period_ms', this.online_update_period_ms); } this.writeInt(this.online_update_period_ms); }; this.__writeOffline_blur_timeout_ms = function __writeOffline_blur_timeout_ms() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'offline_blur_timeout_ms', this.offline_blur_timeout_ms); } this.writeInt(this.offline_blur_timeout_ms); }; this.__writeOffline_idle_timeout_ms = function __writeOffline_idle_timeout_ms() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'offline_idle_timeout_ms', this.offline_idle_timeout_ms); } this.writeInt(this.offline_idle_timeout_ms); }; this.__writeOnline_cloud_timeout_ms = function __writeOnline_cloud_timeout_ms() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'online_cloud_timeout_ms', this.online_cloud_timeout_ms); } this.writeInt(this.online_cloud_timeout_ms); }; this.__writeNotify_cloud_delay_ms = function __writeNotify_cloud_delay_ms() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'notify_cloud_delay_ms', this.notify_cloud_delay_ms); } this.writeInt(this.notify_cloud_delay_ms); }; this.__writeNotify_default_delay_ms = function __writeNotify_default_delay_ms() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'notify_default_delay_ms', this.notify_default_delay_ms); } this.writeInt(this.notify_default_delay_ms); }; this.__writeChat_big_size = function __writeChat_big_size() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'chat_big_size', this.chat_big_size); } this.writeInt(this.chat_big_size); }; this.__writePush_chat_period_ms = function __writePush_chat_period_ms() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'push_chat_period_ms', this.push_chat_period_ms); } this.writeInt(this.push_chat_period_ms); }; this.__writePush_chat_limit = function __writePush_chat_limit() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'push_chat_limit', this.push_chat_limit); } this.writeInt(this.push_chat_limit); }; this.__writeSaved_gifs_limit = function __writeSaved_gifs_limit() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'saved_gifs_limit', this.saved_gifs_limit); } this.writeInt(this.saved_gifs_limit); }; this.__writeEdit_time_limit = function __writeEdit_time_limit() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'edit_time_limit', this.edit_time_limit); } this.writeInt(this.edit_time_limit); }; this.__writeRating_e_decay = function __writeRating_e_decay() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'rating_e_decay', this.rating_e_decay); } this.writeInt(this.rating_e_decay); }; this.__writeStickers_recent_limit = function __writeStickers_recent_limit() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'stickers_recent_limit', this.stickers_recent_limit); } this.writeInt(this.stickers_recent_limit); }; this.__writeTmp_sessions = function __writeTmp_sessions() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'tmp_sessions', this.tmp_sessions); } this.writeInt(this.tmp_sessions); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; this.__readExpires = function __readExpires() { this.expires = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'expires', this.expires, this._readOffset); } }; this.__readThis_dc = function __readThis_dc() { this.this_dc = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'this_dc', this.this_dc, this._readOffset); } }; this.__readChat_size_max = function __readChat_size_max() { this.chat_size_max = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'chat_size_max', this.chat_size_max, this._readOffset); } }; this.__readMegagroup_size_max = function __readMegagroup_size_max() { this.megagroup_size_max = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'megagroup_size_max', this.megagroup_size_max, this._readOffset); } }; this.__readForwarded_count_max = function __readForwarded_count_max() { this.forwarded_count_max = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'forwarded_count_max', this.forwarded_count_max, this._readOffset); } }; this.__readOnline_update_period_ms = function __readOnline_update_period_ms() { this.online_update_period_ms = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'online_update_period_ms', this.online_update_period_ms, this._readOffset); } }; this.__readOffline_blur_timeout_ms = function __readOffline_blur_timeout_ms() { this.offline_blur_timeout_ms = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'offline_blur_timeout_ms', this.offline_blur_timeout_ms, this._readOffset); } }; this.__readOffline_idle_timeout_ms = function __readOffline_idle_timeout_ms() { this.offline_idle_timeout_ms = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'offline_idle_timeout_ms', this.offline_idle_timeout_ms, this._readOffset); } }; this.__readOnline_cloud_timeout_ms = function __readOnline_cloud_timeout_ms() { this.online_cloud_timeout_ms = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'online_cloud_timeout_ms', this.online_cloud_timeout_ms, this._readOffset); } }; this.__readNotify_cloud_delay_ms = function __readNotify_cloud_delay_ms() { this.notify_cloud_delay_ms = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'notify_cloud_delay_ms', this.notify_cloud_delay_ms, this._readOffset); } }; this.__readNotify_default_delay_ms = function __readNotify_default_delay_ms() { this.notify_default_delay_ms = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'notify_default_delay_ms', this.notify_default_delay_ms, this._readOffset); } }; this.__readChat_big_size = function __readChat_big_size() { this.chat_big_size = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'chat_big_size', this.chat_big_size, this._readOffset); } }; this.__readPush_chat_period_ms = function __readPush_chat_period_ms() { this.push_chat_period_ms = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'push_chat_period_ms', this.push_chat_period_ms, this._readOffset); } }; this.__readPush_chat_limit = function __readPush_chat_limit() { this.push_chat_limit = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'push_chat_limit', this.push_chat_limit, this._readOffset); } }; this.__readSaved_gifs_limit = function __readSaved_gifs_limit() { this.saved_gifs_limit = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'saved_gifs_limit', this.saved_gifs_limit, this._readOffset); } }; this.__readEdit_time_limit = function __readEdit_time_limit() { this.edit_time_limit = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'edit_time_limit', this.edit_time_limit, this._readOffset); } }; this.__readRating_e_decay = function __readRating_e_decay() { this.rating_e_decay = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'rating_e_decay', this.rating_e_decay, this._readOffset); } }; this.__readStickers_recent_limit = function __readStickers_recent_limit() { this.stickers_recent_limit = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'stickers_recent_limit', this.stickers_recent_limit, this._readOffset); } }; this.__readTmp_sessions = function __readTmp_sessions() { this.tmp_sessions = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'tmp_sessions', this.tmp_sessions, this._readOffset); } }; }::false nearestDc::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '75171a8e'; this._typeName = "Telegram.type.NearestDc"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeCountry(); this.__writeThis_dc(); this.__writeNearest_dc(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readCountry(); this.__readThis_dc(); this.__readNearest_dc(); return this; }; this.__writeCountry = function __writeCountry() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'country', this.country); } this.writeString(this.country); }; this.__writeThis_dc = function __writeThis_dc() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'this_dc', this.this_dc); } this.writeInt(this.this_dc); }; this.__writeNearest_dc = function __writeNearest_dc() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'nearest_dc', this.nearest_dc); } this.writeInt(this.nearest_dc); }; this.__readCountry = function __readCountry() { this.country = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'country', this.country, this._readOffset); } }; this.__readThis_dc = function __readThis_dc() { this.this_dc = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'this_dc', this.this_dc, this._readOffset); } }; this.__readNearest_dc = function __readNearest_dc() { this.nearest_dc = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'nearest_dc', this.nearest_dc, this._readOffset); } }; }::false help.appUpdate::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '11f38789'; this._typeName = "Telegram.type.help.AppUpdate"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); var criticalBytes = this.critical.serialize({isBare: false}); this._writeBytes(criticalBytes); this.__writeUrl(); this.__writeText(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Bool, bytes.toString('hex'), 'Bool'); } var Bool = this.constructor.requireTypeFromBuffer(bytes); if (Bool) { var obj = new Bool({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.critical = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Bool and buffer:' + this._buffer.toString('hex')); } this.__readUrl(); this.__readText(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__writeUrl = function __writeUrl() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'url', this.url); } this.writeString(this.url); }; this.__writeText = function __writeText() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'text', this.text); } this.writeString(this.text); }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readUrl = function __readUrl() { this.url = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'url', this.url, this._readOffset); } }; this.__readText = function __readText() { this.text = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'text', this.text, this._readOffset); } }; }::false help.noAppUpdate::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '36655ac4'; this._typeName = "Telegram.type.help.NoAppUpdate"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false help.inviteText::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '789fcb18'; this._typeName = "Telegram.type.help.InviteText"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeMessage(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readMessage(); return this; }; this.__writeMessage = function __writeMessage() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'message', this.message); } this.writeString(this.message); }; this.__readMessage = function __readMessage() { this.message = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'message', this.message, this._readOffset); } }; }::false wallPaperSolid::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '247f1163'; this._typeName = "Telegram.type.WallPaperSolid"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeTitle(); this.__writeBg_color(); this.__writeColor(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readTitle(); this.__readBg_color(); this.__readColor(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__writeTitle = function __writeTitle() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'title', this.title); } this.writeString(this.title); }; this.__writeBg_color = function __writeBg_color() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'bg_color', this.bg_color); } this.writeInt(this.bg_color); }; this.__writeColor = function __writeColor() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'color', this.color); } this.writeInt(this.color); }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readTitle = function __readTitle() { this.title = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'title', this.title, this._readOffset); } }; this.__readBg_color = function __readBg_color() { this.bg_color = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'bg_color', this.bg_color, this._readOffset); } }; this.__readColor = function __readColor() { this.color = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'color', this.color, this._readOffset); } }; }::false updateNewEncryptedMessage::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '9abdbc12'; this._typeName = "Telegram.type.UpdateNewEncryptedMessage"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var messageBytes = this.message.serialize({isBare: false}); this._writeBytes(messageBytes); this.__writeQts(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', EncryptedMessage, bytes.toString('hex'), 'EncryptedMessage'); } var EncryptedMessage = this.constructor.requireTypeFromBuffer(bytes); if (EncryptedMessage) { var obj = new EncryptedMessage({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.message = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type EncryptedMessage and buffer:' + this._buffer.toString('hex')); } this.__readQts(); return this; }; this.__writeQts = function __writeQts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'qts', this.qts); } this.writeInt(this.qts); }; this.__readQts = function __readQts() { this.qts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'qts', this.qts, this._readOffset); } }; }::false updateEncryptedChatTyping::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '56f11017'; this._typeName = "Telegram.type.UpdateEncryptedChatTyping"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeChat_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readChat_id(); return this; }; this.__writeChat_id = function __writeChat_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'chat_id', this.chat_id); } this.writeInt(this.chat_id); }; this.__readChat_id = function __readChat_id() { this.chat_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'chat_id', this.chat_id, this._readOffset); } }; }::false updateEncryption::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '8de8a2b4'; this._typeName = "Telegram.type.UpdateEncryption"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var chatBytes = this.chat.serialize({isBare: false}); this._writeBytes(chatBytes); this.__writeDate(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', EncryptedChat, bytes.toString('hex'), 'EncryptedChat'); } var EncryptedChat = this.constructor.requireTypeFromBuffer(bytes); if (EncryptedChat) { var obj = new EncryptedChat({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.chat = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type EncryptedChat and buffer:' + this._buffer.toString('hex')); } this.__readDate(); return this; }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; }::false updateEncryptedMessagesRead::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'b725fe38'; this._typeName = "Telegram.type.UpdateEncryptedMessagesRead"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeChat_id(); this.__writeMax_date(); this.__writeDate(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readChat_id(); this.__readMax_date(); this.__readDate(); return this; }; this.__writeChat_id = function __writeChat_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'chat_id', this.chat_id); } this.writeInt(this.chat_id); }; this.__writeMax_date = function __writeMax_date() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'max_date', this.max_date); } this.writeInt(this.max_date); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__readChat_id = function __readChat_id() { this.chat_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'chat_id', this.chat_id, this._readOffset); } }; this.__readMax_date = function __readMax_date() { this.max_date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'max_date', this.max_date, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; }::false encryptedChatEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a0c07eab'; this._typeName = "Telegram.type.EncryptedChatEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; }::false encryptedChatWaiting::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'dc03f73b'; this._typeName = "Telegram.type.EncryptedChatWaiting"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeAccess_hash(); this.__writeDate(); this.__writeAdmin_id(); this.__writeParticipant_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readAccess_hash(); this.__readDate(); this.__readAdmin_id(); this.__readParticipant_id(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__writeAccess_hash = function __writeAccess_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'access_hash', this.access_hash); } this.writeLong(this.access_hash); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__writeAdmin_id = function __writeAdmin_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'admin_id', this.admin_id); } this.writeInt(this.admin_id); }; this.__writeParticipant_id = function __writeParticipant_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'participant_id', this.participant_id); } this.writeInt(this.participant_id); }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readAccess_hash = function __readAccess_hash() { this.access_hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'access_hash', this.access_hash, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; this.__readAdmin_id = function __readAdmin_id() { this.admin_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'admin_id', this.admin_id, this._readOffset); } }; this.__readParticipant_id = function __readParticipant_id() { this.participant_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'participant_id', this.participant_id, this._readOffset); } }; }::false encryptedChatRequested::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '7e5278c8'; this._typeName = "Telegram.type.EncryptedChatRequested"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeAccess_hash(); this.__writeDate(); this.__writeAdmin_id(); this.__writeParticipant_id(); this.__writeG_a(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readAccess_hash(); this.__readDate(); this.__readAdmin_id(); this.__readParticipant_id(); this.__readG_a(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__writeAccess_hash = function __writeAccess_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'access_hash', this.access_hash); } this.writeLong(this.access_hash); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__writeAdmin_id = function __writeAdmin_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'admin_id', this.admin_id); } this.writeInt(this.admin_id); }; this.__writeParticipant_id = function __writeParticipant_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'participant_id', this.participant_id); } this.writeInt(this.participant_id); }; this.__writeG_a = function __writeG_a() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'g_a', this.g_a.toString('hex')); } this.writeBytes(this.g_a); }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readAccess_hash = function __readAccess_hash() { this.access_hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'access_hash', this.access_hash, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; this.__readAdmin_id = function __readAdmin_id() { this.admin_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'admin_id', this.admin_id, this._readOffset); } }; this.__readParticipant_id = function __readParticipant_id() { this.participant_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'participant_id', this.participant_id, this._readOffset); } }; this.__readG_a = function __readG_a() { this.g_a = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'g_a', this.g_a.toString('hex'), this._readOffset); } }; }::false encryptedChat::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '36ce56fa'; this._typeName = "Telegram.type.EncryptedChat"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeAccess_hash(); this.__writeDate(); this.__writeAdmin_id(); this.__writeParticipant_id(); this.__writeG_a_or_b(); this.__writeKey_fingerprint(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readAccess_hash(); this.__readDate(); this.__readAdmin_id(); this.__readParticipant_id(); this.__readG_a_or_b(); this.__readKey_fingerprint(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__writeAccess_hash = function __writeAccess_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'access_hash', this.access_hash); } this.writeLong(this.access_hash); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__writeAdmin_id = function __writeAdmin_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'admin_id', this.admin_id); } this.writeInt(this.admin_id); }; this.__writeParticipant_id = function __writeParticipant_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'participant_id', this.participant_id); } this.writeInt(this.participant_id); }; this.__writeG_a_or_b = function __writeG_a_or_b() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'g_a_or_b', this.g_a_or_b.toString('hex')); } this.writeBytes(this.g_a_or_b); }; this.__writeKey_fingerprint = function __writeKey_fingerprint() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'key_fingerprint', this.key_fingerprint); } this.writeLong(this.key_fingerprint); }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readAccess_hash = function __readAccess_hash() { this.access_hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'access_hash', this.access_hash, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; this.__readAdmin_id = function __readAdmin_id() { this.admin_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'admin_id', this.admin_id, this._readOffset); } }; this.__readParticipant_id = function __readParticipant_id() { this.participant_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'participant_id', this.participant_id, this._readOffset); } }; this.__readG_a_or_b = function __readG_a_or_b() { this.g_a_or_b = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'g_a_or_b', this.g_a_or_b.toString('hex'), this._readOffset); } }; this.__readKey_fingerprint = function __readKey_fingerprint() { this.key_fingerprint = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'key_fingerprint', this.key_fingerprint, this._readOffset); } }; }::false encryptedChatDiscarded::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '27ddd613'; this._typeName = "Telegram.type.EncryptedChatDiscarded"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; }::false inputEncryptedChat::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'e1b541f1'; this._typeName = "Telegram.type.InputEncryptedChat"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeChat_id(); this.__writeAccess_hash(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readChat_id(); this.__readAccess_hash(); return this; }; this.__writeChat_id = function __writeChat_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'chat_id', this.chat_id); } this.writeInt(this.chat_id); }; this.__writeAccess_hash = function __writeAccess_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'access_hash', this.access_hash); } this.writeLong(this.access_hash); }; this.__readChat_id = function __readChat_id() { this.chat_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'chat_id', this.chat_id, this._readOffset); } }; this.__readAccess_hash = function __readAccess_hash() { this.access_hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'access_hash', this.access_hash, this._readOffset); } }; }::false encryptedFileEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '7e491fc2'; this._typeName = "Telegram.type.EncryptedFileEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false encryptedFile::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '4c99704a'; this._typeName = "Telegram.type.EncryptedFile"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeAccess_hash(); this.__writeSize(); this.__writeDc_id(); this.__writeKey_fingerprint(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readAccess_hash(); this.__readSize(); this.__readDc_id(); this.__readKey_fingerprint(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeLong(this.id); }; this.__writeAccess_hash = function __writeAccess_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'access_hash', this.access_hash); } this.writeLong(this.access_hash); }; this.__writeSize = function __writeSize() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'size', this.size); } this.writeInt(this.size); }; this.__writeDc_id = function __writeDc_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'dc_id', this.dc_id); } this.writeInt(this.dc_id); }; this.__writeKey_fingerprint = function __writeKey_fingerprint() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'key_fingerprint', this.key_fingerprint); } this.writeInt(this.key_fingerprint); }; this.__readId = function __readId() { this.id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readAccess_hash = function __readAccess_hash() { this.access_hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'access_hash', this.access_hash, this._readOffset); } }; this.__readSize = function __readSize() { this.size = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'size', this.size, this._readOffset); } }; this.__readDc_id = function __readDc_id() { this.dc_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'dc_id', this.dc_id, this._readOffset); } }; this.__readKey_fingerprint = function __readKey_fingerprint() { this.key_fingerprint = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'key_fingerprint', this.key_fingerprint, this._readOffset); } }; }::false inputEncryptedFileEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '64c33718'; this._typeName = "Telegram.type.InputEncryptedFileEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputEncryptedFileUploaded::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '0603bd64'; this._typeName = "Telegram.type.InputEncryptedFileUploaded"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeParts(); this.__writeMd5_checksum(); this.__writeKey_fingerprint(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readParts(); this.__readMd5_checksum(); this.__readKey_fingerprint(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeLong(this.id); }; this.__writeParts = function __writeParts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'parts', this.parts); } this.writeInt(this.parts); }; this.__writeMd5_checksum = function __writeMd5_checksum() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'md5_checksum', this.md5_checksum); } this.writeString(this.md5_checksum); }; this.__writeKey_fingerprint = function __writeKey_fingerprint() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'key_fingerprint', this.key_fingerprint); } this.writeInt(this.key_fingerprint); }; this.__readId = function __readId() { this.id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readParts = function __readParts() { this.parts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'parts', this.parts, this._readOffset); } }; this.__readMd5_checksum = function __readMd5_checksum() { this.md5_checksum = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'md5_checksum', this.md5_checksum, this._readOffset); } }; this.__readKey_fingerprint = function __readKey_fingerprint() { this.key_fingerprint = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'key_fingerprint', this.key_fingerprint, this._readOffset); } }; }::false inputEncryptedFile::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'e5b5175a'; this._typeName = "Telegram.type.InputEncryptedFile"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeAccess_hash(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readAccess_hash(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeLong(this.id); }; this.__writeAccess_hash = function __writeAccess_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'access_hash', this.access_hash); } this.writeLong(this.access_hash); }; this.__readId = function __readId() { this.id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readAccess_hash = function __readAccess_hash() { this.access_hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'access_hash', this.access_hash, this._readOffset); } }; }::false inputEncryptedFileLocation::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '555d23f5'; this._typeName = "Telegram.type.InputEncryptedFileLocation"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeAccess_hash(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readAccess_hash(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeLong(this.id); }; this.__writeAccess_hash = function __writeAccess_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'access_hash', this.access_hash); } this.writeLong(this.access_hash); }; this.__readId = function __readId() { this.id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readAccess_hash = function __readAccess_hash() { this.access_hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'access_hash', this.access_hash, this._readOffset); } }; }::false encryptedMessage::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '18c118ed'; this._typeName = "Telegram.type.EncryptedMessage"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeRandom_id(); this.__writeChat_id(); this.__writeDate(); this.__writeBytes(); var fileBytes = this.file.serialize({isBare: false}); this._writeBytes(fileBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readRandom_id(); this.__readChat_id(); this.__readDate(); this.__readBytes(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', EncryptedFile, bytes.toString('hex'), 'EncryptedFile'); } var EncryptedFile = this.constructor.requireTypeFromBuffer(bytes); if (EncryptedFile) { var obj = new EncryptedFile({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.file = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type EncryptedFile and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeRandom_id = function __writeRandom_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'random_id', this.random_id); } this.writeLong(this.random_id); }; this.__writeChat_id = function __writeChat_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'chat_id', this.chat_id); } this.writeInt(this.chat_id); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__writeBytes = function __writeBytes() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'bytes', this.bytes.toString('hex')); } this.writeBytes(this.bytes); }; this.__readRandom_id = function __readRandom_id() { this.random_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'random_id', this.random_id, this._readOffset); } }; this.__readChat_id = function __readChat_id() { this.chat_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'chat_id', this.chat_id, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; this.__readBytes = function __readBytes() { this.bytes = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'bytes', this.bytes.toString('hex'), this._readOffset); } }; }::false encryptedMessageService::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '064b7323'; this._typeName = "Telegram.type.EncryptedMessageService"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeRandom_id(); this.__writeChat_id(); this.__writeDate(); this.__writeBytes(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readRandom_id(); this.__readChat_id(); this.__readDate(); this.__readBytes(); return this; }; this.__writeRandom_id = function __writeRandom_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'random_id', this.random_id); } this.writeLong(this.random_id); }; this.__writeChat_id = function __writeChat_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'chat_id', this.chat_id); } this.writeInt(this.chat_id); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__writeBytes = function __writeBytes() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'bytes', this.bytes.toString('hex')); } this.writeBytes(this.bytes); }; this.__readRandom_id = function __readRandom_id() { this.random_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'random_id', this.random_id, this._readOffset); } }; this.__readChat_id = function __readChat_id() { this.chat_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'chat_id', this.chat_id, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; this.__readBytes = function __readBytes() { this.bytes = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'bytes', this.bytes.toString('hex'), this._readOffset); } }; }::false messages.dhConfigNotModified::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '3546e2c0'; this._typeName = "Telegram.type.messages.DhConfigNotModified"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeRandom(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readRandom(); return this; }; this.__writeRandom = function __writeRandom() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'random', this.random.toString('hex')); } this.writeBytes(this.random); }; this.__readRandom = function __readRandom() { this.random = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'random', this.random.toString('hex'), this._readOffset); } }; }::false messages.dhConfig::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'dd1e222c'; this._typeName = "Telegram.type.messages.DhConfig"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeG(); this.__writeP(); this.__writeVersion(); this.__writeRandom(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readG(); this.__readP(); this.__readVersion(); this.__readRandom(); return this; }; this.__writeG = function __writeG() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'g', this.g); } this.writeInt(this.g); }; this.__writeP = function __writeP() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'p', this.p.toString('hex')); } this.writeBytes(this.p); }; this.__writeVersion = function __writeVersion() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'version', this.version); } this.writeInt(this.version); }; this.__writeRandom = function __writeRandom() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'random', this.random.toString('hex')); } this.writeBytes(this.random); }; this.__readG = function __readG() { this.g = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'g', this.g, this._readOffset); } }; this.__readP = function __readP() { this.p = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'p', this.p.toString('hex'), this._readOffset); } }; this.__readVersion = function __readVersion() { this.version = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'version', this.version, this._readOffset); } }; this.__readRandom = function __readRandom() { this.random = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'random', this.random.toString('hex'), this._readOffset); } }; }::false messages.sentEncryptedMessage::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '35890f56'; this._typeName = "Telegram.type.messages.SentEncryptedMessage"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeDate(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readDate(); return this; }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; }::false messages.sentEncryptedFile::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '32ff9394'; this._typeName = "Telegram.type.messages.SentEncryptedFile"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeDate(); var fileBytes = this.file.serialize({isBare: false}); this._writeBytes(fileBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readDate(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', EncryptedFile, bytes.toString('hex'), 'EncryptedFile'); } var EncryptedFile = this.constructor.requireTypeFromBuffer(bytes); if (EncryptedFile) { var obj = new EncryptedFile({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.file = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type EncryptedFile and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; }::false inputFileBig::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'b50b4ffa'; this._typeName = "Telegram.type.InputFileBig"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeParts(); this.__writeName(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readParts(); this.__readName(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeLong(this.id); }; this.__writeParts = function __writeParts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'parts', this.parts); } this.writeInt(this.parts); }; this.__writeName = function __writeName() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'name', this.name); } this.writeString(this.name); }; this.__readId = function __readId() { this.id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readParts = function __readParts() { this.parts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'parts', this.parts, this._readOffset); } }; this.__readName = function __readName() { this.name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'name', this.name, this._readOffset); } }; }::false inputEncryptedFileBigUploaded::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c873c12d'; this._typeName = "Telegram.type.InputEncryptedFileBigUploaded"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeParts(); this.__writeKey_fingerprint(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readParts(); this.__readKey_fingerprint(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeLong(this.id); }; this.__writeParts = function __writeParts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'parts', this.parts); } this.writeInt(this.parts); }; this.__writeKey_fingerprint = function __writeKey_fingerprint() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'key_fingerprint', this.key_fingerprint); } this.writeInt(this.key_fingerprint); }; this.__readId = function __readId() { this.id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readParts = function __readParts() { this.parts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'parts', this.parts, this._readOffset); } }; this.__readKey_fingerprint = function __readKey_fingerprint() { this.key_fingerprint = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'key_fingerprint', this.key_fingerprint, this._readOffset); } }; }::false updateChatParticipantAdd::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '5c0e4bea'; this._typeName = "Telegram.type.UpdateChatParticipantAdd"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeChat_id(); this.__writeUser_id(); this.__writeInviter_id(); this.__writeDate(); this.__writeVersion(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readChat_id(); this.__readUser_id(); this.__readInviter_id(); this.__readDate(); this.__readVersion(); return this; }; this.__writeChat_id = function __writeChat_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'chat_id', this.chat_id); } this.writeInt(this.chat_id); }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writeInviter_id = function __writeInviter_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'inviter_id', this.inviter_id); } this.writeInt(this.inviter_id); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__writeVersion = function __writeVersion() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'version', this.version); } this.writeInt(this.version); }; this.__readChat_id = function __readChat_id() { this.chat_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'chat_id', this.chat_id, this._readOffset); } }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readInviter_id = function __readInviter_id() { this.inviter_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'inviter_id', this.inviter_id, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; this.__readVersion = function __readVersion() { this.version = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'version', this.version, this._readOffset); } }; }::false updateChatParticipantDelete::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '228c5f6e'; this._typeName = "Telegram.type.UpdateChatParticipantDelete"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeChat_id(); this.__writeUser_id(); this.__writeVersion(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readChat_id(); this.__readUser_id(); this.__readVersion(); return this; }; this.__writeChat_id = function __writeChat_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'chat_id', this.chat_id); } this.writeInt(this.chat_id); }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writeVersion = function __writeVersion() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'version', this.version); } this.writeInt(this.version); }; this.__readChat_id = function __readChat_id() { this.chat_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'chat_id', this.chat_id, this._readOffset); } }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readVersion = function __readVersion() { this.version = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'version', this.version, this._readOffset); } }; }::false updateDcOptions::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '73985e8e'; this._typeName = "Telegram.type.UpdateDcOptions"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var dc_optionsBytes = this.dc_options.serialize({isBare: false}); this._writeBytes(dc_optionsBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'DcOption', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.dc_options = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false inputMediaUploadedDocument::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'e9f170d0'; this._typeName = "Telegram.type.InputMediaUploadedDocument"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.stickers !== null ? (this.flags | 1) : (this.flags & ~1); this.__writeFlags(); var fileBytes = this.file.serialize({isBare: false}); this._writeBytes(fileBytes); this.__writeMime_type(); var attributesBytes = this.attributes.serialize({isBare: false}); this._writeBytes(attributesBytes); this.__writeCaption(); if (this.stickers) { var stickersBytes = this.stickers.serialize({isBare: false}); this._writeBytes(stickersBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputFile, bytes.toString('hex'), 'InputFile'); } var InputFile = this.constructor.requireTypeFromBuffer(bytes); if (InputFile) { var obj = new InputFile({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.file = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputFile and buffer:' + this._buffer.toString('hex')); } this.__readMime_type(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'DocumentAttribute', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.attributes = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } this.__readCaption(); if ((this.flags & (1 << 0)) !== 0) { var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'InputDocument', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.stickers = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeMime_type = function __writeMime_type() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'mime_type', this.mime_type); } this.writeString(this.mime_type); }; this.__writeCaption = function __writeCaption() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'caption', this.caption); } this.writeString(this.caption); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readMime_type = function __readMime_type() { this.mime_type = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'mime_type', this.mime_type, this._readOffset); } }; this.__readCaption = function __readCaption() { this.caption = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'caption', this.caption, this._readOffset); } }; }::false inputMediaUploadedThumbDocument::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'ae8cd850'; this._typeName = "Telegram.type.InputMediaUploadedThumbDocument"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.stickers !== null ? (this.flags | 1) : (this.flags & ~1); this.__writeFlags(); var fileBytes = this.file.serialize({isBare: false}); this._writeBytes(fileBytes); var thumbBytes = this.thumb.serialize({isBare: false}); this._writeBytes(thumbBytes); this.__writeMime_type(); var attributesBytes = this.attributes.serialize({isBare: false}); this._writeBytes(attributesBytes); this.__writeCaption(); if (this.stickers) { var stickersBytes = this.stickers.serialize({isBare: false}); this._writeBytes(stickersBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputFile, bytes.toString('hex'), 'InputFile'); } var InputFile = this.constructor.requireTypeFromBuffer(bytes); if (InputFile) { var obj = new InputFile({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.file = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputFile and buffer:' + this._buffer.toString('hex')); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputFile, bytes.toString('hex'), 'InputFile'); } var InputFile = this.constructor.requireTypeFromBuffer(bytes); if (InputFile) { var obj = new InputFile({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.thumb = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputFile and buffer:' + this._buffer.toString('hex')); } this.__readMime_type(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'DocumentAttribute', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.attributes = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } this.__readCaption(); if ((this.flags & (1 << 0)) !== 0) { var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'InputDocument', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.stickers = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeMime_type = function __writeMime_type() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'mime_type', this.mime_type); } this.writeString(this.mime_type); }; this.__writeCaption = function __writeCaption() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'caption', this.caption); } this.writeString(this.caption); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readMime_type = function __readMime_type() { this.mime_type = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'mime_type', this.mime_type, this._readOffset); } }; this.__readCaption = function __readCaption() { this.caption = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'caption', this.caption, this._readOffset); } }; }::false inputMediaDocument::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '9cf2771a'; this._typeName = "Telegram.type.InputMediaDocument"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var idBytes = this.id.serialize({isBare: false}); this._writeBytes(idBytes); this.__writeCaption(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputDocument, bytes.toString('hex'), 'InputDocument'); } var InputDocument = this.constructor.requireTypeFromBuffer(bytes); if (InputDocument) { var obj = new InputDocument({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.id = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputDocument and buffer:' + this._buffer.toString('hex')); } this.__readCaption(); return this; }; this.__writeCaption = function __writeCaption() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'caption', this.caption); } this.writeString(this.caption); }; this.__readCaption = function __readCaption() { this.caption = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'caption', this.caption, this._readOffset); } }; }::false messageMediaDocument::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a82ee0f3'; this._typeName = "Telegram.type.MessageMediaDocument"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var documentBytes = this.document.serialize({isBare: false}); this._writeBytes(documentBytes); this.__writeCaption(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Document, bytes.toString('hex'), 'Document'); } var Document = this.constructor.requireTypeFromBuffer(bytes); if (Document) { var obj = new Document({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.document = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Document and buffer:' + this._buffer.toString('hex')); } this.__readCaption(); return this; }; this.__writeCaption = function __writeCaption() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'caption', this.caption); } this.writeString(this.caption); }; this.__readCaption = function __readCaption() { this.caption = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'caption', this.caption, this._readOffset); } }; }::false inputDocumentEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'aeeaf072'; this._typeName = "Telegram.type.InputDocumentEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputDocument::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '52897918'; this._typeName = "Telegram.type.InputDocument"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeAccess_hash(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readAccess_hash(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeLong(this.id); }; this.__writeAccess_hash = function __writeAccess_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'access_hash', this.access_hash); } this.writeLong(this.access_hash); }; this.__readId = function __readId() { this.id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readAccess_hash = function __readAccess_hash() { this.access_hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'access_hash', this.access_hash, this._readOffset); } }; }::false inputDocumentFileLocation::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '24070f43'; this._typeName = "Telegram.type.InputDocumentFileLocation"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeAccess_hash(); this.__writeVersion(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readAccess_hash(); this.__readVersion(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeLong(this.id); }; this.__writeAccess_hash = function __writeAccess_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'access_hash', this.access_hash); } this.writeLong(this.access_hash); }; this.__writeVersion = function __writeVersion() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'version', this.version); } this.writeInt(this.version); }; this.__readId = function __readId() { this.id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readAccess_hash = function __readAccess_hash() { this.access_hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'access_hash', this.access_hash, this._readOffset); } }; this.__readVersion = function __readVersion() { this.version = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'version', this.version, this._readOffset); } }; }::false documentEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '71c8f836'; this._typeName = "Telegram.type.DocumentEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeLong(this.id); }; this.__readId = function __readId() { this.id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; }::false document::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c72b2387'; this._typeName = "Telegram.type.Document"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeAccess_hash(); this.__writeDate(); this.__writeMime_type(); this.__writeSize(); var thumbBytes = this.thumb.serialize({isBare: false}); this._writeBytes(thumbBytes); this.__writeDc_id(); this.__writeVersion(); var attributesBytes = this.attributes.serialize({isBare: false}); this._writeBytes(attributesBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readAccess_hash(); this.__readDate(); this.__readMime_type(); this.__readSize(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', PhotoSize, bytes.toString('hex'), 'PhotoSize'); } var PhotoSize = this.constructor.requireTypeFromBuffer(bytes); if (PhotoSize) { var obj = new PhotoSize({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.thumb = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type PhotoSize and buffer:' + this._buffer.toString('hex')); } this.__readDc_id(); this.__readVersion(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'DocumentAttribute', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.attributes = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeLong(this.id); }; this.__writeAccess_hash = function __writeAccess_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'access_hash', this.access_hash); } this.writeLong(this.access_hash); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__writeMime_type = function __writeMime_type() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'mime_type', this.mime_type); } this.writeString(this.mime_type); }; this.__writeSize = function __writeSize() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'size', this.size); } this.writeInt(this.size); }; this.__writeDc_id = function __writeDc_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'dc_id', this.dc_id); } this.writeInt(this.dc_id); }; this.__writeVersion = function __writeVersion() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'version', this.version); } this.writeInt(this.version); }; this.__readId = function __readId() { this.id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readAccess_hash = function __readAccess_hash() { this.access_hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'access_hash', this.access_hash, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; this.__readMime_type = function __readMime_type() { this.mime_type = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'mime_type', this.mime_type, this._readOffset); } }; this.__readSize = function __readSize() { this.size = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'size', this.size, this._readOffset); } }; this.__readDc_id = function __readDc_id() { this.dc_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'dc_id', this.dc_id, this._readOffset); } }; this.__readVersion = function __readVersion() { this.version = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'version', this.version, this._readOffset); } }; }::false help.support::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'f6b5c617'; this._typeName = "Telegram.type.help.Support"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writePhone_number(); var userBytes = this.user.serialize({isBare: false}); this._writeBytes(userBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readPhone_number(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', User, bytes.toString('hex'), 'User'); } var User = this.constructor.requireTypeFromBuffer(bytes); if (User) { var obj = new User({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.user = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type User and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writePhone_number = function __writePhone_number() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'phone_number', this.phone_number); } this.writeString(this.phone_number); }; this.__readPhone_number = function __readPhone_number() { this.phone_number = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'phone_number', this.phone_number, this._readOffset); } }; }::false notifyPeer::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'd80bd49f'; this._typeName = "Telegram.type.NotifyPeer"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var peerBytes = this.peer.serialize({isBare: false}); this._writeBytes(peerBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Peer, bytes.toString('hex'), 'Peer'); } var Peer = this.constructor.requireTypeFromBuffer(bytes); if (Peer) { var obj = new Peer({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.peer = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Peer and buffer:' + this._buffer.toString('hex')); } return this; }; }::false notifyUsers::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '4c3bc8b4'; this._typeName = "Telegram.type.NotifyUsers"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false notifyChats::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c3ce07c0'; this._typeName = "Telegram.type.NotifyChats"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false notifyAll::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '607cd074'; this._typeName = "Telegram.type.NotifyAll"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false updateUserBlocked::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '1ae8ec80'; this._typeName = "Telegram.type.UpdateUserBlocked"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); var blockedBytes = this.blocked.serialize({isBare: false}); this._writeBytes(blockedBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Bool, bytes.toString('hex'), 'Bool'); } var Bool = this.constructor.requireTypeFromBuffer(bytes); if (Bool) { var obj = new Bool({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.blocked = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Bool and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; }::false updateNotifySettings::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'ef68c2be'; this._typeName = "Telegram.type.UpdateNotifySettings"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var peerBytes = this.peer.serialize({isBare: false}); this._writeBytes(peerBytes); var notify_settingsBytes = this.notify_settings.serialize({isBare: false}); this._writeBytes(notify_settingsBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', NotifyPeer, bytes.toString('hex'), 'NotifyPeer'); } var NotifyPeer = this.constructor.requireTypeFromBuffer(bytes); if (NotifyPeer) { var obj = new NotifyPeer({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.peer = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type NotifyPeer and buffer:' + this._buffer.toString('hex')); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', PeerNotifySettings, bytes.toString('hex'), 'PeerNotifySettings'); } var PeerNotifySettings = this.constructor.requireTypeFromBuffer(bytes); if (PeerNotifySettings) { var obj = new PeerNotifySettings({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.notify_settings = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type PeerNotifySettings and buffer:' + this._buffer.toString('hex')); } return this; }; }::false sendMessageTypingAction::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '4e74bf16'; this._typeName = "Telegram.type.SendMessageTypingAction"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false sendMessageCancelAction::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'f5c85efd'; this._typeName = "Telegram.type.SendMessageCancelAction"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false sendMessageRecordVideoAction::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '6fd687a1'; this._typeName = "Telegram.type.SendMessageRecordVideoAction"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false sendMessageUploadVideoAction::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'ec3a76e9'; this._typeName = "Telegram.type.SendMessageUploadVideoAction"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeProgress(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readProgress(); return this; }; this.__writeProgress = function __writeProgress() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'progress', this.progress); } this.writeInt(this.progress); }; this.__readProgress = function __readProgress() { this.progress = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'progress', this.progress, this._readOffset); } }; }::false sendMessageRecordAudioAction::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'f7732fd5'; this._typeName = "Telegram.type.SendMessageRecordAudioAction"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false sendMessageUploadAudioAction::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'abd751f3'; this._typeName = "Telegram.type.SendMessageUploadAudioAction"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeProgress(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readProgress(); return this; }; this.__writeProgress = function __writeProgress() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'progress', this.progress); } this.writeInt(this.progress); }; this.__readProgress = function __readProgress() { this.progress = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'progress', this.progress, this._readOffset); } }; }::false sendMessageUploadPhotoAction::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '264ad3d1'; this._typeName = "Telegram.type.SendMessageUploadPhotoAction"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeProgress(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readProgress(); return this; }; this.__writeProgress = function __writeProgress() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'progress', this.progress); } this.writeInt(this.progress); }; this.__readProgress = function __readProgress() { this.progress = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'progress', this.progress, this._readOffset); } }; }::false sendMessageUploadDocumentAction::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'e4d90caa'; this._typeName = "Telegram.type.SendMessageUploadDocumentAction"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeProgress(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readProgress(); return this; }; this.__writeProgress = function __writeProgress() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'progress', this.progress); } this.writeInt(this.progress); }; this.__readProgress = function __readProgress() { this.progress = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'progress', this.progress, this._readOffset); } }; }::false sendMessageGeoLocationAction::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a18b6f17'; this._typeName = "Telegram.type.SendMessageGeoLocationAction"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false sendMessageChooseContactAction::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '6fbc8c62'; this._typeName = "Telegram.type.SendMessageChooseContactAction"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false contacts.found::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '84f7a11a'; this._typeName = "Telegram.type.contacts.Found"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var resultsBytes = this.results.serialize({isBare: false}); this._writeBytes(resultsBytes); var chatsBytes = this.chats.serialize({isBare: false}); this._writeBytes(chatsBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Peer', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.results = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Chat', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.chats = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false updateServiceNotification::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'e4d32d38'; this._typeName = "Telegram.type.UpdateServiceNotification"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeType(); this.__writeMessage(); var mediaBytes = this.media.serialize({isBare: false}); this._writeBytes(mediaBytes); var popupBytes = this.popup.serialize({isBare: false}); this._writeBytes(popupBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readType(); this.__readMessage(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', MessageMedia, bytes.toString('hex'), 'MessageMedia'); } var MessageMedia = this.constructor.requireTypeFromBuffer(bytes); if (MessageMedia) { var obj = new MessageMedia({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.media = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type MessageMedia and buffer:' + this._buffer.toString('hex')); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Bool, bytes.toString('hex'), 'Bool'); } var Bool = this.constructor.requireTypeFromBuffer(bytes); if (Bool) { var obj = new Bool({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.popup = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Bool and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeType = function __writeType() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'type', this.type); } this.writeString(this.type); }; this.__writeMessage = function __writeMessage() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'message', this.message); } this.writeString(this.message); }; this.__readType = function __readType() { this.type = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'type', this.type, this._readOffset); } }; this.__readMessage = function __readMessage() { this.message = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'message', this.message, this._readOffset); } }; }::false userStatusRecently::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'f1426fe2'; this._typeName = "Telegram.type.UserStatusRecently"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false userStatusLastWeek::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'fc09bf07'; this._typeName = "Telegram.type.UserStatusLastWeek"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false userStatusLastMonth::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '42c7eb77'; this._typeName = "Telegram.type.UserStatusLastMonth"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false updatePrivacy::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '2a273bee'; this._typeName = "Telegram.type.UpdatePrivacy"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var keyBytes = this.key.serialize({isBare: false}); this._writeBytes(keyBytes); var rulesBytes = this.rules.serialize({isBare: false}); this._writeBytes(rulesBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', PrivacyKey, bytes.toString('hex'), 'PrivacyKey'); } var PrivacyKey = this.constructor.requireTypeFromBuffer(bytes); if (PrivacyKey) { var obj = new PrivacyKey({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.key = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type PrivacyKey and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'PrivacyRule', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.rules = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false inputPrivacyKeyStatusTimestamp::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '18cb964f'; this._typeName = "Telegram.type.InputPrivacyKeyStatusTimestamp"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false privacyKeyStatusTimestamp::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '30ab2ebc'; this._typeName = "Telegram.type.PrivacyKeyStatusTimestamp"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputPrivacyValueAllowContacts::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '7be0090d'; this._typeName = "Telegram.type.InputPrivacyValueAllowContacts"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputPrivacyValueAllowAll::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'ce354b18'; this._typeName = "Telegram.type.InputPrivacyValueAllowAll"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputPrivacyValueAllowUsers::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '7fc61c13'; this._typeName = "Telegram.type.InputPrivacyValueAllowUsers"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'InputUser', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false inputPrivacyValueDisallowContacts::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '0720a50b'; this._typeName = "Telegram.type.InputPrivacyValueDisallowContacts"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputPrivacyValueDisallowAll::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c9666bd6'; this._typeName = "Telegram.type.InputPrivacyValueDisallowAll"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputPrivacyValueDisallowUsers::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '67041190'; this._typeName = "Telegram.type.InputPrivacyValueDisallowUsers"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'InputUser', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false privacyValueAllowContacts::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'ac1bfeff'; this._typeName = "Telegram.type.PrivacyValueAllowContacts"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false privacyValueAllowAll::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '827b4265'; this._typeName = "Telegram.type.PrivacyValueAllowAll"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false privacyValueAllowUsers::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '0cbe5b4d'; this._typeName = "Telegram.type.PrivacyValueAllowUsers"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'int', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false privacyValueDisallowContacts::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '1afa88f8'; this._typeName = "Telegram.type.PrivacyValueDisallowContacts"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false privacyValueDisallowAll::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '63e7738b'; this._typeName = "Telegram.type.PrivacyValueDisallowAll"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false privacyValueDisallowUsers::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'b7497f0c'; this._typeName = "Telegram.type.PrivacyValueDisallowUsers"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'int', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false account.privacyRules::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '6fbb4a55'; this._typeName = "Telegram.type.account.PrivacyRules"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var rulesBytes = this.rules.serialize({isBare: false}); this._writeBytes(rulesBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'PrivacyRule', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.rules = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false accountDaysTTL::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'dfafd0b8'; this._typeName = "Telegram.type.AccountDaysTTL"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeDays(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readDays(); return this; }; this.__writeDays = function __writeDays() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'days', this.days); } this.writeInt(this.days); }; this.__readDays = function __readDays() { this.days = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'days', this.days, this._readOffset); } }; }::false updateUserPhone::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '7b41b912'; this._typeName = "Telegram.type.UpdateUserPhone"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); this.__writePhone(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); this.__readPhone(); return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writePhone = function __writePhone() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'phone', this.phone); } this.writeString(this.phone); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readPhone = function __readPhone() { this.phone = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'phone', this.phone, this._readOffset); } }; }::false documentAttributeImageSize::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '5cc1376c'; this._typeName = "Telegram.type.DocumentAttributeImageSize"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeW(); this.__writeH(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readW(); this.__readH(); return this; }; this.__writeW = function __writeW() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'w', this.w); } this.writeInt(this.w); }; this.__writeH = function __writeH() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'h', this.h); } this.writeInt(this.h); }; this.__readW = function __readW() { this.w = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'w', this.w, this._readOffset); } }; this.__readH = function __readH() { this.h = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'h', this.h, this._readOffset); } }; }::false documentAttributeAnimated::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '3989b511'; this._typeName = "Telegram.type.DocumentAttributeAnimated"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false documentAttributeSticker::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '12d61963'; this._typeName = "Telegram.type.DocumentAttributeSticker"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.mask ? (this.flags | 2) : (this.flags & ~2); this.flags = this.mask_coords !== null ? (this.flags | 1) : (this.flags & ~1); this.__writeFlags(); this.__writeAlt(); var stickersetBytes = this.stickerset.serialize({isBare: false}); this._writeBytes(stickersetBytes); if (this.mask_coords) { var mask_coordsBytes = this.mask_coords.serialize({isBare: false}); this._writeBytes(mask_coordsBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 1)) !== 0) { this.__readMask(); } this.__readAlt(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputStickerSet, bytes.toString('hex'), 'InputStickerSet'); } var InputStickerSet = this.constructor.requireTypeFromBuffer(bytes); if (InputStickerSet) { var obj = new InputStickerSet({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.stickerset = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputStickerSet and buffer:' + this._buffer.toString('hex')); } if ((this.flags & (1 << 0)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', MaskCoords, bytes.toString('hex'), 'MaskCoords'); } var MaskCoords = this.constructor.requireTypeFromBuffer(bytes); if (MaskCoords) { var obj = new MaskCoords({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.mask_coords = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type MaskCoords and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeAlt = function __writeAlt() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'alt', this.alt); } this.writeString(this.alt); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readMask = function __readMask() { this.mask = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'mask', this.mask, this._readOffset); } }; this.__readAlt = function __readAlt() { this.alt = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'alt', this.alt, this._readOffset); } }; }::false documentAttributeVideo::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'cbcc1059'; this._typeName = "Telegram.type.DocumentAttributeVideo"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeDuration(); this.__writeW(); this.__writeH(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readDuration(); this.__readW(); this.__readH(); return this; }; this.__writeDuration = function __writeDuration() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'duration', this.duration); } this.writeInt(this.duration); }; this.__writeW = function __writeW() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'w', this.w); } this.writeInt(this.w); }; this.__writeH = function __writeH() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'h', this.h); } this.writeInt(this.h); }; this.__readDuration = function __readDuration() { this.duration = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'duration', this.duration, this._readOffset); } }; this.__readW = function __readW() { this.w = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'w', this.w, this._readOffset); } }; this.__readH = function __readH() { this.h = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'h', this.h, this._readOffset); } }; }::false documentAttributeAudio::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c6f95298'; this._typeName = "Telegram.type.DocumentAttributeAudio"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.voice ? (this.flags | 1024) : (this.flags & ~1024); this.flags = this.title !== null ? (this.flags | 1) : (this.flags & ~1); this.flags = this.performer !== null ? (this.flags | 2) : (this.flags & ~2); this.flags = this.waveform !== null ? (this.flags | 4) : (this.flags & ~4); this.__writeFlags(); this.__writeDuration(); if (this.title) { this.__writeTitle(); } if (this.performer) { this.__writePerformer(); } if (this.waveform) { this.__writeWaveform(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 10)) !== 0) { this.__readVoice(); } this.__readDuration(); if ((this.flags & (1 << 0)) !== 0) { this.__readTitle(); } if ((this.flags & (1 << 1)) !== 0) { this.__readPerformer(); } if ((this.flags & (1 << 2)) !== 0) { this.__readWaveform(); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeDuration = function __writeDuration() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'duration', this.duration); } this.writeInt(this.duration); }; this.__writeTitle = function __writeTitle() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'title', this.title); } this.writeString(this.title); }; this.__writePerformer = function __writePerformer() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'performer', this.performer); } this.writeString(this.performer); }; this.__writeWaveform = function __writeWaveform() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'waveform', this.waveform.toString('hex')); } this.writeBytes(this.waveform); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readVoice = function __readVoice() { this.voice = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'voice', this.voice, this._readOffset); } }; this.__readDuration = function __readDuration() { this.duration = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'duration', this.duration, this._readOffset); } }; this.__readTitle = function __readTitle() { this.title = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'title', this.title, this._readOffset); } }; this.__readPerformer = function __readPerformer() { this.performer = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'performer', this.performer, this._readOffset); } }; this.__readWaveform = function __readWaveform() { this.waveform = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'waveform', this.waveform.toString('hex'), this._readOffset); } }; }::false documentAttributeFilename::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '68005915'; this._typeName = "Telegram.type.DocumentAttributeFilename"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeFile_name(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFile_name(); return this; }; this.__writeFile_name = function __writeFile_name() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'file_name', this.file_name); } this.writeString(this.file_name); }; this.__readFile_name = function __readFile_name() { this.file_name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'file_name', this.file_name, this._readOffset); } }; }::false messages.stickersNotModified::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '229a74f1'; this._typeName = "Telegram.type.messages.StickersNotModified"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false messages.stickers::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '32cd8e8a'; this._typeName = "Telegram.type.messages.Stickers"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeHash(); var stickersBytes = this.stickers.serialize({isBare: false}); this._writeBytes(stickersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readHash(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Document', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.stickers = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeHash = function __writeHash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'hash', this.hash); } this.writeString(this.hash); }; this.__readHash = function __readHash() { this.hash = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'hash', this.hash, this._readOffset); } }; }::false stickerPack::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'd499b212'; this._typeName = "Telegram.type.StickerPack"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeEmoticon(); var documentsBytes = this.documents.serialize({isBare: false}); this._writeBytes(documentsBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readEmoticon(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'long', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.documents = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeEmoticon = function __writeEmoticon() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'emoticon', this.emoticon); } this.writeString(this.emoticon); }; this.__readEmoticon = function __readEmoticon() { this.emoticon = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'emoticon', this.emoticon, this._readOffset); } }; }::false messages.allStickersNotModified::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c30266e8'; this._typeName = "Telegram.type.messages.AllStickersNotModified"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false messages.allStickers::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '5f40fded'; this._typeName = "Telegram.type.messages.AllStickers"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeHash(); var setsBytes = this.sets.serialize({isBare: false}); this._writeBytes(setsBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readHash(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'StickerSet', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.sets = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeHash = function __writeHash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'hash', this.hash); } this.writeInt(this.hash); }; this.__readHash = function __readHash() { this.hash = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'hash', this.hash, this._readOffset); } }; }::false disabledFeature::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '246f63ae'; this._typeName = "Telegram.type.DisabledFeature"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeFeature(); this.__writeDescription(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFeature(); this.__readDescription(); return this; }; this.__writeFeature = function __writeFeature() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'feature', this.feature); } this.writeString(this.feature); }; this.__writeDescription = function __writeDescription() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'description', this.description); } this.writeString(this.description); }; this.__readFeature = function __readFeature() { this.feature = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'feature', this.feature, this._readOffset); } }; this.__readDescription = function __readDescription() { this.description = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'description', this.description, this._readOffset); } }; }::false updateReadHistoryInbox::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '5cfd6199'; this._typeName = "Telegram.type.UpdateReadHistoryInbox"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var peerBytes = this.peer.serialize({isBare: false}); this._writeBytes(peerBytes); this.__writeMax_id(); this.__writePts(); this.__writePts_count(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Peer, bytes.toString('hex'), 'Peer'); } var Peer = this.constructor.requireTypeFromBuffer(bytes); if (Peer) { var obj = new Peer({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.peer = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Peer and buffer:' + this._buffer.toString('hex')); } this.__readMax_id(); this.__readPts(); this.__readPts_count(); return this; }; this.__writeMax_id = function __writeMax_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'max_id', this.max_id); } this.writeInt(this.max_id); }; this.__writePts = function __writePts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts', this.pts); } this.writeInt(this.pts); }; this.__writePts_count = function __writePts_count() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts_count', this.pts_count); } this.writeInt(this.pts_count); }; this.__readMax_id = function __readMax_id() { this.max_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'max_id', this.max_id, this._readOffset); } }; this.__readPts = function __readPts() { this.pts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts', this.pts, this._readOffset); } }; this.__readPts_count = function __readPts_count() { this.pts_count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts_count', this.pts_count, this._readOffset); } }; }::false updateReadHistoryOutbox::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'bf212f2f'; this._typeName = "Telegram.type.UpdateReadHistoryOutbox"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var peerBytes = this.peer.serialize({isBare: false}); this._writeBytes(peerBytes); this.__writeMax_id(); this.__writePts(); this.__writePts_count(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Peer, bytes.toString('hex'), 'Peer'); } var Peer = this.constructor.requireTypeFromBuffer(bytes); if (Peer) { var obj = new Peer({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.peer = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Peer and buffer:' + this._buffer.toString('hex')); } this.__readMax_id(); this.__readPts(); this.__readPts_count(); return this; }; this.__writeMax_id = function __writeMax_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'max_id', this.max_id); } this.writeInt(this.max_id); }; this.__writePts = function __writePts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts', this.pts); } this.writeInt(this.pts); }; this.__writePts_count = function __writePts_count() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts_count', this.pts_count); } this.writeInt(this.pts_count); }; this.__readMax_id = function __readMax_id() { this.max_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'max_id', this.max_id, this._readOffset); } }; this.__readPts = function __readPts() { this.pts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts', this.pts, this._readOffset); } }; this.__readPts_count = function __readPts_count() { this.pts_count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts_count', this.pts_count, this._readOffset); } }; }::false messages.affectedMessages::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '8591d184'; this._typeName = "Telegram.type.messages.AffectedMessages"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writePts(); this.__writePts_count(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readPts(); this.__readPts_count(); return this; }; this.__writePts = function __writePts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts', this.pts); } this.writeInt(this.pts); }; this.__writePts_count = function __writePts_count() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts_count', this.pts_count); } this.writeInt(this.pts_count); }; this.__readPts = function __readPts() { this.pts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts', this.pts, this._readOffset); } }; this.__readPts_count = function __readPts_count() { this.pts_count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts_count', this.pts_count, this._readOffset); } }; }::false contactLinkUnknown::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '47924f5f'; this._typeName = "Telegram.type.ContactLinkUnknown"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false contactLinkNone::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'add3edfe'; this._typeName = "Telegram.type.ContactLinkNone"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false contactLinkHasPhone::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '593f8f26'; this._typeName = "Telegram.type.ContactLinkHasPhone"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false contactLinkContact::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'd0c202d5'; this._typeName = "Telegram.type.ContactLinkContact"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false updateWebPage::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '1312897f'; this._typeName = "Telegram.type.UpdateWebPage"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var webpageBytes = this.webpage.serialize({isBare: false}); this._writeBytes(webpageBytes); this.__writePts(); this.__writePts_count(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', WebPage, bytes.toString('hex'), 'WebPage'); } var WebPage = this.constructor.requireTypeFromBuffer(bytes); if (WebPage) { var obj = new WebPage({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.webpage = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type WebPage and buffer:' + this._buffer.toString('hex')); } this.__readPts(); this.__readPts_count(); return this; }; this.__writePts = function __writePts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts', this.pts); } this.writeInt(this.pts); }; this.__writePts_count = function __writePts_count() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts_count', this.pts_count); } this.writeInt(this.pts_count); }; this.__readPts = function __readPts() { this.pts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts', this.pts, this._readOffset); } }; this.__readPts_count = function __readPts_count() { this.pts_count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts_count', this.pts_count, this._readOffset); } }; }::false webPageEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'e87714eb'; this._typeName = "Telegram.type.WebPageEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeLong(this.id); }; this.__readId = function __readId() { this.id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; }::false webPagePending::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '1cda86c5'; this._typeName = "Telegram.type.WebPagePending"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeDate(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readDate(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeLong(this.id); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__readId = function __readId() { this.id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; }::false webPage::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'd70e82ca'; this._typeName = "Telegram.type.WebPage"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.type !== null ? (this.flags | 1) : (this.flags & ~1); this.flags = this.site_name !== null ? (this.flags | 2) : (this.flags & ~2); this.flags = this.title !== null ? (this.flags | 4) : (this.flags & ~4); this.flags = this.description !== null ? (this.flags | 8) : (this.flags & ~8); this.flags = this.photo !== null ? (this.flags | 16) : (this.flags & ~16); this.flags = this.embed_url !== null ? (this.flags | 32) : (this.flags & ~32); this.flags = this.embed_type !== null ? (this.flags | 32) : (this.flags & ~32); this.flags = this.embed_width !== null ? (this.flags | 64) : (this.flags & ~64); this.flags = this.embed_height !== null ? (this.flags | 64) : (this.flags & ~64); this.flags = this.duration !== null ? (this.flags | 128) : (this.flags & ~128); this.flags = this.author !== null ? (this.flags | 256) : (this.flags & ~256); this.flags = this.document !== null ? (this.flags | 512) : (this.flags & ~512); this.__writeFlags(); this.__writeId(); this.__writeUrl(); this.__writeDisplay_url(); if (this.type) { this.__writeType(); } if (this.site_name) { this.__writeSite_name(); } if (this.title) { this.__writeTitle(); } if (this.description) { this.__writeDescription(); } if (this.photo) { var photoBytes = this.photo.serialize({isBare: false}); this._writeBytes(photoBytes); } if (this.embed_url) { this.__writeEmbed_url(); } if (this.embed_type) { this.__writeEmbed_type(); } if (this.embed_width) { this.__writeEmbed_width(); } if (this.embed_height) { this.__writeEmbed_height(); } if (this.duration) { this.__writeDuration(); } if (this.author) { this.__writeAuthor(); } if (this.document) { var documentBytes = this.document.serialize({isBare: false}); this._writeBytes(documentBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); this.__readId(); this.__readUrl(); this.__readDisplay_url(); if ((this.flags & (1 << 0)) !== 0) { this.__readType(); } if ((this.flags & (1 << 1)) !== 0) { this.__readSite_name(); } if ((this.flags & (1 << 2)) !== 0) { this.__readTitle(); } if ((this.flags & (1 << 3)) !== 0) { this.__readDescription(); } if ((this.flags & (1 << 4)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Photo, bytes.toString('hex'), 'Photo'); } var Photo = this.constructor.requireTypeFromBuffer(bytes); if (Photo) { var obj = new Photo({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.photo = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Photo and buffer:' + this._buffer.toString('hex')); } } if ((this.flags & (1 << 5)) !== 0) { this.__readEmbed_url(); } if ((this.flags & (1 << 5)) !== 0) { this.__readEmbed_type(); } if ((this.flags & (1 << 6)) !== 0) { this.__readEmbed_width(); } if ((this.flags & (1 << 6)) !== 0) { this.__readEmbed_height(); } if ((this.flags & (1 << 7)) !== 0) { this.__readDuration(); } if ((this.flags & (1 << 8)) !== 0) { this.__readAuthor(); } if ((this.flags & (1 << 9)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Document, bytes.toString('hex'), 'Document'); } var Document = this.constructor.requireTypeFromBuffer(bytes); if (Document) { var obj = new Document({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.document = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Document and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeLong(this.id); }; this.__writeUrl = function __writeUrl() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'url', this.url); } this.writeString(this.url); }; this.__writeDisplay_url = function __writeDisplay_url() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'display_url', this.display_url); } this.writeString(this.display_url); }; this.__writeType = function __writeType() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'type', this.type); } this.writeString(this.type); }; this.__writeSite_name = function __writeSite_name() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'site_name', this.site_name); } this.writeString(this.site_name); }; this.__writeTitle = function __writeTitle() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'title', this.title); } this.writeString(this.title); }; this.__writeDescription = function __writeDescription() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'description', this.description); } this.writeString(this.description); }; this.__writeEmbed_url = function __writeEmbed_url() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'embed_url', this.embed_url); } this.writeString(this.embed_url); }; this.__writeEmbed_type = function __writeEmbed_type() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'embed_type', this.embed_type); } this.writeString(this.embed_type); }; this.__writeEmbed_width = function __writeEmbed_width() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'embed_width', this.embed_width); } this.writeInt(this.embed_width); }; this.__writeEmbed_height = function __writeEmbed_height() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'embed_height', this.embed_height); } this.writeInt(this.embed_height); }; this.__writeDuration = function __writeDuration() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'duration', this.duration); } this.writeInt(this.duration); }; this.__writeAuthor = function __writeAuthor() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'author', this.author); } this.writeString(this.author); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readId = function __readId() { this.id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readUrl = function __readUrl() { this.url = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'url', this.url, this._readOffset); } }; this.__readDisplay_url = function __readDisplay_url() { this.display_url = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'display_url', this.display_url, this._readOffset); } }; this.__readType = function __readType() { this.type = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'type', this.type, this._readOffset); } }; this.__readSite_name = function __readSite_name() { this.site_name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'site_name', this.site_name, this._readOffset); } }; this.__readTitle = function __readTitle() { this.title = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'title', this.title, this._readOffset); } }; this.__readDescription = function __readDescription() { this.description = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'description', this.description, this._readOffset); } }; this.__readEmbed_url = function __readEmbed_url() { this.embed_url = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'embed_url', this.embed_url, this._readOffset); } }; this.__readEmbed_type = function __readEmbed_type() { this.embed_type = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'embed_type', this.embed_type, this._readOffset); } }; this.__readEmbed_width = function __readEmbed_width() { this.embed_width = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'embed_width', this.embed_width, this._readOffset); } }; this.__readEmbed_height = function __readEmbed_height() { this.embed_height = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'embed_height', this.embed_height, this._readOffset); } }; this.__readDuration = function __readDuration() { this.duration = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'duration', this.duration, this._readOffset); } }; this.__readAuthor = function __readAuthor() { this.author = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'author', this.author, this._readOffset); } }; }::false messageMediaWebPage::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '00d62da3'; this._typeName = "Telegram.type.MessageMediaWebPage"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var webpageBytes = this.webpage.serialize({isBare: false}); this._writeBytes(webpageBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', WebPage, bytes.toString('hex'), 'WebPage'); } var WebPage = this.constructor.requireTypeFromBuffer(bytes); if (WebPage) { var obj = new WebPage({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.webpage = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type WebPage and buffer:' + this._buffer.toString('hex')); } return this; }; }::false authorization::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'f6e6f27b'; this._typeName = "Telegram.type.Authorization"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeHash(); this.__writeFlags(); this.__writeDevice_model(); this.__writePlatform(); this.__writeSystem_version(); this.__writeApi_id(); this.__writeApp_name(); this.__writeApp_version(); this.__writeDate_created(); this.__writeDate_active(); this.__writeIp(); this.__writeCountry(); this.__writeRegion(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readHash(); this.__readFlags(); this.__readDevice_model(); this.__readPlatform(); this.__readSystem_version(); this.__readApi_id(); this.__readApp_name(); this.__readApp_version(); this.__readDate_created(); this.__readDate_active(); this.__readIp(); this.__readCountry(); this.__readRegion(); return this; }; this.__writeHash = function __writeHash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'hash', this.hash); } this.writeLong(this.hash); }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeDevice_model = function __writeDevice_model() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'device_model', this.device_model); } this.writeString(this.device_model); }; this.__writePlatform = function __writePlatform() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'platform', this.platform); } this.writeString(this.platform); }; this.__writeSystem_version = function __writeSystem_version() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'system_version', this.system_version); } this.writeString(this.system_version); }; this.__writeApi_id = function __writeApi_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'api_id', this.api_id); } this.writeInt(this.api_id); }; this.__writeApp_name = function __writeApp_name() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'app_name', this.app_name); } this.writeString(this.app_name); }; this.__writeApp_version = function __writeApp_version() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'app_version', this.app_version); } this.writeString(this.app_version); }; this.__writeDate_created = function __writeDate_created() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date_created', this.date_created); } this.writeInt(this.date_created); }; this.__writeDate_active = function __writeDate_active() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date_active', this.date_active); } this.writeInt(this.date_active); }; this.__writeIp = function __writeIp() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'ip', this.ip); } this.writeString(this.ip); }; this.__writeCountry = function __writeCountry() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'country', this.country); } this.writeString(this.country); }; this.__writeRegion = function __writeRegion() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'region', this.region); } this.writeString(this.region); }; this.__readHash = function __readHash() { this.hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'hash', this.hash, this._readOffset); } }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readDevice_model = function __readDevice_model() { this.device_model = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'device_model', this.device_model, this._readOffset); } }; this.__readPlatform = function __readPlatform() { this.platform = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'platform', this.platform, this._readOffset); } }; this.__readSystem_version = function __readSystem_version() { this.system_version = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'system_version', this.system_version, this._readOffset); } }; this.__readApi_id = function __readApi_id() { this.api_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'api_id', this.api_id, this._readOffset); } }; this.__readApp_name = function __readApp_name() { this.app_name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'app_name', this.app_name, this._readOffset); } }; this.__readApp_version = function __readApp_version() { this.app_version = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'app_version', this.app_version, this._readOffset); } }; this.__readDate_created = function __readDate_created() { this.date_created = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date_created', this.date_created, this._readOffset); } }; this.__readDate_active = function __readDate_active() { this.date_active = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date_active', this.date_active, this._readOffset); } }; this.__readIp = function __readIp() { this.ip = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'ip', this.ip, this._readOffset); } }; this.__readCountry = function __readCountry() { this.country = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'country', this.country, this._readOffset); } }; this.__readRegion = function __readRegion() { this.region = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'region', this.region, this._readOffset); } }; }::false account.authorizations::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'deab5012'; this._typeName = "Telegram.type.account.Authorizations"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var authorizationsBytes = this.authorizations.serialize({isBare: false}); this._writeBytes(authorizationsBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Authorization', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.authorizations = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false account.noPassword::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '18bcda96'; this._typeName = "Telegram.type.account.NoPassword"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeNew_salt(); this.__writeEmail_unconfirmed_pattern(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readNew_salt(); this.__readEmail_unconfirmed_pattern(); return this; }; this.__writeNew_salt = function __writeNew_salt() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'new_salt', this.new_salt.toString('hex')); } this.writeBytes(this.new_salt); }; this.__writeEmail_unconfirmed_pattern = function __writeEmail_unconfirmed_pattern() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'email_unconfirmed_pattern', this.email_unconfirmed_pattern); } this.writeString(this.email_unconfirmed_pattern); }; this.__readNew_salt = function __readNew_salt() { this.new_salt = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'new_salt', this.new_salt.toString('hex'), this._readOffset); } }; this.__readEmail_unconfirmed_pattern = function __readEmail_unconfirmed_pattern() { this.email_unconfirmed_pattern = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'email_unconfirmed_pattern', this.email_unconfirmed_pattern, this._readOffset); } }; }::false account.password::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '1c14187c'; this._typeName = "Telegram.type.account.Password"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeCurrent_salt(); this.__writeNew_salt(); this.__writeHint(); var has_recoveryBytes = this.has_recovery.serialize({isBare: false}); this._writeBytes(has_recoveryBytes); this.__writeEmail_unconfirmed_pattern(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readCurrent_salt(); this.__readNew_salt(); this.__readHint(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Bool, bytes.toString('hex'), 'Bool'); } var Bool = this.constructor.requireTypeFromBuffer(bytes); if (Bool) { var obj = new Bool({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.has_recovery = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Bool and buffer:' + this._buffer.toString('hex')); } this.__readEmail_unconfirmed_pattern(); return this; }; this.__writeCurrent_salt = function __writeCurrent_salt() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'current_salt', this.current_salt.toString('hex')); } this.writeBytes(this.current_salt); }; this.__writeNew_salt = function __writeNew_salt() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'new_salt', this.new_salt.toString('hex')); } this.writeBytes(this.new_salt); }; this.__writeHint = function __writeHint() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'hint', this.hint); } this.writeString(this.hint); }; this.__writeEmail_unconfirmed_pattern = function __writeEmail_unconfirmed_pattern() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'email_unconfirmed_pattern', this.email_unconfirmed_pattern); } this.writeString(this.email_unconfirmed_pattern); }; this.__readCurrent_salt = function __readCurrent_salt() { this.current_salt = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'current_salt', this.current_salt.toString('hex'), this._readOffset); } }; this.__readNew_salt = function __readNew_salt() { this.new_salt = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'new_salt', this.new_salt.toString('hex'), this._readOffset); } }; this.__readHint = function __readHint() { this.hint = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'hint', this.hint, this._readOffset); } }; this.__readEmail_unconfirmed_pattern = function __readEmail_unconfirmed_pattern() { this.email_unconfirmed_pattern = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'email_unconfirmed_pattern', this.email_unconfirmed_pattern, this._readOffset); } }; }::false account.passwordSettings::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'b32ab7b7'; this._typeName = "Telegram.type.account.PasswordSettings"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeEmail(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readEmail(); return this; }; this.__writeEmail = function __writeEmail() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'email', this.email); } this.writeString(this.email); }; this.__readEmail = function __readEmail() { this.email = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'email', this.email, this._readOffset); } }; }::false account.passwordInputSettings::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'eb6d9186'; this._typeName = "Telegram.type.account.PasswordInputSettings"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.new_salt !== null ? (this.flags | 1) : (this.flags & ~1); this.flags = this.new_password_hash !== null ? (this.flags | 1) : (this.flags & ~1); this.flags = this.hint !== null ? (this.flags | 1) : (this.flags & ~1); this.flags = this.email !== null ? (this.flags | 2) : (this.flags & ~2); this.__writeFlags(); if (this.new_salt) { this.__writeNew_salt(); } if (this.new_password_hash) { this.__writeNew_password_hash(); } if (this.hint) { this.__writeHint(); } if (this.email) { this.__writeEmail(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 0)) !== 0) { this.__readNew_salt(); } if ((this.flags & (1 << 0)) !== 0) { this.__readNew_password_hash(); } if ((this.flags & (1 << 0)) !== 0) { this.__readHint(); } if ((this.flags & (1 << 1)) !== 0) { this.__readEmail(); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeNew_salt = function __writeNew_salt() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'new_salt', this.new_salt.toString('hex')); } this.writeBytes(this.new_salt); }; this.__writeNew_password_hash = function __writeNew_password_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'new_password_hash', this.new_password_hash.toString('hex')); } this.writeBytes(this.new_password_hash); }; this.__writeHint = function __writeHint() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'hint', this.hint); } this.writeString(this.hint); }; this.__writeEmail = function __writeEmail() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'email', this.email); } this.writeString(this.email); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readNew_salt = function __readNew_salt() { this.new_salt = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'new_salt', this.new_salt.toString('hex'), this._readOffset); } }; this.__readNew_password_hash = function __readNew_password_hash() { this.new_password_hash = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'new_password_hash', this.new_password_hash.toString('hex'), this._readOffset); } }; this.__readHint = function __readHint() { this.hint = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'hint', this.hint, this._readOffset); } }; this.__readEmail = function __readEmail() { this.email = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'email', this.email, this._readOffset); } }; }::false auth.passwordRecovery::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a5487913'; this._typeName = "Telegram.type.auth.PasswordRecovery"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeEmail_pattern(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readEmail_pattern(); return this; }; this.__writeEmail_pattern = function __writeEmail_pattern() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'email_pattern', this.email_pattern); } this.writeString(this.email_pattern); }; this.__readEmail_pattern = function __readEmail_pattern() { this.email_pattern = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'email_pattern', this.email_pattern, this._readOffset); } }; }::false inputMediaVenue::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '1aa82728'; this._typeName = "Telegram.type.InputMediaVenue"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var geo_pointBytes = this.geo_point.serialize({isBare: false}); this._writeBytes(geo_pointBytes); this.__writeTitle(); this.__writeAddress(); this.__writeProvider(); this.__writeVenue_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputGeoPoint, bytes.toString('hex'), 'InputGeoPoint'); } var InputGeoPoint = this.constructor.requireTypeFromBuffer(bytes); if (InputGeoPoint) { var obj = new InputGeoPoint({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.geo_point = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputGeoPoint and buffer:' + this._buffer.toString('hex')); } this.__readTitle(); this.__readAddress(); this.__readProvider(); this.__readVenue_id(); return this; }; this.__writeTitle = function __writeTitle() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'title', this.title); } this.writeString(this.title); }; this.__writeAddress = function __writeAddress() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'address', this.address); } this.writeString(this.address); }; this.__writeProvider = function __writeProvider() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'provider', this.provider); } this.writeString(this.provider); }; this.__writeVenue_id = function __writeVenue_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'venue_id', this.venue_id); } this.writeString(this.venue_id); }; this.__readTitle = function __readTitle() { this.title = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'title', this.title, this._readOffset); } }; this.__readAddress = function __readAddress() { this.address = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'address', this.address, this._readOffset); } }; this.__readProvider = function __readProvider() { this.provider = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'provider', this.provider, this._readOffset); } }; this.__readVenue_id = function __readVenue_id() { this.venue_id = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'venue_id', this.venue_id, this._readOffset); } }; }::false messageMediaVenue::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '1fb71279'; this._typeName = "Telegram.type.MessageMediaVenue"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var geoBytes = this.geo.serialize({isBare: false}); this._writeBytes(geoBytes); this.__writeTitle(); this.__writeAddress(); this.__writeProvider(); this.__writeVenue_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', GeoPoint, bytes.toString('hex'), 'GeoPoint'); } var GeoPoint = this.constructor.requireTypeFromBuffer(bytes); if (GeoPoint) { var obj = new GeoPoint({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.geo = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type GeoPoint and buffer:' + this._buffer.toString('hex')); } this.__readTitle(); this.__readAddress(); this.__readProvider(); this.__readVenue_id(); return this; }; this.__writeTitle = function __writeTitle() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'title', this.title); } this.writeString(this.title); }; this.__writeAddress = function __writeAddress() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'address', this.address); } this.writeString(this.address); }; this.__writeProvider = function __writeProvider() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'provider', this.provider); } this.writeString(this.provider); }; this.__writeVenue_id = function __writeVenue_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'venue_id', this.venue_id); } this.writeString(this.venue_id); }; this.__readTitle = function __readTitle() { this.title = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'title', this.title, this._readOffset); } }; this.__readAddress = function __readAddress() { this.address = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'address', this.address, this._readOffset); } }; this.__readProvider = function __readProvider() { this.provider = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'provider', this.provider, this._readOffset); } }; this.__readVenue_id = function __readVenue_id() { this.venue_id = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'venue_id', this.venue_id, this._readOffset); } }; }::false receivedNotifyMessage::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '79b784a3'; this._typeName = "Telegram.type.ReceivedNotifyMessage"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeFlags(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readFlags(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; }::false chatInviteEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '6937df69'; this._typeName = "Telegram.type.ChatInviteEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false chatInviteExported::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'bc052efc'; this._typeName = "Telegram.type.ChatInviteExported"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeLink(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readLink(); return this; }; this.__writeLink = function __writeLink() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'link', this.link); } this.writeString(this.link); }; this.__readLink = function __readLink() { this.link = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'link', this.link, this._readOffset); } }; }::false chatInviteAlready::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '7c6d685a'; this._typeName = "Telegram.type.ChatInviteAlready"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var chatBytes = this.chat.serialize({isBare: false}); this._writeBytes(chatBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Chat, bytes.toString('hex'), 'Chat'); } var Chat = this.constructor.requireTypeFromBuffer(bytes); if (Chat) { var obj = new Chat({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.chat = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Chat and buffer:' + this._buffer.toString('hex')); } return this; }; }::false chatInvite::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '58f574db'; this._typeName = "Telegram.type.ChatInvite"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.channel ? (this.flags | 1) : (this.flags & ~1); this.flags = this.broadcast ? (this.flags | 2) : (this.flags & ~2); this.flags = this.public ? (this.flags | 4) : (this.flags & ~4); this.flags = this.megagroup ? (this.flags | 8) : (this.flags & ~8); this.flags = this.participants !== null ? (this.flags | 16) : (this.flags & ~16); this.__writeFlags(); this.__writeTitle(); var photoBytes = this.photo.serialize({isBare: false}); this._writeBytes(photoBytes); this.__writeParticipants_count(); if (this.participants) { var participantsBytes = this.participants.serialize({isBare: false}); this._writeBytes(participantsBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 0)) !== 0) { this.__readChannel(); } if ((this.flags & (1 << 1)) !== 0) { this.__readBroadcast(); } if ((this.flags & (1 << 2)) !== 0) { this.__readPublic(); } if ((this.flags & (1 << 3)) !== 0) { this.__readMegagroup(); } this.__readTitle(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ChatPhoto, bytes.toString('hex'), 'ChatPhoto'); } var ChatPhoto = this.constructor.requireTypeFromBuffer(bytes); if (ChatPhoto) { var obj = new ChatPhoto({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.photo = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ChatPhoto and buffer:' + this._buffer.toString('hex')); } this.__readParticipants_count(); if ((this.flags & (1 << 4)) !== 0) { var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.participants = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeTitle = function __writeTitle() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'title', this.title); } this.writeString(this.title); }; this.__writeParticipants_count = function __writeParticipants_count() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'participants_count', this.participants_count); } this.writeInt(this.participants_count); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readChannel = function __readChannel() { this.channel = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'channel', this.channel, this._readOffset); } }; this.__readBroadcast = function __readBroadcast() { this.broadcast = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'broadcast', this.broadcast, this._readOffset); } }; this.__readPublic = function __readPublic() { this.public = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'public', this.public, this._readOffset); } }; this.__readMegagroup = function __readMegagroup() { this.megagroup = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'megagroup', this.megagroup, this._readOffset); } }; this.__readTitle = function __readTitle() { this.title = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'title', this.title, this._readOffset); } }; this.__readParticipants_count = function __readParticipants_count() { this.participants_count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'participants_count', this.participants_count, this._readOffset); } }; }::false messageActionChatJoinedByLink::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'e8f59cf8'; this._typeName = "Telegram.type.MessageActionChatJoinedByLink"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeInviter_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readInviter_id(); return this; }; this.__writeInviter_id = function __writeInviter_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'inviter_id', this.inviter_id); } this.writeInt(this.inviter_id); }; this.__readInviter_id = function __readInviter_id() { this.inviter_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'inviter_id', this.inviter_id, this._readOffset); } }; }::false updateReadMessagesContents::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '3339c168'; this._typeName = "Telegram.type.UpdateReadMessagesContents"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var messagesBytes = this.messages.serialize({isBare: false}); this._writeBytes(messagesBytes); this.__writePts(); this.__writePts_count(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'int', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.messages = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } this.__readPts(); this.__readPts_count(); return this; }; this.__writePts = function __writePts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts', this.pts); } this.writeInt(this.pts); }; this.__writePts_count = function __writePts_count() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts_count', this.pts_count); } this.writeInt(this.pts_count); }; this.__readPts = function __readPts() { this.pts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts', this.pts, this._readOffset); } }; this.__readPts_count = function __readPts_count() { this.pts_count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts_count', this.pts_count, this._readOffset); } }; }::false inputStickerSetEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '952bb6ff'; this._typeName = "Telegram.type.InputStickerSetEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputStickerSetID::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '69a2e79d'; this._typeName = "Telegram.type.InputStickerSetID"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeAccess_hash(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readAccess_hash(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeLong(this.id); }; this.__writeAccess_hash = function __writeAccess_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'access_hash', this.access_hash); } this.writeLong(this.access_hash); }; this.__readId = function __readId() { this.id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readAccess_hash = function __readAccess_hash() { this.access_hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'access_hash', this.access_hash, this._readOffset); } }; }::false inputStickerSetShortName::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a0c81c86'; this._typeName = "Telegram.type.InputStickerSetShortName"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeShort_name(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readShort_name(); return this; }; this.__writeShort_name = function __writeShort_name() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'short_name', this.short_name); } this.writeString(this.short_name); }; this.__readShort_name = function __readShort_name() { this.short_name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'short_name', this.short_name, this._readOffset); } }; }::false stickerSet::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '413b30cd'; this._typeName = "Telegram.type.StickerSet"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.installed ? (this.flags | 1) : (this.flags & ~1); this.flags = this.archived ? (this.flags | 2) : (this.flags & ~2); this.flags = this.official ? (this.flags | 4) : (this.flags & ~4); this.flags = this.masks ? (this.flags | 8) : (this.flags & ~8); this.__writeFlags(); this.__writeId(); this.__writeAccess_hash(); this.__writeTitle(); this.__writeShort_name(); this.__writeCount(); this.__writeHash(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 0)) !== 0) { this.__readInstalled(); } if ((this.flags & (1 << 1)) !== 0) { this.__readArchived(); } if ((this.flags & (1 << 2)) !== 0) { this.__readOfficial(); } if ((this.flags & (1 << 3)) !== 0) { this.__readMasks(); } this.__readId(); this.__readAccess_hash(); this.__readTitle(); this.__readShort_name(); this.__readCount(); this.__readHash(); return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeLong(this.id); }; this.__writeAccess_hash = function __writeAccess_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'access_hash', this.access_hash); } this.writeLong(this.access_hash); }; this.__writeTitle = function __writeTitle() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'title', this.title); } this.writeString(this.title); }; this.__writeShort_name = function __writeShort_name() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'short_name', this.short_name); } this.writeString(this.short_name); }; this.__writeCount = function __writeCount() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'count', this.count); } this.writeInt(this.count); }; this.__writeHash = function __writeHash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'hash', this.hash); } this.writeInt(this.hash); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readInstalled = function __readInstalled() { this.installed = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'installed', this.installed, this._readOffset); } }; this.__readArchived = function __readArchived() { this.archived = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'archived', this.archived, this._readOffset); } }; this.__readOfficial = function __readOfficial() { this.official = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'official', this.official, this._readOffset); } }; this.__readMasks = function __readMasks() { this.masks = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'masks', this.masks, this._readOffset); } }; this.__readId = function __readId() { this.id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readAccess_hash = function __readAccess_hash() { this.access_hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'access_hash', this.access_hash, this._readOffset); } }; this.__readTitle = function __readTitle() { this.title = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'title', this.title, this._readOffset); } }; this.__readShort_name = function __readShort_name() { this.short_name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'short_name', this.short_name, this._readOffset); } }; this.__readCount = function __readCount() { this.count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'count', this.count, this._readOffset); } }; this.__readHash = function __readHash() { this.hash = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'hash', this.hash, this._readOffset); } }; }::false messages.stickerSet::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a6240ab6'; this._typeName = "Telegram.type.messages.StickerSet"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var setBytes = this.set.serialize({isBare: false}); this._writeBytes(setBytes); var packsBytes = this.packs.serialize({isBare: false}); this._writeBytes(packsBytes); var documentsBytes = this.documents.serialize({isBare: false}); this._writeBytes(documentsBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', StickerSet, bytes.toString('hex'), 'StickerSet'); } var StickerSet = this.constructor.requireTypeFromBuffer(bytes); if (StickerSet) { var obj = new StickerSet({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.set = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type StickerSet and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'StickerPack', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.packs = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Document', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.documents = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false user::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '9a970dd1'; this._typeName = "Telegram.type.User"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.self ? (this.flags | 1024) : (this.flags & ~1024); this.flags = this.contact ? (this.flags | 2048) : (this.flags & ~2048); this.flags = this.mutual_contact ? (this.flags | 4096) : (this.flags & ~4096); this.flags = this.deleted ? (this.flags | 8192) : (this.flags & ~8192); this.flags = this.bot ? (this.flags | 16384) : (this.flags & ~16384); this.flags = this.bot_chat_history ? (this.flags | 32768) : (this.flags & ~32768); this.flags = this.bot_nochats ? (this.flags | 65536) : (this.flags & ~65536); this.flags = this.verified ? (this.flags | 131072) : (this.flags & ~131072); this.flags = this.restricted ? (this.flags | 262144) : (this.flags & ~262144); this.flags = this.min ? (this.flags | 1048576) : (this.flags & ~1048576); this.flags = this.bot_inline_geo ? (this.flags | 2097152) : (this.flags & ~2097152); this.flags = this.access_hash !== null ? (this.flags | 1) : (this.flags & ~1); this.flags = this.first_name !== null ? (this.flags | 2) : (this.flags & ~2); this.flags = this.last_name !== null ? (this.flags | 4) : (this.flags & ~4); this.flags = this.username !== null ? (this.flags | 8) : (this.flags & ~8); this.flags = this.phone !== null ? (this.flags | 16) : (this.flags & ~16); this.flags = this.photo !== null ? (this.flags | 32) : (this.flags & ~32); this.flags = this.status !== null ? (this.flags | 64) : (this.flags & ~64); this.flags = this.bot_info_version !== null ? (this.flags | 16384) : (this.flags & ~16384); this.flags = this.restriction_reason !== null ? (this.flags | 262144) : (this.flags & ~262144); this.flags = this.bot_inline_placeholder !== null ? (this.flags | 524288) : (this.flags & ~524288); this.__writeFlags(); this.__writeId(); if (this.access_hash) { this.__writeAccess_hash(); } if (this.first_name) { this.__writeFirst_name(); } if (this.last_name) { this.__writeLast_name(); } if (this.username) { this.__writeUsername(); } if (this.phone) { this.__writePhone(); } if (this.photo) { var photoBytes = this.photo.serialize({isBare: false}); this._writeBytes(photoBytes); } if (this.status) { var statusBytes = this.status.serialize({isBare: false}); this._writeBytes(statusBytes); } if (this.bot_info_version) { this.__writeBot_info_version(); } if (this.restriction_reason) { this.__writeRestriction_reason(); } if (this.bot_inline_placeholder) { this.__writeBot_inline_placeholder(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 10)) !== 0) { this.__readSelf(); } if ((this.flags & (1 << 11)) !== 0) { this.__readContact(); } if ((this.flags & (1 << 12)) !== 0) { this.__readMutual_contact(); } if ((this.flags & (1 << 13)) !== 0) { this.__readDeleted(); } if ((this.flags & (1 << 14)) !== 0) { this.__readBot(); } if ((this.flags & (1 << 15)) !== 0) { this.__readBot_chat_history(); } if ((this.flags & (1 << 16)) !== 0) { this.__readBot_nochats(); } if ((this.flags & (1 << 17)) !== 0) { this.__readVerified(); } if ((this.flags & (1 << 18)) !== 0) { this.__readRestricted(); } if ((this.flags & (1 << 20)) !== 0) { this.__readMin(); } if ((this.flags & (1 << 21)) !== 0) { this.__readBot_inline_geo(); } this.__readId(); if ((this.flags & (1 << 0)) !== 0) { this.__readAccess_hash(); } if ((this.flags & (1 << 1)) !== 0) { this.__readFirst_name(); } if ((this.flags & (1 << 2)) !== 0) { this.__readLast_name(); } if ((this.flags & (1 << 3)) !== 0) { this.__readUsername(); } if ((this.flags & (1 << 4)) !== 0) { this.__readPhone(); } if ((this.flags & (1 << 5)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', UserProfilePhoto, bytes.toString('hex'), 'UserProfilePhoto'); } var UserProfilePhoto = this.constructor.requireTypeFromBuffer(bytes); if (UserProfilePhoto) { var obj = new UserProfilePhoto({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.photo = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type UserProfilePhoto and buffer:' + this._buffer.toString('hex')); } } if ((this.flags & (1 << 6)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', UserStatus, bytes.toString('hex'), 'UserStatus'); } var UserStatus = this.constructor.requireTypeFromBuffer(bytes); if (UserStatus) { var obj = new UserStatus({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.status = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type UserStatus and buffer:' + this._buffer.toString('hex')); } } if ((this.flags & (1 << 14)) !== 0) { this.__readBot_info_version(); } if ((this.flags & (1 << 18)) !== 0) { this.__readRestriction_reason(); } if ((this.flags & (1 << 19)) !== 0) { this.__readBot_inline_placeholder(); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__writeAccess_hash = function __writeAccess_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'access_hash', this.access_hash); } this.writeLong(this.access_hash); }; this.__writeFirst_name = function __writeFirst_name() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'first_name', this.first_name); } this.writeString(this.first_name); }; this.__writeLast_name = function __writeLast_name() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'last_name', this.last_name); } this.writeString(this.last_name); }; this.__writeUsername = function __writeUsername() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'username', this.username); } this.writeString(this.username); }; this.__writePhone = function __writePhone() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'phone', this.phone); } this.writeString(this.phone); }; this.__writeBot_info_version = function __writeBot_info_version() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'bot_info_version', this.bot_info_version); } this.writeInt(this.bot_info_version); }; this.__writeRestriction_reason = function __writeRestriction_reason() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'restriction_reason', this.restriction_reason); } this.writeString(this.restriction_reason); }; this.__writeBot_inline_placeholder = function __writeBot_inline_placeholder() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'bot_inline_placeholder', this.bot_inline_placeholder); } this.writeString(this.bot_inline_placeholder); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readSelf = function __readSelf() { this.self = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'self', this.self, this._readOffset); } }; this.__readContact = function __readContact() { this.contact = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'contact', this.contact, this._readOffset); } }; this.__readMutual_contact = function __readMutual_contact() { this.mutual_contact = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'mutual_contact', this.mutual_contact, this._readOffset); } }; this.__readDeleted = function __readDeleted() { this.deleted = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'deleted', this.deleted, this._readOffset); } }; this.__readBot = function __readBot() { this.bot = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'bot', this.bot, this._readOffset); } }; this.__readBot_chat_history = function __readBot_chat_history() { this.bot_chat_history = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'bot_chat_history', this.bot_chat_history, this._readOffset); } }; this.__readBot_nochats = function __readBot_nochats() { this.bot_nochats = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'bot_nochats', this.bot_nochats, this._readOffset); } }; this.__readVerified = function __readVerified() { this.verified = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'verified', this.verified, this._readOffset); } }; this.__readRestricted = function __readRestricted() { this.restricted = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'restricted', this.restricted, this._readOffset); } }; this.__readMin = function __readMin() { this.min = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'min', this.min, this._readOffset); } }; this.__readBot_inline_geo = function __readBot_inline_geo() { this.bot_inline_geo = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'bot_inline_geo', this.bot_inline_geo, this._readOffset); } }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readAccess_hash = function __readAccess_hash() { this.access_hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'access_hash', this.access_hash, this._readOffset); } }; this.__readFirst_name = function __readFirst_name() { this.first_name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'first_name', this.first_name, this._readOffset); } }; this.__readLast_name = function __readLast_name() { this.last_name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'last_name', this.last_name, this._readOffset); } }; this.__readUsername = function __readUsername() { this.username = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'username', this.username, this._readOffset); } }; this.__readPhone = function __readPhone() { this.phone = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'phone', this.phone, this._readOffset); } }; this.__readBot_info_version = function __readBot_info_version() { this.bot_info_version = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'bot_info_version', this.bot_info_version, this._readOffset); } }; this.__readRestriction_reason = function __readRestriction_reason() { this.restriction_reason = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'restriction_reason', this.restriction_reason, this._readOffset); } }; this.__readBot_inline_placeholder = function __readBot_inline_placeholder() { this.bot_inline_placeholder = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'bot_inline_placeholder', this.bot_inline_placeholder, this._readOffset); } }; }::false botCommand::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c7c87ac2'; this._typeName = "Telegram.type.BotCommand"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeCommand(); this.__writeDescription(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readCommand(); this.__readDescription(); return this; }; this.__writeCommand = function __writeCommand() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'command', this.command); } this.writeString(this.command); }; this.__writeDescription = function __writeDescription() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'description', this.description); } this.writeString(this.description); }; this.__readCommand = function __readCommand() { this.command = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'command', this.command, this._readOffset); } }; this.__readDescription = function __readDescription() { this.description = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'description', this.description, this._readOffset); } }; }::false botInfo::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '3a1de898'; this._typeName = "Telegram.type.BotInfo"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); this.__writeDescription(); var commandsBytes = this.commands.serialize({isBare: false}); this._writeBytes(commandsBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); this.__readDescription(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'BotCommand', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.commands = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writeDescription = function __writeDescription() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'description', this.description); } this.writeString(this.description); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readDescription = function __readDescription() { this.description = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'description', this.description, this._readOffset); } }; }::false keyboardButton::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '8048faa2'; this._typeName = "Telegram.type.KeyboardButton"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeText(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readText(); return this; }; this.__writeText = function __writeText() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'text', this.text); } this.writeString(this.text); }; this.__readText = function __readText() { this.text = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'text', this.text, this._readOffset); } }; }::false keyboardButtonRow::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '838b6077'; this._typeName = "Telegram.type.KeyboardButtonRow"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var buttonsBytes = this.buttons.serialize({isBare: false}); this._writeBytes(buttonsBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'KeyboardButton', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.buttons = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false replyKeyboardHide::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '855b3ea0'; this._typeName = "Telegram.type.ReplyKeyboardHide"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.selective ? (this.flags | 4) : (this.flags & ~4); this.__writeFlags(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 2)) !== 0) { this.__readSelective(); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readSelective = function __readSelective() { this.selective = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'selective', this.selective, this._readOffset); } }; }::false replyKeyboardForceReply::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a08a10f4'; this._typeName = "Telegram.type.ReplyKeyboardForceReply"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.single_use ? (this.flags | 2) : (this.flags & ~2); this.flags = this.selective ? (this.flags | 4) : (this.flags & ~4); this.__writeFlags(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 1)) !== 0) { this.__readSingle_use(); } if ((this.flags & (1 << 2)) !== 0) { this.__readSelective(); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readSingle_use = function __readSingle_use() { this.single_use = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'single_use', this.single_use, this._readOffset); } }; this.__readSelective = function __readSelective() { this.selective = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'selective', this.selective, this._readOffset); } }; }::false replyKeyboardMarkup::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '8c750235'; this._typeName = "Telegram.type.ReplyKeyboardMarkup"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.resize ? (this.flags | 1) : (this.flags & ~1); this.flags = this.single_use ? (this.flags | 2) : (this.flags & ~2); this.flags = this.selective ? (this.flags | 4) : (this.flags & ~4); this.__writeFlags(); var rowsBytes = this.rows.serialize({isBare: false}); this._writeBytes(rowsBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 0)) !== 0) { this.__readResize(); } if ((this.flags & (1 << 1)) !== 0) { this.__readSingle_use(); } if ((this.flags & (1 << 2)) !== 0) { this.__readSelective(); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'KeyboardButtonRow', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.rows = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readResize = function __readResize() { this.resize = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'resize', this.resize, this._readOffset); } }; this.__readSingle_use = function __readSingle_use() { this.single_use = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'single_use', this.single_use, this._readOffset); } }; this.__readSelective = function __readSelective() { this.selective = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'selective', this.selective, this._readOffset); } }; }::false inputPeerUser::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'e67d8e7b'; this._typeName = "Telegram.type.InputPeerUser"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); this.__writeAccess_hash(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); this.__readAccess_hash(); return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writeAccess_hash = function __writeAccess_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'access_hash', this.access_hash); } this.writeLong(this.access_hash); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readAccess_hash = function __readAccess_hash() { this.access_hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'access_hash', this.access_hash, this._readOffset); } }; }::false inputUser::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '162829d8'; this._typeName = "Telegram.type.InputUser"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); this.__writeAccess_hash(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); this.__readAccess_hash(); return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writeAccess_hash = function __writeAccess_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'access_hash', this.access_hash); } this.writeLong(this.access_hash); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readAccess_hash = function __readAccess_hash() { this.access_hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'access_hash', this.access_hash, this._readOffset); } }; }::false help.appChangelogEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '94037eaf'; this._typeName = "Telegram.type.help.AppChangelogEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false help.appChangelog::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'bde66846'; this._typeName = "Telegram.type.help.AppChangelog"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeText(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readText(); return this; }; this.__writeText = function __writeText() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'text', this.text); } this.writeString(this.text); }; this.__readText = function __readText() { this.text = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'text', this.text, this._readOffset); } }; }::false messageEntityUnknown::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '95ba92bb'; this._typeName = "Telegram.type.MessageEntityUnknown"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeOffset(); this.__writeLength(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readOffset(); this.__readLength(); return this; }; this.__writeOffset = function __writeOffset() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'offset', this.offset); } this.writeInt(this.offset); }; this.__writeLength = function __writeLength() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'length', this.length); } this.writeInt(this.length); }; this.__readOffset = function __readOffset() { this.offset = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'offset', this.offset, this._readOffset); } }; this.__readLength = function __readLength() { this.length = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'length', this.length, this._readOffset); } }; }::false messageEntityMention::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '9d5704fa'; this._typeName = "Telegram.type.MessageEntityMention"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeOffset(); this.__writeLength(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readOffset(); this.__readLength(); return this; }; this.__writeOffset = function __writeOffset() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'offset', this.offset); } this.writeInt(this.offset); }; this.__writeLength = function __writeLength() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'length', this.length); } this.writeInt(this.length); }; this.__readOffset = function __readOffset() { this.offset = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'offset', this.offset, this._readOffset); } }; this.__readLength = function __readLength() { this.length = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'length', this.length, this._readOffset); } }; }::false messageEntityHashtag::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '0d5b636f'; this._typeName = "Telegram.type.MessageEntityHashtag"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeOffset(); this.__writeLength(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readOffset(); this.__readLength(); return this; }; this.__writeOffset = function __writeOffset() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'offset', this.offset); } this.writeInt(this.offset); }; this.__writeLength = function __writeLength() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'length', this.length); } this.writeInt(this.length); }; this.__readOffset = function __readOffset() { this.offset = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'offset', this.offset, this._readOffset); } }; this.__readLength = function __readLength() { this.length = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'length', this.length, this._readOffset); } }; }::false messageEntityBotCommand::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c78aef6c'; this._typeName = "Telegram.type.MessageEntityBotCommand"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeOffset(); this.__writeLength(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readOffset(); this.__readLength(); return this; }; this.__writeOffset = function __writeOffset() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'offset', this.offset); } this.writeInt(this.offset); }; this.__writeLength = function __writeLength() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'length', this.length); } this.writeInt(this.length); }; this.__readOffset = function __readOffset() { this.offset = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'offset', this.offset, this._readOffset); } }; this.__readLength = function __readLength() { this.length = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'length', this.length, this._readOffset); } }; }::false messageEntityUrl::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '3825d06e'; this._typeName = "Telegram.type.MessageEntityUrl"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeOffset(); this.__writeLength(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readOffset(); this.__readLength(); return this; }; this.__writeOffset = function __writeOffset() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'offset', this.offset); } this.writeInt(this.offset); }; this.__writeLength = function __writeLength() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'length', this.length); } this.writeInt(this.length); }; this.__readOffset = function __readOffset() { this.offset = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'offset', this.offset, this._readOffset); } }; this.__readLength = function __readLength() { this.length = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'length', this.length, this._readOffset); } }; }::false messageEntityEmail::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c275e464'; this._typeName = "Telegram.type.MessageEntityEmail"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeOffset(); this.__writeLength(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readOffset(); this.__readLength(); return this; }; this.__writeOffset = function __writeOffset() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'offset', this.offset); } this.writeInt(this.offset); }; this.__writeLength = function __writeLength() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'length', this.length); } this.writeInt(this.length); }; this.__readOffset = function __readOffset() { this.offset = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'offset', this.offset, this._readOffset); } }; this.__readLength = function __readLength() { this.length = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'length', this.length, this._readOffset); } }; }::false messageEntityBold::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c90b61bd'; this._typeName = "Telegram.type.MessageEntityBold"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeOffset(); this.__writeLength(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readOffset(); this.__readLength(); return this; }; this.__writeOffset = function __writeOffset() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'offset', this.offset); } this.writeInt(this.offset); }; this.__writeLength = function __writeLength() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'length', this.length); } this.writeInt(this.length); }; this.__readOffset = function __readOffset() { this.offset = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'offset', this.offset, this._readOffset); } }; this.__readLength = function __readLength() { this.length = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'length', this.length, this._readOffset); } }; }::false messageEntityItalic::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '608b6f82'; this._typeName = "Telegram.type.MessageEntityItalic"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeOffset(); this.__writeLength(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readOffset(); this.__readLength(); return this; }; this.__writeOffset = function __writeOffset() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'offset', this.offset); } this.writeInt(this.offset); }; this.__writeLength = function __writeLength() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'length', this.length); } this.writeInt(this.length); }; this.__readOffset = function __readOffset() { this.offset = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'offset', this.offset, this._readOffset); } }; this.__readLength = function __readLength() { this.length = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'length', this.length, this._readOffset); } }; }::false messageEntityCode::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '7105a228'; this._typeName = "Telegram.type.MessageEntityCode"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeOffset(); this.__writeLength(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readOffset(); this.__readLength(); return this; }; this.__writeOffset = function __writeOffset() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'offset', this.offset); } this.writeInt(this.offset); }; this.__writeLength = function __writeLength() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'length', this.length); } this.writeInt(this.length); }; this.__readOffset = function __readOffset() { this.offset = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'offset', this.offset, this._readOffset); } }; this.__readLength = function __readLength() { this.length = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'length', this.length, this._readOffset); } }; }::false messageEntityPre::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'e04b9273'; this._typeName = "Telegram.type.MessageEntityPre"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeOffset(); this.__writeLength(); this.__writeLanguage(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readOffset(); this.__readLength(); this.__readLanguage(); return this; }; this.__writeOffset = function __writeOffset() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'offset', this.offset); } this.writeInt(this.offset); }; this.__writeLength = function __writeLength() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'length', this.length); } this.writeInt(this.length); }; this.__writeLanguage = function __writeLanguage() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'language', this.language); } this.writeString(this.language); }; this.__readOffset = function __readOffset() { this.offset = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'offset', this.offset, this._readOffset); } }; this.__readLength = function __readLength() { this.length = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'length', this.length, this._readOffset); } }; this.__readLanguage = function __readLanguage() { this.language = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'language', this.language, this._readOffset); } }; }::false messageEntityTextUrl::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '27d3a676'; this._typeName = "Telegram.type.MessageEntityTextUrl"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeOffset(); this.__writeLength(); this.__writeUrl(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readOffset(); this.__readLength(); this.__readUrl(); return this; }; this.__writeOffset = function __writeOffset() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'offset', this.offset); } this.writeInt(this.offset); }; this.__writeLength = function __writeLength() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'length', this.length); } this.writeInt(this.length); }; this.__writeUrl = function __writeUrl() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'url', this.url); } this.writeString(this.url); }; this.__readOffset = function __readOffset() { this.offset = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'offset', this.offset, this._readOffset); } }; this.__readLength = function __readLength() { this.length = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'length', this.length, this._readOffset); } }; this.__readUrl = function __readUrl() { this.url = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'url', this.url, this._readOffset); } }; }::false updateShortSentMessage::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '1c33f111'; this._typeName = "Telegram.type.UpdateShortSentMessage"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.out ? (this.flags | 2) : (this.flags & ~2); this.flags = this.media !== null ? (this.flags | 512) : (this.flags & ~512); this.flags = this.entities !== null ? (this.flags | 128) : (this.flags & ~128); this.__writeFlags(); this.__writeId(); this.__writePts(); this.__writePts_count(); this.__writeDate(); if (this.media) { var mediaBytes = this.media.serialize({isBare: false}); this._writeBytes(mediaBytes); } if (this.entities) { var entitiesBytes = this.entities.serialize({isBare: false}); this._writeBytes(entitiesBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 1)) !== 0) { this.__readOut(); } this.__readId(); this.__readPts(); this.__readPts_count(); this.__readDate(); if ((this.flags & (1 << 9)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', MessageMedia, bytes.toString('hex'), 'MessageMedia'); } var MessageMedia = this.constructor.requireTypeFromBuffer(bytes); if (MessageMedia) { var obj = new MessageMedia({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.media = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type MessageMedia and buffer:' + this._buffer.toString('hex')); } } if ((this.flags & (1 << 7)) !== 0) { var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'MessageEntity', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.entities = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__writePts = function __writePts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts', this.pts); } this.writeInt(this.pts); }; this.__writePts_count = function __writePts_count() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts_count', this.pts_count); } this.writeInt(this.pts_count); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readOut = function __readOut() { this.out = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'out', this.out, this._readOffset); } }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readPts = function __readPts() { this.pts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts', this.pts, this._readOffset); } }; this.__readPts_count = function __readPts_count() { this.pts_count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts_count', this.pts_count, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; }::false inputChannelEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '861e8cee'; this._typeName = "Telegram.type.InputChannelEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputChannel::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '2e71ebaf'; this._typeName = "Telegram.type.InputChannel"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeChannel_id(); this.__writeAccess_hash(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readChannel_id(); this.__readAccess_hash(); return this; }; this.__writeChannel_id = function __writeChannel_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'channel_id', this.channel_id); } this.writeInt(this.channel_id); }; this.__writeAccess_hash = function __writeAccess_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'access_hash', this.access_hash); } this.writeLong(this.access_hash); }; this.__readChannel_id = function __readChannel_id() { this.channel_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'channel_id', this.channel_id, this._readOffset); } }; this.__readAccess_hash = function __readAccess_hash() { this.access_hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'access_hash', this.access_hash, this._readOffset); } }; }::false peerChannel::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '32e5ddbd'; this._typeName = "Telegram.type.PeerChannel"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeChannel_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readChannel_id(); return this; }; this.__writeChannel_id = function __writeChannel_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'channel_id', this.channel_id); } this.writeInt(this.channel_id); }; this.__readChannel_id = function __readChannel_id() { this.channel_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'channel_id', this.channel_id, this._readOffset); } }; }::false inputPeerChannel::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'f8aead20'; this._typeName = "Telegram.type.InputPeerChannel"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeChannel_id(); this.__writeAccess_hash(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readChannel_id(); this.__readAccess_hash(); return this; }; this.__writeChannel_id = function __writeChannel_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'channel_id', this.channel_id); } this.writeInt(this.channel_id); }; this.__writeAccess_hash = function __writeAccess_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'access_hash', this.access_hash); } this.writeLong(this.access_hash); }; this.__readChannel_id = function __readChannel_id() { this.channel_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'channel_id', this.channel_id, this._readOffset); } }; this.__readAccess_hash = function __readAccess_hash() { this.access_hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'access_hash', this.access_hash, this._readOffset); } }; }::false channel::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '52ca4da1'; this._typeName = "Telegram.type.Channel"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.creator ? (this.flags | 1) : (this.flags & ~1); this.flags = this.kicked ? (this.flags | 2) : (this.flags & ~2); this.flags = this.left ? (this.flags | 4) : (this.flags & ~4); this.flags = this.editor ? (this.flags | 8) : (this.flags & ~8); this.flags = this.moderator ? (this.flags | 16) : (this.flags & ~16); this.flags = this.broadcast ? (this.flags | 32) : (this.flags & ~32); this.flags = this.verified ? (this.flags | 128) : (this.flags & ~128); this.flags = this.megagroup ? (this.flags | 256) : (this.flags & ~256); this.flags = this.restricted ? (this.flags | 512) : (this.flags & ~512); this.flags = this.democracy ? (this.flags | 1024) : (this.flags & ~1024); this.flags = this.signatures ? (this.flags | 2048) : (this.flags & ~2048); this.flags = this.min ? (this.flags | 4096) : (this.flags & ~4096); this.flags = this.access_hash !== null ? (this.flags | 8192) : (this.flags & ~8192); this.flags = this.username !== null ? (this.flags | 64) : (this.flags & ~64); this.flags = this.restriction_reason !== null ? (this.flags | 512) : (this.flags & ~512); this.__writeFlags(); this.__writeId(); if (this.access_hash) { this.__writeAccess_hash(); } this.__writeTitle(); if (this.username) { this.__writeUsername(); } var photoBytes = this.photo.serialize({isBare: false}); this._writeBytes(photoBytes); this.__writeDate(); this.__writeVersion(); if (this.restriction_reason) { this.__writeRestriction_reason(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 0)) !== 0) { this.__readCreator(); } if ((this.flags & (1 << 1)) !== 0) { this.__readKicked(); } if ((this.flags & (1 << 2)) !== 0) { this.__readLeft(); } if ((this.flags & (1 << 3)) !== 0) { this.__readEditor(); } if ((this.flags & (1 << 4)) !== 0) { this.__readModerator(); } if ((this.flags & (1 << 5)) !== 0) { this.__readBroadcast(); } if ((this.flags & (1 << 7)) !== 0) { this.__readVerified(); } if ((this.flags & (1 << 8)) !== 0) { this.__readMegagroup(); } if ((this.flags & (1 << 9)) !== 0) { this.__readRestricted(); } if ((this.flags & (1 << 10)) !== 0) { this.__readDemocracy(); } if ((this.flags & (1 << 11)) !== 0) { this.__readSignatures(); } if ((this.flags & (1 << 12)) !== 0) { this.__readMin(); } this.__readId(); if ((this.flags & (1 << 13)) !== 0) { this.__readAccess_hash(); } this.__readTitle(); if ((this.flags & (1 << 6)) !== 0) { this.__readUsername(); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ChatPhoto, bytes.toString('hex'), 'ChatPhoto'); } var ChatPhoto = this.constructor.requireTypeFromBuffer(bytes); if (ChatPhoto) { var obj = new ChatPhoto({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.photo = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ChatPhoto and buffer:' + this._buffer.toString('hex')); } this.__readDate(); this.__readVersion(); if ((this.flags & (1 << 9)) !== 0) { this.__readRestriction_reason(); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__writeAccess_hash = function __writeAccess_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'access_hash', this.access_hash); } this.writeLong(this.access_hash); }; this.__writeTitle = function __writeTitle() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'title', this.title); } this.writeString(this.title); }; this.__writeUsername = function __writeUsername() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'username', this.username); } this.writeString(this.username); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__writeVersion = function __writeVersion() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'version', this.version); } this.writeInt(this.version); }; this.__writeRestriction_reason = function __writeRestriction_reason() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'restriction_reason', this.restriction_reason); } this.writeString(this.restriction_reason); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readCreator = function __readCreator() { this.creator = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'creator', this.creator, this._readOffset); } }; this.__readKicked = function __readKicked() { this.kicked = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'kicked', this.kicked, this._readOffset); } }; this.__readLeft = function __readLeft() { this.left = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'left', this.left, this._readOffset); } }; this.__readEditor = function __readEditor() { this.editor = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'editor', this.editor, this._readOffset); } }; this.__readModerator = function __readModerator() { this.moderator = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'moderator', this.moderator, this._readOffset); } }; this.__readBroadcast = function __readBroadcast() { this.broadcast = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'broadcast', this.broadcast, this._readOffset); } }; this.__readVerified = function __readVerified() { this.verified = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'verified', this.verified, this._readOffset); } }; this.__readMegagroup = function __readMegagroup() { this.megagroup = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'megagroup', this.megagroup, this._readOffset); } }; this.__readRestricted = function __readRestricted() { this.restricted = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'restricted', this.restricted, this._readOffset); } }; this.__readDemocracy = function __readDemocracy() { this.democracy = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'democracy', this.democracy, this._readOffset); } }; this.__readSignatures = function __readSignatures() { this.signatures = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'signatures', this.signatures, this._readOffset); } }; this.__readMin = function __readMin() { this.min = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'min', this.min, this._readOffset); } }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readAccess_hash = function __readAccess_hash() { this.access_hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'access_hash', this.access_hash, this._readOffset); } }; this.__readTitle = function __readTitle() { this.title = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'title', this.title, this._readOffset); } }; this.__readUsername = function __readUsername() { this.username = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'username', this.username, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; this.__readVersion = function __readVersion() { this.version = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'version', this.version, this._readOffset); } }; this.__readRestriction_reason = function __readRestriction_reason() { this.restriction_reason = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'restriction_reason', this.restriction_reason, this._readOffset); } }; }::false channelForbidden::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '4f783785'; this._typeName = "Telegram.type.ChannelForbidden"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.broadcast ? (this.flags | 32) : (this.flags & ~32); this.flags = this.megagroup ? (this.flags | 256) : (this.flags & ~256); this.__writeFlags(); this.__writeId(); this.__writeAccess_hash(); this.__writeTitle(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 5)) !== 0) { this.__readBroadcast(); } if ((this.flags & (1 << 8)) !== 0) { this.__readMegagroup(); } this.__readId(); this.__readAccess_hash(); this.__readTitle(); return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__writeAccess_hash = function __writeAccess_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'access_hash', this.access_hash); } this.writeLong(this.access_hash); }; this.__writeTitle = function __writeTitle() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'title', this.title); } this.writeString(this.title); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readBroadcast = function __readBroadcast() { this.broadcast = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'broadcast', this.broadcast, this._readOffset); } }; this.__readMegagroup = function __readMegagroup() { this.megagroup = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'megagroup', this.megagroup, this._readOffset); } }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readAccess_hash = function __readAccess_hash() { this.access_hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'access_hash', this.access_hash, this._readOffset); } }; this.__readTitle = function __readTitle() { this.title = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'title', this.title, this._readOffset); } }; }::false contacts.resolvedPeer::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'd97a077f'; this._typeName = "Telegram.type.contacts.ResolvedPeer"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var peerBytes = this.peer.serialize({isBare: false}); this._writeBytes(peerBytes); var chatsBytes = this.chats.serialize({isBare: false}); this._writeBytes(chatsBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Peer, bytes.toString('hex'), 'Peer'); } var Peer = this.constructor.requireTypeFromBuffer(bytes); if (Peer) { var obj = new Peer({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.peer = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Peer and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Chat', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.chats = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false channelFull::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '2f51d5c3'; this._typeName = "Telegram.type.ChannelFull"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.can_view_participants ? (this.flags | 8) : (this.flags & ~8); this.flags = this.can_set_username ? (this.flags | 64) : (this.flags & ~64); this.flags = this.participants_count !== null ? (this.flags | 1) : (this.flags & ~1); this.flags = this.admins_count !== null ? (this.flags | 2) : (this.flags & ~2); this.flags = this.kicked_count !== null ? (this.flags | 4) : (this.flags & ~4); this.flags = this.migrated_from_chat_id !== null ? (this.flags | 16) : (this.flags & ~16); this.flags = this.migrated_from_max_id !== null ? (this.flags | 16) : (this.flags & ~16); this.flags = this.pinned_msg_id !== null ? (this.flags | 32) : (this.flags & ~32); this.__writeFlags(); this.__writeId(); this.__writeAbout(); if (this.participants_count) { this.__writeParticipants_count(); } if (this.admins_count) { this.__writeAdmins_count(); } if (this.kicked_count) { this.__writeKicked_count(); } this.__writeRead_inbox_max_id(); this.__writeRead_outbox_max_id(); this.__writeUnread_count(); var chat_photoBytes = this.chat_photo.serialize({isBare: false}); this._writeBytes(chat_photoBytes); var notify_settingsBytes = this.notify_settings.serialize({isBare: false}); this._writeBytes(notify_settingsBytes); var exported_inviteBytes = this.exported_invite.serialize({isBare: false}); this._writeBytes(exported_inviteBytes); var bot_infoBytes = this.bot_info.serialize({isBare: false}); this._writeBytes(bot_infoBytes); if (this.migrated_from_chat_id) { this.__writeMigrated_from_chat_id(); } if (this.migrated_from_max_id) { this.__writeMigrated_from_max_id(); } if (this.pinned_msg_id) { this.__writePinned_msg_id(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 3)) !== 0) { this.__readCan_view_participants(); } if ((this.flags & (1 << 6)) !== 0) { this.__readCan_set_username(); } this.__readId(); this.__readAbout(); if ((this.flags & (1 << 0)) !== 0) { this.__readParticipants_count(); } if ((this.flags & (1 << 1)) !== 0) { this.__readAdmins_count(); } if ((this.flags & (1 << 2)) !== 0) { this.__readKicked_count(); } this.__readRead_inbox_max_id(); this.__readRead_outbox_max_id(); this.__readUnread_count(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Photo, bytes.toString('hex'), 'Photo'); } var Photo = this.constructor.requireTypeFromBuffer(bytes); if (Photo) { var obj = new Photo({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.chat_photo = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Photo and buffer:' + this._buffer.toString('hex')); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', PeerNotifySettings, bytes.toString('hex'), 'PeerNotifySettings'); } var PeerNotifySettings = this.constructor.requireTypeFromBuffer(bytes); if (PeerNotifySettings) { var obj = new PeerNotifySettings({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.notify_settings = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type PeerNotifySettings and buffer:' + this._buffer.toString('hex')); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ExportedChatInvite, bytes.toString('hex'), 'ExportedChatInvite'); } var ExportedChatInvite = this.constructor.requireTypeFromBuffer(bytes); if (ExportedChatInvite) { var obj = new ExportedChatInvite({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.exported_invite = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ExportedChatInvite and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'BotInfo', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.bot_info = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } if ((this.flags & (1 << 4)) !== 0) { this.__readMigrated_from_chat_id(); } if ((this.flags & (1 << 4)) !== 0) { this.__readMigrated_from_max_id(); } if ((this.flags & (1 << 5)) !== 0) { this.__readPinned_msg_id(); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__writeAbout = function __writeAbout() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'about', this.about); } this.writeString(this.about); }; this.__writeParticipants_count = function __writeParticipants_count() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'participants_count', this.participants_count); } this.writeInt(this.participants_count); }; this.__writeAdmins_count = function __writeAdmins_count() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'admins_count', this.admins_count); } this.writeInt(this.admins_count); }; this.__writeKicked_count = function __writeKicked_count() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'kicked_count', this.kicked_count); } this.writeInt(this.kicked_count); }; this.__writeRead_inbox_max_id = function __writeRead_inbox_max_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'read_inbox_max_id', this.read_inbox_max_id); } this.writeInt(this.read_inbox_max_id); }; this.__writeRead_outbox_max_id = function __writeRead_outbox_max_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'read_outbox_max_id', this.read_outbox_max_id); } this.writeInt(this.read_outbox_max_id); }; this.__writeUnread_count = function __writeUnread_count() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'unread_count', this.unread_count); } this.writeInt(this.unread_count); }; this.__writeMigrated_from_chat_id = function __writeMigrated_from_chat_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'migrated_from_chat_id', this.migrated_from_chat_id); } this.writeInt(this.migrated_from_chat_id); }; this.__writeMigrated_from_max_id = function __writeMigrated_from_max_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'migrated_from_max_id', this.migrated_from_max_id); } this.writeInt(this.migrated_from_max_id); }; this.__writePinned_msg_id = function __writePinned_msg_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pinned_msg_id', this.pinned_msg_id); } this.writeInt(this.pinned_msg_id); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readCan_view_participants = function __readCan_view_participants() { this.can_view_participants = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'can_view_participants', this.can_view_participants, this._readOffset); } }; this.__readCan_set_username = function __readCan_set_username() { this.can_set_username = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'can_set_username', this.can_set_username, this._readOffset); } }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readAbout = function __readAbout() { this.about = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'about', this.about, this._readOffset); } }; this.__readParticipants_count = function __readParticipants_count() { this.participants_count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'participants_count', this.participants_count, this._readOffset); } }; this.__readAdmins_count = function __readAdmins_count() { this.admins_count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'admins_count', this.admins_count, this._readOffset); } }; this.__readKicked_count = function __readKicked_count() { this.kicked_count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'kicked_count', this.kicked_count, this._readOffset); } }; this.__readRead_inbox_max_id = function __readRead_inbox_max_id() { this.read_inbox_max_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'read_inbox_max_id', this.read_inbox_max_id, this._readOffset); } }; this.__readRead_outbox_max_id = function __readRead_outbox_max_id() { this.read_outbox_max_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'read_outbox_max_id', this.read_outbox_max_id, this._readOffset); } }; this.__readUnread_count = function __readUnread_count() { this.unread_count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'unread_count', this.unread_count, this._readOffset); } }; this.__readMigrated_from_chat_id = function __readMigrated_from_chat_id() { this.migrated_from_chat_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'migrated_from_chat_id', this.migrated_from_chat_id, this._readOffset); } }; this.__readMigrated_from_max_id = function __readMigrated_from_max_id() { this.migrated_from_max_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'migrated_from_max_id', this.migrated_from_max_id, this._readOffset); } }; this.__readPinned_msg_id = function __readPinned_msg_id() { this.pinned_msg_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pinned_msg_id', this.pinned_msg_id, this._readOffset); } }; }::false messageRange::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '5302e30a'; this._typeName = "Telegram.type.MessageRange"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeMin_id(); this.__writeMax_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readMin_id(); this.__readMax_id(); return this; }; this.__writeMin_id = function __writeMin_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'min_id', this.min_id); } this.writeInt(this.min_id); }; this.__writeMax_id = function __writeMax_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'max_id', this.max_id); } this.writeInt(this.max_id); }; this.__readMin_id = function __readMin_id() { this.min_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'min_id', this.min_id, this._readOffset); } }; this.__readMax_id = function __readMax_id() { this.max_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'max_id', this.max_id, this._readOffset); } }; }::false messages.channelMessages::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '372e2699'; this._typeName = "Telegram.type.messages.ChannelMessages"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.__writeFlags(); this.__writePts(); this.__writeCount(); var messagesBytes = this.messages.serialize({isBare: false}); this._writeBytes(messagesBytes); var chatsBytes = this.chats.serialize({isBare: false}); this._writeBytes(chatsBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); this.__readPts(); this.__readCount(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Message', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.messages = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Chat', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.chats = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writePts = function __writePts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts', this.pts); } this.writeInt(this.pts); }; this.__writeCount = function __writeCount() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'count', this.count); } this.writeInt(this.count); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readPts = function __readPts() { this.pts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts', this.pts, this._readOffset); } }; this.__readCount = function __readCount() { this.count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'count', this.count, this._readOffset); } }; }::false messageActionChannelCreate::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '92acd295'; this._typeName = "Telegram.type.MessageActionChannelCreate"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeTitle(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readTitle(); return this; }; this.__writeTitle = function __writeTitle() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'title', this.title); } this.writeString(this.title); }; this.__readTitle = function __readTitle() { this.title = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'title', this.title, this._readOffset); } }; }::false updateChannelTooLong::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'fb6704eb'; this._typeName = "Telegram.type.UpdateChannelTooLong"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.pts !== null ? (this.flags | 1) : (this.flags & ~1); this.__writeFlags(); this.__writeChannel_id(); if (this.pts) { this.__writePts(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); this.__readChannel_id(); if ((this.flags & (1 << 0)) !== 0) { this.__readPts(); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeChannel_id = function __writeChannel_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'channel_id', this.channel_id); } this.writeInt(this.channel_id); }; this.__writePts = function __writePts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts', this.pts); } this.writeInt(this.pts); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readChannel_id = function __readChannel_id() { this.channel_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'channel_id', this.channel_id, this._readOffset); } }; this.__readPts = function __readPts() { this.pts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts', this.pts, this._readOffset); } }; }::false updateChannel::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '5656d4b6'; this._typeName = "Telegram.type.UpdateChannel"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeChannel_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readChannel_id(); return this; }; this.__writeChannel_id = function __writeChannel_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'channel_id', this.channel_id); } this.writeInt(this.channel_id); }; this.__readChannel_id = function __readChannel_id() { this.channel_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'channel_id', this.channel_id, this._readOffset); } }; }::false updateNewChannelMessage::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'd904ba62'; this._typeName = "Telegram.type.UpdateNewChannelMessage"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var messageBytes = this.message.serialize({isBare: false}); this._writeBytes(messageBytes); this.__writePts(); this.__writePts_count(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Message, bytes.toString('hex'), 'Message'); } var Message = this.constructor.requireTypeFromBuffer(bytes); if (Message) { var obj = new Message({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.message = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Message and buffer:' + this._buffer.toString('hex')); } this.__readPts(); this.__readPts_count(); return this; }; this.__writePts = function __writePts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts', this.pts); } this.writeInt(this.pts); }; this.__writePts_count = function __writePts_count() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts_count', this.pts_count); } this.writeInt(this.pts_count); }; this.__readPts = function __readPts() { this.pts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts', this.pts, this._readOffset); } }; this.__readPts_count = function __readPts_count() { this.pts_count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts_count', this.pts_count, this._readOffset); } }; }::false updateReadChannelInbox::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '7ff31442'; this._typeName = "Telegram.type.UpdateReadChannelInbox"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeChannel_id(); this.__writeMax_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readChannel_id(); this.__readMax_id(); return this; }; this.__writeChannel_id = function __writeChannel_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'channel_id', this.channel_id); } this.writeInt(this.channel_id); }; this.__writeMax_id = function __writeMax_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'max_id', this.max_id); } this.writeInt(this.max_id); }; this.__readChannel_id = function __readChannel_id() { this.channel_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'channel_id', this.channel_id, this._readOffset); } }; this.__readMax_id = function __readMax_id() { this.max_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'max_id', this.max_id, this._readOffset); } }; }::false updateDeleteChannelMessages::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c92175c3'; this._typeName = "Telegram.type.UpdateDeleteChannelMessages"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeChannel_id(); var messagesBytes = this.messages.serialize({isBare: false}); this._writeBytes(messagesBytes); this.__writePts(); this.__writePts_count(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readChannel_id(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'int', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.messages = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } this.__readPts(); this.__readPts_count(); return this; }; this.__writeChannel_id = function __writeChannel_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'channel_id', this.channel_id); } this.writeInt(this.channel_id); }; this.__writePts = function __writePts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts', this.pts); } this.writeInt(this.pts); }; this.__writePts_count = function __writePts_count() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts_count', this.pts_count); } this.writeInt(this.pts_count); }; this.__readChannel_id = function __readChannel_id() { this.channel_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'channel_id', this.channel_id, this._readOffset); } }; this.__readPts = function __readPts() { this.pts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts', this.pts, this._readOffset); } }; this.__readPts_count = function __readPts_count() { this.pts_count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts_count', this.pts_count, this._readOffset); } }; }::false updateChannelMessageViews::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '4b2ba198'; this._typeName = "Telegram.type.UpdateChannelMessageViews"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeChannel_id(); this.__writeId(); this.__writeViews(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readChannel_id(); this.__readId(); this.__readViews(); return this; }; this.__writeChannel_id = function __writeChannel_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'channel_id', this.channel_id); } this.writeInt(this.channel_id); }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__writeViews = function __writeViews() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'views', this.views); } this.writeInt(this.views); }; this.__readChannel_id = function __readChannel_id() { this.channel_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'channel_id', this.channel_id, this._readOffset); } }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readViews = function __readViews() { this.views = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'views', this.views, this._readOffset); } }; }::false updates.channelDifferenceEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'fbaf113e'; this._typeName = "Telegram.type.updates.ChannelDifferenceEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.final ? (this.flags | 1) : (this.flags & ~1); this.flags = this.timeout !== null ? (this.flags | 2) : (this.flags & ~2); this.__writeFlags(); this.__writePts(); if (this.timeout) { this.__writeTimeout(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 0)) !== 0) { this.__readFinal(); } this.__readPts(); if ((this.flags & (1 << 1)) !== 0) { this.__readTimeout(); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writePts = function __writePts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts', this.pts); } this.writeInt(this.pts); }; this.__writeTimeout = function __writeTimeout() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'timeout', this.timeout); } this.writeInt(this.timeout); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readFinal = function __readFinal() { this.final = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'final', this.final, this._readOffset); } }; this.__readPts = function __readPts() { this.pts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts', this.pts, this._readOffset); } }; this.__readTimeout = function __readTimeout() { this.timeout = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'timeout', this.timeout, this._readOffset); } }; }::false updates.channelDifferenceTooLong::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '07ee0d41'; this._typeName = "Telegram.type.updates.ChannelDifferenceTooLong"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.final ? (this.flags | 1) : (this.flags & ~1); this.flags = this.timeout !== null ? (this.flags | 2) : (this.flags & ~2); this.__writeFlags(); this.__writePts(); if (this.timeout) { this.__writeTimeout(); } this.__writeTop_message(); this.__writeRead_inbox_max_id(); this.__writeRead_outbox_max_id(); this.__writeUnread_count(); var messagesBytes = this.messages.serialize({isBare: false}); this._writeBytes(messagesBytes); var chatsBytes = this.chats.serialize({isBare: false}); this._writeBytes(chatsBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 0)) !== 0) { this.__readFinal(); } this.__readPts(); if ((this.flags & (1 << 1)) !== 0) { this.__readTimeout(); } this.__readTop_message(); this.__readRead_inbox_max_id(); this.__readRead_outbox_max_id(); this.__readUnread_count(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Message', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.messages = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Chat', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.chats = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writePts = function __writePts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts', this.pts); } this.writeInt(this.pts); }; this.__writeTimeout = function __writeTimeout() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'timeout', this.timeout); } this.writeInt(this.timeout); }; this.__writeTop_message = function __writeTop_message() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'top_message', this.top_message); } this.writeInt(this.top_message); }; this.__writeRead_inbox_max_id = function __writeRead_inbox_max_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'read_inbox_max_id', this.read_inbox_max_id); } this.writeInt(this.read_inbox_max_id); }; this.__writeRead_outbox_max_id = function __writeRead_outbox_max_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'read_outbox_max_id', this.read_outbox_max_id); } this.writeInt(this.read_outbox_max_id); }; this.__writeUnread_count = function __writeUnread_count() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'unread_count', this.unread_count); } this.writeInt(this.unread_count); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readFinal = function __readFinal() { this.final = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'final', this.final, this._readOffset); } }; this.__readPts = function __readPts() { this.pts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts', this.pts, this._readOffset); } }; this.__readTimeout = function __readTimeout() { this.timeout = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'timeout', this.timeout, this._readOffset); } }; this.__readTop_message = function __readTop_message() { this.top_message = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'top_message', this.top_message, this._readOffset); } }; this.__readRead_inbox_max_id = function __readRead_inbox_max_id() { this.read_inbox_max_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'read_inbox_max_id', this.read_inbox_max_id, this._readOffset); } }; this.__readRead_outbox_max_id = function __readRead_outbox_max_id() { this.read_outbox_max_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'read_outbox_max_id', this.read_outbox_max_id, this._readOffset); } }; this.__readUnread_count = function __readUnread_count() { this.unread_count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'unread_count', this.unread_count, this._readOffset); } }; }::false updates.channelDifference::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '4e676420'; this._typeName = "Telegram.type.updates.ChannelDifference"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.final ? (this.flags | 1) : (this.flags & ~1); this.flags = this.timeout !== null ? (this.flags | 2) : (this.flags & ~2); this.__writeFlags(); this.__writePts(); if (this.timeout) { this.__writeTimeout(); } var new_messagesBytes = this.new_messages.serialize({isBare: false}); this._writeBytes(new_messagesBytes); var other_updatesBytes = this.other_updates.serialize({isBare: false}); this._writeBytes(other_updatesBytes); var chatsBytes = this.chats.serialize({isBare: false}); this._writeBytes(chatsBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 0)) !== 0) { this.__readFinal(); } this.__readPts(); if ((this.flags & (1 << 1)) !== 0) { this.__readTimeout(); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Message', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.new_messages = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Update', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.other_updates = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Chat', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.chats = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writePts = function __writePts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts', this.pts); } this.writeInt(this.pts); }; this.__writeTimeout = function __writeTimeout() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'timeout', this.timeout); } this.writeInt(this.timeout); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readFinal = function __readFinal() { this.final = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'final', this.final, this._readOffset); } }; this.__readPts = function __readPts() { this.pts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts', this.pts, this._readOffset); } }; this.__readTimeout = function __readTimeout() { this.timeout = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'timeout', this.timeout, this._readOffset); } }; }::false channelMessagesFilterEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'e72ed494'; this._typeName = "Telegram.type.ChannelMessagesFilterEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false channelMessagesFilter::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '57d977cd'; this._typeName = "Telegram.type.ChannelMessagesFilter"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.exclude_new_messages ? (this.flags | 2) : (this.flags & ~2); this.__writeFlags(); var rangesBytes = this.ranges.serialize({isBare: false}); this._writeBytes(rangesBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 1)) !== 0) { this.__readExclude_new_messages(); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'MessageRange', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.ranges = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readExclude_new_messages = function __readExclude_new_messages() { this.exclude_new_messages = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'exclude_new_messages', this.exclude_new_messages, this._readOffset); } }; }::false channelParticipant::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '1daceb15'; this._typeName = "Telegram.type.ChannelParticipant"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); this.__writeDate(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); this.__readDate(); return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; }::false channelParticipantSelf::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '6d9a28a3'; this._typeName = "Telegram.type.ChannelParticipantSelf"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); this.__writeInviter_id(); this.__writeDate(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); this.__readInviter_id(); this.__readDate(); return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writeInviter_id = function __writeInviter_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'inviter_id', this.inviter_id); } this.writeInt(this.inviter_id); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readInviter_id = function __readInviter_id() { this.inviter_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'inviter_id', this.inviter_id, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; }::false channelParticipantModerator::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'ef7f0591'; this._typeName = "Telegram.type.ChannelParticipantModerator"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); this.__writeInviter_id(); this.__writeDate(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); this.__readInviter_id(); this.__readDate(); return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writeInviter_id = function __writeInviter_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'inviter_id', this.inviter_id); } this.writeInt(this.inviter_id); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readInviter_id = function __readInviter_id() { this.inviter_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'inviter_id', this.inviter_id, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; }::false channelParticipantEditor::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '612d1998'; this._typeName = "Telegram.type.ChannelParticipantEditor"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); this.__writeInviter_id(); this.__writeDate(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); this.__readInviter_id(); this.__readDate(); return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writeInviter_id = function __writeInviter_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'inviter_id', this.inviter_id); } this.writeInt(this.inviter_id); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readInviter_id = function __readInviter_id() { this.inviter_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'inviter_id', this.inviter_id, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; }::false channelParticipantKicked::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '9ae6c58c'; this._typeName = "Telegram.type.ChannelParticipantKicked"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); this.__writeKicked_by(); this.__writeDate(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); this.__readKicked_by(); this.__readDate(); return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writeKicked_by = function __writeKicked_by() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'kicked_by', this.kicked_by); } this.writeInt(this.kicked_by); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readKicked_by = function __readKicked_by() { this.kicked_by = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'kicked_by', this.kicked_by, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; }::false channelParticipantCreator::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'f9e1e2e3'; this._typeName = "Telegram.type.ChannelParticipantCreator"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; }::false channelParticipantsRecent::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '793c3fde'; this._typeName = "Telegram.type.ChannelParticipantsRecent"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false channelParticipantsAdmins::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '698960b4'; this._typeName = "Telegram.type.ChannelParticipantsAdmins"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false channelParticipantsKicked::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '7abb373c'; this._typeName = "Telegram.type.ChannelParticipantsKicked"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false channelRoleEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c6a085b2'; this._typeName = "Telegram.type.ChannelRoleEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false channelRoleModerator::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '75d91896'; this._typeName = "Telegram.type.ChannelRoleModerator"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false channelRoleEditor::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '8cfe0b82'; this._typeName = "Telegram.type.ChannelRoleEditor"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false channels.channelParticipants::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a8e26ef5'; this._typeName = "Telegram.type.channels.ChannelParticipants"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeCount(); var participantsBytes = this.participants.serialize({isBare: false}); this._writeBytes(participantsBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readCount(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'ChannelParticipant', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.participants = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeCount = function __writeCount() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'count', this.count); } this.writeInt(this.count); }; this.__readCount = function __readCount() { this.count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'count', this.count, this._readOffset); } }; }::false channels.channelParticipant::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '63b1d9d0'; this._typeName = "Telegram.type.channels.ChannelParticipant"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var participantBytes = this.participant.serialize({isBare: false}); this._writeBytes(participantBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ChannelParticipant, bytes.toString('hex'), 'ChannelParticipant'); } var ChannelParticipant = this.constructor.requireTypeFromBuffer(bytes); if (ChannelParticipant) { var obj = new ChannelParticipant({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.participant = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ChannelParticipant and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false chatParticipantCreator::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '8a5313da'; this._typeName = "Telegram.type.ChatParticipantCreator"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; }::false chatParticipantAdmin::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '36e4d6e2'; this._typeName = "Telegram.type.ChatParticipantAdmin"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUser_id(); this.__writeInviter_id(); this.__writeDate(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUser_id(); this.__readInviter_id(); this.__readDate(); return this; }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writeInviter_id = function __writeInviter_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'inviter_id', this.inviter_id); } this.writeInt(this.inviter_id); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readInviter_id = function __readInviter_id() { this.inviter_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'inviter_id', this.inviter_id, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; }::false updateChatAdmins::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '4179946e'; this._typeName = "Telegram.type.UpdateChatAdmins"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeChat_id(); var enabledBytes = this.enabled.serialize({isBare: false}); this._writeBytes(enabledBytes); this.__writeVersion(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readChat_id(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Bool, bytes.toString('hex'), 'Bool'); } var Bool = this.constructor.requireTypeFromBuffer(bytes); if (Bool) { var obj = new Bool({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.enabled = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Bool and buffer:' + this._buffer.toString('hex')); } this.__readVersion(); return this; }; this.__writeChat_id = function __writeChat_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'chat_id', this.chat_id); } this.writeInt(this.chat_id); }; this.__writeVersion = function __writeVersion() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'version', this.version); } this.writeInt(this.version); }; this.__readChat_id = function __readChat_id() { this.chat_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'chat_id', this.chat_id, this._readOffset); } }; this.__readVersion = function __readVersion() { this.version = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'version', this.version, this._readOffset); } }; }::false updateChatParticipantAdmin::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '591990b6'; this._typeName = "Telegram.type.UpdateChatParticipantAdmin"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeChat_id(); this.__writeUser_id(); var is_adminBytes = this.is_admin.serialize({isBare: false}); this._writeBytes(is_adminBytes); this.__writeVersion(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readChat_id(); this.__readUser_id(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Bool, bytes.toString('hex'), 'Bool'); } var Bool = this.constructor.requireTypeFromBuffer(bytes); if (Bool) { var obj = new Bool({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.is_admin = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Bool and buffer:' + this._buffer.toString('hex')); } this.__readVersion(); return this; }; this.__writeChat_id = function __writeChat_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'chat_id', this.chat_id); } this.writeInt(this.chat_id); }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writeVersion = function __writeVersion() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'version', this.version); } this.writeInt(this.version); }; this.__readChat_id = function __readChat_id() { this.chat_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'chat_id', this.chat_id, this._readOffset); } }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readVersion = function __readVersion() { this.version = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'version', this.version, this._readOffset); } }; }::false messageActionChatMigrateTo::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '21b0bd51'; this._typeName = "Telegram.type.MessageActionChatMigrateTo"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeChannel_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readChannel_id(); return this; }; this.__writeChannel_id = function __writeChannel_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'channel_id', this.channel_id); } this.writeInt(this.channel_id); }; this.__readChannel_id = function __readChannel_id() { this.channel_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'channel_id', this.channel_id, this._readOffset); } }; }::false messageActionChannelMigrateFrom::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'eeea55b0'; this._typeName = "Telegram.type.MessageActionChannelMigrateFrom"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeTitle(); this.__writeChat_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readTitle(); this.__readChat_id(); return this; }; this.__writeTitle = function __writeTitle() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'title', this.title); } this.writeString(this.title); }; this.__writeChat_id = function __writeChat_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'chat_id', this.chat_id); } this.writeInt(this.chat_id); }; this.__readTitle = function __readTitle() { this.title = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'title', this.title, this._readOffset); } }; this.__readChat_id = function __readChat_id() { this.chat_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'chat_id', this.chat_id, this._readOffset); } }; }::false channelParticipantsBots::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '5b86d1b0'; this._typeName = "Telegram.type.ChannelParticipantsBots"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false help.termsOfService::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '903eeef1'; this._typeName = "Telegram.type.help.TermsOfService"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeText(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readText(); return this; }; this.__writeText = function __writeText() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'text', this.text); } this.writeString(this.text); }; this.__readText = function __readText() { this.text = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'text', this.text, this._readOffset); } }; }::false updateNewStickerSet::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'aa308a68'; this._typeName = "Telegram.type.UpdateNewStickerSet"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var stickersetBytes = this.stickerset.serialize({isBare: false}); this._writeBytes(stickersetBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', messages_StickerSet, bytes.toString('hex'), 'messages_StickerSet'); } var messages_StickerSet = this.constructor.requireTypeFromBuffer(bytes); if (messages_StickerSet) { var obj = new messages_StickerSet({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.stickerset = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type messages_StickerSet and buffer:' + this._buffer.toString('hex')); } return this; }; }::false updateStickerSetsOrder::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '01d2b20b'; this._typeName = "Telegram.type.UpdateStickerSetsOrder"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.masks ? (this.flags | 1) : (this.flags & ~1); this.__writeFlags(); var orderBytes = this.order.serialize({isBare: false}); this._writeBytes(orderBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 0)) !== 0) { this.__readMasks(); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'long', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.order = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readMasks = function __readMasks() { this.masks = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'masks', this.masks, this._readOffset); } }; }::false updateStickerSets::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'ec3dae43'; this._typeName = "Telegram.type.UpdateStickerSets"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false foundGif::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '1fcc2e16'; this._typeName = "Telegram.type.FoundGif"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUrl(); this.__writeThumb_url(); this.__writeContent_url(); this.__writeContent_type(); this.__writeW(); this.__writeH(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUrl(); this.__readThumb_url(); this.__readContent_url(); this.__readContent_type(); this.__readW(); this.__readH(); return this; }; this.__writeUrl = function __writeUrl() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'url', this.url); } this.writeString(this.url); }; this.__writeThumb_url = function __writeThumb_url() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'thumb_url', this.thumb_url); } this.writeString(this.thumb_url); }; this.__writeContent_url = function __writeContent_url() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'content_url', this.content_url); } this.writeString(this.content_url); }; this.__writeContent_type = function __writeContent_type() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'content_type', this.content_type); } this.writeString(this.content_type); }; this.__writeW = function __writeW() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'w', this.w); } this.writeInt(this.w); }; this.__writeH = function __writeH() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'h', this.h); } this.writeInt(this.h); }; this.__readUrl = function __readUrl() { this.url = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'url', this.url, this._readOffset); } }; this.__readThumb_url = function __readThumb_url() { this.thumb_url = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'thumb_url', this.thumb_url, this._readOffset); } }; this.__readContent_url = function __readContent_url() { this.content_url = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'content_url', this.content_url, this._readOffset); } }; this.__readContent_type = function __readContent_type() { this.content_type = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'content_type', this.content_type, this._readOffset); } }; this.__readW = function __readW() { this.w = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'w', this.w, this._readOffset); } }; this.__readH = function __readH() { this.h = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'h', this.h, this._readOffset); } }; }::false foundGifCached::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '0904759c'; this._typeName = "Telegram.type.FoundGifCached"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUrl(); var photoBytes = this.photo.serialize({isBare: false}); this._writeBytes(photoBytes); var documentBytes = this.document.serialize({isBare: false}); this._writeBytes(documentBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUrl(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Photo, bytes.toString('hex'), 'Photo'); } var Photo = this.constructor.requireTypeFromBuffer(bytes); if (Photo) { var obj = new Photo({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.photo = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Photo and buffer:' + this._buffer.toString('hex')); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Document, bytes.toString('hex'), 'Document'); } var Document = this.constructor.requireTypeFromBuffer(bytes); if (Document) { var obj = new Document({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.document = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Document and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeUrl = function __writeUrl() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'url', this.url); } this.writeString(this.url); }; this.__readUrl = function __readUrl() { this.url = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'url', this.url, this._readOffset); } }; }::false inputMediaGifExternal::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'fdb04348'; this._typeName = "Telegram.type.InputMediaGifExternal"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUrl(); this.__writeQ(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUrl(); this.__readQ(); return this; }; this.__writeUrl = function __writeUrl() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'url', this.url); } this.writeString(this.url); }; this.__writeQ = function __writeQ() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'q', this.q); } this.writeString(this.q); }; this.__readUrl = function __readUrl() { this.url = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'url', this.url, this._readOffset); } }; this.__readQ = function __readQ() { this.q = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'q', this.q, this._readOffset); } }; }::false messages.foundGifs::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '0a1c0a45'; this._typeName = "Telegram.type.messages.FoundGifs"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeNext_offset(); var resultsBytes = this.results.serialize({isBare: false}); this._writeBytes(resultsBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readNext_offset(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'FoundGif', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.results = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeNext_offset = function __writeNext_offset() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'next_offset', this.next_offset); } this.writeInt(this.next_offset); }; this.__readNext_offset = function __readNext_offset() { this.next_offset = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'next_offset', this.next_offset, this._readOffset); } }; }::false messages.savedGifsNotModified::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a25c02e8'; this._typeName = "Telegram.type.messages.SavedGifsNotModified"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false messages.savedGifs::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a509072e'; this._typeName = "Telegram.type.messages.SavedGifs"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeHash(); var gifsBytes = this.gifs.serialize({isBare: false}); this._writeBytes(gifsBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readHash(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Document', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.gifs = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeHash = function __writeHash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'hash', this.hash); } this.writeInt(this.hash); }; this.__readHash = function __readHash() { this.hash = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'hash', this.hash, this._readOffset); } }; }::false updateSavedGifs::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '1e347593'; this._typeName = "Telegram.type.UpdateSavedGifs"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputBotInlineMessageMediaAuto::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '13ed2f29'; this._typeName = "Telegram.type.InputBotInlineMessageMediaAuto"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.reply_markup !== null ? (this.flags | 4) : (this.flags & ~4); this.__writeFlags(); this.__writeCaption(); if (this.reply_markup) { var reply_markupBytes = this.reply_markup.serialize({isBare: false}); this._writeBytes(reply_markupBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); this.__readCaption(); if ((this.flags & (1 << 2)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ReplyMarkup, bytes.toString('hex'), 'ReplyMarkup'); } var ReplyMarkup = this.constructor.requireTypeFromBuffer(bytes); if (ReplyMarkup) { var obj = new ReplyMarkup({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.reply_markup = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ReplyMarkup and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeCaption = function __writeCaption() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'caption', this.caption); } this.writeString(this.caption); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readCaption = function __readCaption() { this.caption = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'caption', this.caption, this._readOffset); } }; }::false inputBotInlineMessageText::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '877acd3d'; this._typeName = "Telegram.type.InputBotInlineMessageText"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.no_webpage ? (this.flags | 1) : (this.flags & ~1); this.flags = this.entities !== null ? (this.flags | 2) : (this.flags & ~2); this.flags = this.reply_markup !== null ? (this.flags | 4) : (this.flags & ~4); this.__writeFlags(); this.__writeMessage(); if (this.entities) { var entitiesBytes = this.entities.serialize({isBare: false}); this._writeBytes(entitiesBytes); } if (this.reply_markup) { var reply_markupBytes = this.reply_markup.serialize({isBare: false}); this._writeBytes(reply_markupBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 0)) !== 0) { this.__readNo_webpage(); } this.__readMessage(); if ((this.flags & (1 << 1)) !== 0) { var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'MessageEntity', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.entities = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } } if ((this.flags & (1 << 2)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ReplyMarkup, bytes.toString('hex'), 'ReplyMarkup'); } var ReplyMarkup = this.constructor.requireTypeFromBuffer(bytes); if (ReplyMarkup) { var obj = new ReplyMarkup({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.reply_markup = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ReplyMarkup and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeMessage = function __writeMessage() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'message', this.message); } this.writeString(this.message); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readNo_webpage = function __readNo_webpage() { this.no_webpage = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'no_webpage', this.no_webpage, this._readOffset); } }; this.__readMessage = function __readMessage() { this.message = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'message', this.message, this._readOffset); } }; }::false inputBotInlineResult::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '5ae1bb2c'; this._typeName = "Telegram.type.InputBotInlineResult"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.title !== null ? (this.flags | 2) : (this.flags & ~2); this.flags = this.description !== null ? (this.flags | 4) : (this.flags & ~4); this.flags = this.url !== null ? (this.flags | 8) : (this.flags & ~8); this.flags = this.thumb_url !== null ? (this.flags | 16) : (this.flags & ~16); this.flags = this.content_url !== null ? (this.flags | 32) : (this.flags & ~32); this.flags = this.content_type !== null ? (this.flags | 32) : (this.flags & ~32); this.flags = this.w !== null ? (this.flags | 64) : (this.flags & ~64); this.flags = this.h !== null ? (this.flags | 64) : (this.flags & ~64); this.flags = this.duration !== null ? (this.flags | 128) : (this.flags & ~128); this.__writeFlags(); this.__writeId(); this.__writeType(); if (this.title) { this.__writeTitle(); } if (this.description) { this.__writeDescription(); } if (this.url) { this.__writeUrl(); } if (this.thumb_url) { this.__writeThumb_url(); } if (this.content_url) { this.__writeContent_url(); } if (this.content_type) { this.__writeContent_type(); } if (this.w) { this.__writeW(); } if (this.h) { this.__writeH(); } if (this.duration) { this.__writeDuration(); } var send_messageBytes = this.send_message.serialize({isBare: false}); this._writeBytes(send_messageBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); this.__readId(); this.__readType(); if ((this.flags & (1 << 1)) !== 0) { this.__readTitle(); } if ((this.flags & (1 << 2)) !== 0) { this.__readDescription(); } if ((this.flags & (1 << 3)) !== 0) { this.__readUrl(); } if ((this.flags & (1 << 4)) !== 0) { this.__readThumb_url(); } if ((this.flags & (1 << 5)) !== 0) { this.__readContent_url(); } if ((this.flags & (1 << 5)) !== 0) { this.__readContent_type(); } if ((this.flags & (1 << 6)) !== 0) { this.__readW(); } if ((this.flags & (1 << 6)) !== 0) { this.__readH(); } if ((this.flags & (1 << 7)) !== 0) { this.__readDuration(); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputBotInlineMessage, bytes.toString('hex'), 'InputBotInlineMessage'); } var InputBotInlineMessage = this.constructor.requireTypeFromBuffer(bytes); if (InputBotInlineMessage) { var obj = new InputBotInlineMessage({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.send_message = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputBotInlineMessage and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeString(this.id); }; this.__writeType = function __writeType() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'type', this.type); } this.writeString(this.type); }; this.__writeTitle = function __writeTitle() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'title', this.title); } this.writeString(this.title); }; this.__writeDescription = function __writeDescription() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'description', this.description); } this.writeString(this.description); }; this.__writeUrl = function __writeUrl() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'url', this.url); } this.writeString(this.url); }; this.__writeThumb_url = function __writeThumb_url() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'thumb_url', this.thumb_url); } this.writeString(this.thumb_url); }; this.__writeContent_url = function __writeContent_url() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'content_url', this.content_url); } this.writeString(this.content_url); }; this.__writeContent_type = function __writeContent_type() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'content_type', this.content_type); } this.writeString(this.content_type); }; this.__writeW = function __writeW() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'w', this.w); } this.writeInt(this.w); }; this.__writeH = function __writeH() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'h', this.h); } this.writeInt(this.h); }; this.__writeDuration = function __writeDuration() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'duration', this.duration); } this.writeInt(this.duration); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readId = function __readId() { this.id = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readType = function __readType() { this.type = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'type', this.type, this._readOffset); } }; this.__readTitle = function __readTitle() { this.title = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'title', this.title, this._readOffset); } }; this.__readDescription = function __readDescription() { this.description = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'description', this.description, this._readOffset); } }; this.__readUrl = function __readUrl() { this.url = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'url', this.url, this._readOffset); } }; this.__readThumb_url = function __readThumb_url() { this.thumb_url = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'thumb_url', this.thumb_url, this._readOffset); } }; this.__readContent_url = function __readContent_url() { this.content_url = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'content_url', this.content_url, this._readOffset); } }; this.__readContent_type = function __readContent_type() { this.content_type = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'content_type', this.content_type, this._readOffset); } }; this.__readW = function __readW() { this.w = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'w', this.w, this._readOffset); } }; this.__readH = function __readH() { this.h = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'h', this.h, this._readOffset); } }; this.__readDuration = function __readDuration() { this.duration = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'duration', this.duration, this._readOffset); } }; }::false botInlineMessageMediaAuto::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '5bb1740a'; this._typeName = "Telegram.type.BotInlineMessageMediaAuto"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.reply_markup !== null ? (this.flags | 4) : (this.flags & ~4); this.__writeFlags(); this.__writeCaption(); if (this.reply_markup) { var reply_markupBytes = this.reply_markup.serialize({isBare: false}); this._writeBytes(reply_markupBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); this.__readCaption(); if ((this.flags & (1 << 2)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ReplyMarkup, bytes.toString('hex'), 'ReplyMarkup'); } var ReplyMarkup = this.constructor.requireTypeFromBuffer(bytes); if (ReplyMarkup) { var obj = new ReplyMarkup({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.reply_markup = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ReplyMarkup and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeCaption = function __writeCaption() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'caption', this.caption); } this.writeString(this.caption); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readCaption = function __readCaption() { this.caption = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'caption', this.caption, this._readOffset); } }; }::false botInlineMessageText::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'e2657f8c'; this._typeName = "Telegram.type.BotInlineMessageText"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.no_webpage ? (this.flags | 1) : (this.flags & ~1); this.flags = this.entities !== null ? (this.flags | 2) : (this.flags & ~2); this.flags = this.reply_markup !== null ? (this.flags | 4) : (this.flags & ~4); this.__writeFlags(); this.__writeMessage(); if (this.entities) { var entitiesBytes = this.entities.serialize({isBare: false}); this._writeBytes(entitiesBytes); } if (this.reply_markup) { var reply_markupBytes = this.reply_markup.serialize({isBare: false}); this._writeBytes(reply_markupBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 0)) !== 0) { this.__readNo_webpage(); } this.__readMessage(); if ((this.flags & (1 << 1)) !== 0) { var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'MessageEntity', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.entities = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } } if ((this.flags & (1 << 2)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ReplyMarkup, bytes.toString('hex'), 'ReplyMarkup'); } var ReplyMarkup = this.constructor.requireTypeFromBuffer(bytes); if (ReplyMarkup) { var obj = new ReplyMarkup({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.reply_markup = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ReplyMarkup and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeMessage = function __writeMessage() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'message', this.message); } this.writeString(this.message); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readNo_webpage = function __readNo_webpage() { this.no_webpage = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'no_webpage', this.no_webpage, this._readOffset); } }; this.__readMessage = function __readMessage() { this.message = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'message', this.message, this._readOffset); } }; }::false botInlineResult::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'b9aeeb9b'; this._typeName = "Telegram.type.BotInlineResult"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.title !== null ? (this.flags | 2) : (this.flags & ~2); this.flags = this.description !== null ? (this.flags | 4) : (this.flags & ~4); this.flags = this.url !== null ? (this.flags | 8) : (this.flags & ~8); this.flags = this.thumb_url !== null ? (this.flags | 16) : (this.flags & ~16); this.flags = this.content_url !== null ? (this.flags | 32) : (this.flags & ~32); this.flags = this.content_type !== null ? (this.flags | 32) : (this.flags & ~32); this.flags = this.w !== null ? (this.flags | 64) : (this.flags & ~64); this.flags = this.h !== null ? (this.flags | 64) : (this.flags & ~64); this.flags = this.duration !== null ? (this.flags | 128) : (this.flags & ~128); this.__writeFlags(); this.__writeId(); this.__writeType(); if (this.title) { this.__writeTitle(); } if (this.description) { this.__writeDescription(); } if (this.url) { this.__writeUrl(); } if (this.thumb_url) { this.__writeThumb_url(); } if (this.content_url) { this.__writeContent_url(); } if (this.content_type) { this.__writeContent_type(); } if (this.w) { this.__writeW(); } if (this.h) { this.__writeH(); } if (this.duration) { this.__writeDuration(); } var send_messageBytes = this.send_message.serialize({isBare: false}); this._writeBytes(send_messageBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); this.__readId(); this.__readType(); if ((this.flags & (1 << 1)) !== 0) { this.__readTitle(); } if ((this.flags & (1 << 2)) !== 0) { this.__readDescription(); } if ((this.flags & (1 << 3)) !== 0) { this.__readUrl(); } if ((this.flags & (1 << 4)) !== 0) { this.__readThumb_url(); } if ((this.flags & (1 << 5)) !== 0) { this.__readContent_url(); } if ((this.flags & (1 << 5)) !== 0) { this.__readContent_type(); } if ((this.flags & (1 << 6)) !== 0) { this.__readW(); } if ((this.flags & (1 << 6)) !== 0) { this.__readH(); } if ((this.flags & (1 << 7)) !== 0) { this.__readDuration(); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', BotInlineMessage, bytes.toString('hex'), 'BotInlineMessage'); } var BotInlineMessage = this.constructor.requireTypeFromBuffer(bytes); if (BotInlineMessage) { var obj = new BotInlineMessage({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.send_message = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type BotInlineMessage and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeString(this.id); }; this.__writeType = function __writeType() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'type', this.type); } this.writeString(this.type); }; this.__writeTitle = function __writeTitle() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'title', this.title); } this.writeString(this.title); }; this.__writeDescription = function __writeDescription() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'description', this.description); } this.writeString(this.description); }; this.__writeUrl = function __writeUrl() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'url', this.url); } this.writeString(this.url); }; this.__writeThumb_url = function __writeThumb_url() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'thumb_url', this.thumb_url); } this.writeString(this.thumb_url); }; this.__writeContent_url = function __writeContent_url() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'content_url', this.content_url); } this.writeString(this.content_url); }; this.__writeContent_type = function __writeContent_type() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'content_type', this.content_type); } this.writeString(this.content_type); }; this.__writeW = function __writeW() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'w', this.w); } this.writeInt(this.w); }; this.__writeH = function __writeH() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'h', this.h); } this.writeInt(this.h); }; this.__writeDuration = function __writeDuration() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'duration', this.duration); } this.writeInt(this.duration); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readId = function __readId() { this.id = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readType = function __readType() { this.type = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'type', this.type, this._readOffset); } }; this.__readTitle = function __readTitle() { this.title = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'title', this.title, this._readOffset); } }; this.__readDescription = function __readDescription() { this.description = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'description', this.description, this._readOffset); } }; this.__readUrl = function __readUrl() { this.url = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'url', this.url, this._readOffset); } }; this.__readThumb_url = function __readThumb_url() { this.thumb_url = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'thumb_url', this.thumb_url, this._readOffset); } }; this.__readContent_url = function __readContent_url() { this.content_url = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'content_url', this.content_url, this._readOffset); } }; this.__readContent_type = function __readContent_type() { this.content_type = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'content_type', this.content_type, this._readOffset); } }; this.__readW = function __readW() { this.w = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'w', this.w, this._readOffset); } }; this.__readH = function __readH() { this.h = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'h', this.h, this._readOffset); } }; this.__readDuration = function __readDuration() { this.duration = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'duration', this.duration, this._readOffset); } }; }::false messages.botResults::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a6096725'; this._typeName = "Telegram.type.messages.BotResults"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.gallery ? (this.flags | 1) : (this.flags & ~1); this.flags = this.next_offset !== null ? (this.flags | 2) : (this.flags & ~2); this.flags = this.switch_pm !== null ? (this.flags | 4) : (this.flags & ~4); this.__writeFlags(); this.__writeQuery_id(); if (this.next_offset) { this.__writeNext_offset(); } if (this.switch_pm) { var switch_pmBytes = this.switch_pm.serialize({isBare: false}); this._writeBytes(switch_pmBytes); } var resultsBytes = this.results.serialize({isBare: false}); this._writeBytes(resultsBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 0)) !== 0) { this.__readGallery(); } this.__readQuery_id(); if ((this.flags & (1 << 1)) !== 0) { this.__readNext_offset(); } if ((this.flags & (1 << 2)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InlineBotSwitchPM, bytes.toString('hex'), 'InlineBotSwitchPM'); } var InlineBotSwitchPM = this.constructor.requireTypeFromBuffer(bytes); if (InlineBotSwitchPM) { var obj = new InlineBotSwitchPM({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.switch_pm = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InlineBotSwitchPM and buffer:' + this._buffer.toString('hex')); } } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'BotInlineResult', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.results = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeQuery_id = function __writeQuery_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'query_id', this.query_id); } this.writeLong(this.query_id); }; this.__writeNext_offset = function __writeNext_offset() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'next_offset', this.next_offset); } this.writeString(this.next_offset); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readGallery = function __readGallery() { this.gallery = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'gallery', this.gallery, this._readOffset); } }; this.__readQuery_id = function __readQuery_id() { this.query_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'query_id', this.query_id, this._readOffset); } }; this.__readNext_offset = function __readNext_offset() { this.next_offset = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'next_offset', this.next_offset, this._readOffset); } }; }::false updateBotInlineQuery::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '90668254'; this._typeName = "Telegram.type.UpdateBotInlineQuery"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.geo !== null ? (this.flags | 1) : (this.flags & ~1); this.__writeFlags(); this.__writeQuery_id(); this.__writeUser_id(); this.__writeQuery(); if (this.geo) { var geoBytes = this.geo.serialize({isBare: false}); this._writeBytes(geoBytes); } this.__writeOffset(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); this.__readQuery_id(); this.__readUser_id(); this.__readQuery(); if ((this.flags & (1 << 0)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', GeoPoint, bytes.toString('hex'), 'GeoPoint'); } var GeoPoint = this.constructor.requireTypeFromBuffer(bytes); if (GeoPoint) { var obj = new GeoPoint({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.geo = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type GeoPoint and buffer:' + this._buffer.toString('hex')); } } this.__readOffset(); return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeQuery_id = function __writeQuery_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'query_id', this.query_id); } this.writeLong(this.query_id); }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writeQuery = function __writeQuery() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'query', this.query); } this.writeString(this.query); }; this.__writeOffset = function __writeOffset() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'offset', this.offset); } this.writeString(this.offset); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readQuery_id = function __readQuery_id() { this.query_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'query_id', this.query_id, this._readOffset); } }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readQuery = function __readQuery() { this.query = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'query', this.query, this._readOffset); } }; this.__readOffset = function __readOffset() { this.offset = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'offset', this.offset, this._readOffset); } }; }::false updateBotInlineSend::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '64f9480e'; this._typeName = "Telegram.type.UpdateBotInlineSend"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.geo !== null ? (this.flags | 1) : (this.flags & ~1); this.flags = this.msg_id !== null ? (this.flags | 2) : (this.flags & ~2); this.__writeFlags(); this.__writeUser_id(); this.__writeQuery(); if (this.geo) { var geoBytes = this.geo.serialize({isBare: false}); this._writeBytes(geoBytes); } this.__writeId(); if (this.msg_id) { var msg_idBytes = this.msg_id.serialize({isBare: false}); this._writeBytes(msg_idBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); this.__readUser_id(); this.__readQuery(); if ((this.flags & (1 << 0)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', GeoPoint, bytes.toString('hex'), 'GeoPoint'); } var GeoPoint = this.constructor.requireTypeFromBuffer(bytes); if (GeoPoint) { var obj = new GeoPoint({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.geo = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type GeoPoint and buffer:' + this._buffer.toString('hex')); } } this.__readId(); if ((this.flags & (1 << 1)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputBotInlineMessageID, bytes.toString('hex'), 'InputBotInlineMessageID'); } var InputBotInlineMessageID = this.constructor.requireTypeFromBuffer(bytes); if (InputBotInlineMessageID) { var obj = new InputBotInlineMessageID({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.msg_id = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputBotInlineMessageID and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writeQuery = function __writeQuery() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'query', this.query); } this.writeString(this.query); }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeString(this.id); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readQuery = function __readQuery() { this.query = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'query', this.query, this._readOffset); } }; this.__readId = function __readId() { this.id = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; }::false inputMessagesFilterVoice::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '92c3f550'; this._typeName = "Telegram.type.InputMessagesFilterVoice"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputMessagesFilterMusic::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '9eb45137'; this._typeName = "Telegram.type.InputMessagesFilterMusic"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputPrivacyKeyChatInvite::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '2604fbbd'; this._typeName = "Telegram.type.InputPrivacyKeyChatInvite"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false privacyKeyChatInvite::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'fa6d0e50'; this._typeName = "Telegram.type.PrivacyKeyChatInvite"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false exportedMessageLink::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '0368481f'; this._typeName = "Telegram.type.ExportedMessageLink"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeLink(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readLink(); return this; }; this.__writeLink = function __writeLink() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'link', this.link); } this.writeString(this.link); }; this.__readLink = function __readLink() { this.link = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'link', this.link, this._readOffset); } }; }::false messageFwdHeader::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'cbdd86c7'; this._typeName = "Telegram.type.MessageFwdHeader"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.from_id !== null ? (this.flags | 1) : (this.flags & ~1); this.flags = this.channel_id !== null ? (this.flags | 2) : (this.flags & ~2); this.flags = this.channel_post !== null ? (this.flags | 4) : (this.flags & ~4); this.__writeFlags(); if (this.from_id) { this.__writeFrom_id(); } this.__writeDate(); if (this.channel_id) { this.__writeChannel_id(); } if (this.channel_post) { this.__writeChannel_post(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 0)) !== 0) { this.__readFrom_id(); } this.__readDate(); if ((this.flags & (1 << 1)) !== 0) { this.__readChannel_id(); } if ((this.flags & (1 << 2)) !== 0) { this.__readChannel_post(); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeFrom_id = function __writeFrom_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'from_id', this.from_id); } this.writeInt(this.from_id); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__writeChannel_id = function __writeChannel_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'channel_id', this.channel_id); } this.writeInt(this.channel_id); }; this.__writeChannel_post = function __writeChannel_post() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'channel_post', this.channel_post); } this.writeInt(this.channel_post); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readFrom_id = function __readFrom_id() { this.from_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'from_id', this.from_id, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; this.__readChannel_id = function __readChannel_id() { this.channel_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'channel_id', this.channel_id, this._readOffset); } }; this.__readChannel_post = function __readChannel_post() { this.channel_post = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'channel_post', this.channel_post, this._readOffset); } }; }::false updateEditChannelMessage::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'f74d3f1b'; this._typeName = "Telegram.type.UpdateEditChannelMessage"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var messageBytes = this.message.serialize({isBare: false}); this._writeBytes(messageBytes); this.__writePts(); this.__writePts_count(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Message, bytes.toString('hex'), 'Message'); } var Message = this.constructor.requireTypeFromBuffer(bytes); if (Message) { var obj = new Message({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.message = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Message and buffer:' + this._buffer.toString('hex')); } this.__readPts(); this.__readPts_count(); return this; }; this.__writePts = function __writePts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts', this.pts); } this.writeInt(this.pts); }; this.__writePts_count = function __writePts_count() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts_count', this.pts_count); } this.writeInt(this.pts_count); }; this.__readPts = function __readPts() { this.pts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts', this.pts, this._readOffset); } }; this.__readPts_count = function __readPts_count() { this.pts_count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts_count', this.pts_count, this._readOffset); } }; }::false updateChannelPinnedMessage::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '75245998'; this._typeName = "Telegram.type.UpdateChannelPinnedMessage"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeChannel_id(); this.__writeId(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readChannel_id(); this.__readId(); return this; }; this.__writeChannel_id = function __writeChannel_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'channel_id', this.channel_id); } this.writeInt(this.channel_id); }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeInt(this.id); }; this.__readChannel_id = function __readChannel_id() { this.channel_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'channel_id', this.channel_id, this._readOffset); } }; this.__readId = function __readId() { this.id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; }::false messageActionPinMessage::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'ed38bd94'; this._typeName = "Telegram.type.MessageActionPinMessage"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false auth.codeTypeSms::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '8c15a372'; this._typeName = "Telegram.type.auth.CodeTypeSms"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false auth.codeTypeCall::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'e3d31c74'; this._typeName = "Telegram.type.auth.CodeTypeCall"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false auth.codeTypeFlashCall::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'fbce6c22'; this._typeName = "Telegram.type.auth.CodeTypeFlashCall"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false auth.sentCodeTypeApp::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '8659bb3d'; this._typeName = "Telegram.type.auth.SentCodeTypeApp"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeLength(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readLength(); return this; }; this.__writeLength = function __writeLength() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'length', this.length); } this.writeInt(this.length); }; this.__readLength = function __readLength() { this.length = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'length', this.length, this._readOffset); } }; }::false auth.sentCodeTypeSms::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a2bb00c0'; this._typeName = "Telegram.type.auth.SentCodeTypeSms"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeLength(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readLength(); return this; }; this.__writeLength = function __writeLength() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'length', this.length); } this.writeInt(this.length); }; this.__readLength = function __readLength() { this.length = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'length', this.length, this._readOffset); } }; }::false auth.sentCodeTypeCall::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a7e55353'; this._typeName = "Telegram.type.auth.SentCodeTypeCall"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeLength(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readLength(); return this; }; this.__writeLength = function __writeLength() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'length', this.length); } this.writeInt(this.length); }; this.__readLength = function __readLength() { this.length = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'length', this.length, this._readOffset); } }; }::false auth.sentCodeTypeFlashCall::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'd9c603ab'; this._typeName = "Telegram.type.auth.SentCodeTypeFlashCall"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writePattern(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readPattern(); return this; }; this.__writePattern = function __writePattern() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pattern', this.pattern); } this.writeString(this.pattern); }; this.__readPattern = function __readPattern() { this.pattern = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pattern', this.pattern, this._readOffset); } }; }::false keyboardButtonUrl::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '05ff8a25'; this._typeName = "Telegram.type.KeyboardButtonUrl"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeText(); this.__writeUrl(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readText(); this.__readUrl(); return this; }; this.__writeText = function __writeText() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'text', this.text); } this.writeString(this.text); }; this.__writeUrl = function __writeUrl() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'url', this.url); } this.writeString(this.url); }; this.__readText = function __readText() { this.text = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'text', this.text, this._readOffset); } }; this.__readUrl = function __readUrl() { this.url = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'url', this.url, this._readOffset); } }; }::false keyboardButtonCallback::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '465e3a68'; this._typeName = "Telegram.type.KeyboardButtonCallback"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeText(); this.__writeData(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readText(); this.__readData(); return this; }; this.__writeText = function __writeText() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'text', this.text); } this.writeString(this.text); }; this.__writeData = function __writeData() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'data', this.data.toString('hex')); } this.writeBytes(this.data); }; this.__readText = function __readText() { this.text = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'text', this.text, this._readOffset); } }; this.__readData = function __readData() { this.data = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'data', this.data.toString('hex'), this._readOffset); } }; }::false keyboardButtonRequestPhone::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '296c6ab1'; this._typeName = "Telegram.type.KeyboardButtonRequestPhone"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeText(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readText(); return this; }; this.__writeText = function __writeText() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'text', this.text); } this.writeString(this.text); }; this.__readText = function __readText() { this.text = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'text', this.text, this._readOffset); } }; }::false keyboardButtonRequestGeoLocation::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '3f6b79fc'; this._typeName = "Telegram.type.KeyboardButtonRequestGeoLocation"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeText(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readText(); return this; }; this.__writeText = function __writeText() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'text', this.text); } this.writeString(this.text); }; this.__readText = function __readText() { this.text = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'text', this.text, this._readOffset); } }; }::false keyboardButtonSwitchInline::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '48a76805'; this._typeName = "Telegram.type.KeyboardButtonSwitchInline"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.same_peer ? (this.flags | 1) : (this.flags & ~1); this.__writeFlags(); this.__writeText(); this.__writeQuery(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 0)) !== 0) { this.__readSame_peer(); } this.__readText(); this.__readQuery(); return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeText = function __writeText() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'text', this.text); } this.writeString(this.text); }; this.__writeQuery = function __writeQuery() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'query', this.query); } this.writeString(this.query); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readSame_peer = function __readSame_peer() { this.same_peer = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'same_peer', this.same_peer, this._readOffset); } }; this.__readText = function __readText() { this.text = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'text', this.text, this._readOffset); } }; this.__readQuery = function __readQuery() { this.query = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'query', this.query, this._readOffset); } }; }::false replyInlineMarkup::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '5402a348'; this._typeName = "Telegram.type.ReplyInlineMarkup"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var rowsBytes = this.rows.serialize({isBare: false}); this._writeBytes(rowsBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'KeyboardButtonRow', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.rows = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false messages.botCallbackAnswer::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'fbf10db1'; this._typeName = "Telegram.type.messages.BotCallbackAnswer"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.alert ? (this.flags | 2) : (this.flags & ~2); this.flags = this.has_url ? (this.flags | 8) : (this.flags & ~8); this.flags = this.message !== null ? (this.flags | 1) : (this.flags & ~1); this.flags = this.url !== null ? (this.flags | 4) : (this.flags & ~4); this.__writeFlags(); if (this.message) { this.__writeMessage(); } if (this.url) { this.__writeUrl(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 1)) !== 0) { this.__readAlert(); } if ((this.flags & (1 << 3)) !== 0) { this.__readHas_url(); } if ((this.flags & (1 << 0)) !== 0) { this.__readMessage(); } if ((this.flags & (1 << 2)) !== 0) { this.__readUrl(); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeMessage = function __writeMessage() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'message', this.message); } this.writeString(this.message); }; this.__writeUrl = function __writeUrl() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'url', this.url); } this.writeString(this.url); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readAlert = function __readAlert() { this.alert = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'alert', this.alert, this._readOffset); } }; this.__readHas_url = function __readHas_url() { this.has_url = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'has_url', this.has_url, this._readOffset); } }; this.__readMessage = function __readMessage() { this.message = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'message', this.message, this._readOffset); } }; this.__readUrl = function __readUrl() { this.url = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'url', this.url, this._readOffset); } }; }::false updateBotCallbackQuery::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'e14735e7'; this._typeName = "Telegram.type.UpdateBotCallbackQuery"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.data !== null ? (this.flags | 1) : (this.flags & ~1); this.flags = this.game_short_name !== null ? (this.flags | 2) : (this.flags & ~2); this.__writeFlags(); this.__writeQuery_id(); this.__writeUser_id(); var peerBytes = this.peer.serialize({isBare: false}); this._writeBytes(peerBytes); this.__writeMsg_id(); this.__writeChat_instance(); if (this.data) { this.__writeData(); } if (this.game_short_name) { this.__writeGame_short_name(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); this.__readQuery_id(); this.__readUser_id(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Peer, bytes.toString('hex'), 'Peer'); } var Peer = this.constructor.requireTypeFromBuffer(bytes); if (Peer) { var obj = new Peer({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.peer = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Peer and buffer:' + this._buffer.toString('hex')); } this.__readMsg_id(); this.__readChat_instance(); if ((this.flags & (1 << 0)) !== 0) { this.__readData(); } if ((this.flags & (1 << 1)) !== 0) { this.__readGame_short_name(); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeQuery_id = function __writeQuery_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'query_id', this.query_id); } this.writeLong(this.query_id); }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writeMsg_id = function __writeMsg_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'msg_id', this.msg_id); } this.writeInt(this.msg_id); }; this.__writeChat_instance = function __writeChat_instance() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'chat_instance', this.chat_instance); } this.writeLong(this.chat_instance); }; this.__writeData = function __writeData() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'data', this.data.toString('hex')); } this.writeBytes(this.data); }; this.__writeGame_short_name = function __writeGame_short_name() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'game_short_name', this.game_short_name); } this.writeString(this.game_short_name); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readQuery_id = function __readQuery_id() { this.query_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'query_id', this.query_id, this._readOffset); } }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readMsg_id = function __readMsg_id() { this.msg_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'msg_id', this.msg_id, this._readOffset); } }; this.__readChat_instance = function __readChat_instance() { this.chat_instance = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'chat_instance', this.chat_instance, this._readOffset); } }; this.__readData = function __readData() { this.data = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'data', this.data.toString('hex'), this._readOffset); } }; this.__readGame_short_name = function __readGame_short_name() { this.game_short_name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'game_short_name', this.game_short_name, this._readOffset); } }; }::false messages.messageEditData::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'e6ddb526'; this._typeName = "Telegram.type.messages.MessageEditData"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.caption ? (this.flags | 1) : (this.flags & ~1); this.__writeFlags(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 0)) !== 0) { this.__readCaption(); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readCaption = function __readCaption() { this.caption = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'caption', this.caption, this._readOffset); } }; }::false updateEditMessage::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a37003e4'; this._typeName = "Telegram.type.UpdateEditMessage"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var messageBytes = this.message.serialize({isBare: false}); this._writeBytes(messageBytes); this.__writePts(); this.__writePts_count(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Message, bytes.toString('hex'), 'Message'); } var Message = this.constructor.requireTypeFromBuffer(bytes); if (Message) { var obj = new Message({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.message = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Message and buffer:' + this._buffer.toString('hex')); } this.__readPts(); this.__readPts_count(); return this; }; this.__writePts = function __writePts() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts', this.pts); } this.writeInt(this.pts); }; this.__writePts_count = function __writePts_count() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pts_count', this.pts_count); } this.writeInt(this.pts_count); }; this.__readPts = function __readPts() { this.pts = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts', this.pts, this._readOffset); } }; this.__readPts_count = function __readPts_count() { this.pts_count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pts_count', this.pts_count, this._readOffset); } }; }::false inputBotInlineMessageMediaGeo::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'e19da5f4'; this._typeName = "Telegram.type.InputBotInlineMessageMediaGeo"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.reply_markup !== null ? (this.flags | 4) : (this.flags & ~4); this.__writeFlags(); var geo_pointBytes = this.geo_point.serialize({isBare: false}); this._writeBytes(geo_pointBytes); if (this.reply_markup) { var reply_markupBytes = this.reply_markup.serialize({isBare: false}); this._writeBytes(reply_markupBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputGeoPoint, bytes.toString('hex'), 'InputGeoPoint'); } var InputGeoPoint = this.constructor.requireTypeFromBuffer(bytes); if (InputGeoPoint) { var obj = new InputGeoPoint({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.geo_point = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputGeoPoint and buffer:' + this._buffer.toString('hex')); } if ((this.flags & (1 << 2)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ReplyMarkup, bytes.toString('hex'), 'ReplyMarkup'); } var ReplyMarkup = this.constructor.requireTypeFromBuffer(bytes); if (ReplyMarkup) { var obj = new ReplyMarkup({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.reply_markup = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ReplyMarkup and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; }::false inputBotInlineMessageMediaVenue::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c8adafaa'; this._typeName = "Telegram.type.InputBotInlineMessageMediaVenue"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.reply_markup !== null ? (this.flags | 4) : (this.flags & ~4); this.__writeFlags(); var geo_pointBytes = this.geo_point.serialize({isBare: false}); this._writeBytes(geo_pointBytes); this.__writeTitle(); this.__writeAddress(); this.__writeProvider(); this.__writeVenue_id(); if (this.reply_markup) { var reply_markupBytes = this.reply_markup.serialize({isBare: false}); this._writeBytes(reply_markupBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputGeoPoint, bytes.toString('hex'), 'InputGeoPoint'); } var InputGeoPoint = this.constructor.requireTypeFromBuffer(bytes); if (InputGeoPoint) { var obj = new InputGeoPoint({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.geo_point = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputGeoPoint and buffer:' + this._buffer.toString('hex')); } this.__readTitle(); this.__readAddress(); this.__readProvider(); this.__readVenue_id(); if ((this.flags & (1 << 2)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ReplyMarkup, bytes.toString('hex'), 'ReplyMarkup'); } var ReplyMarkup = this.constructor.requireTypeFromBuffer(bytes); if (ReplyMarkup) { var obj = new ReplyMarkup({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.reply_markup = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ReplyMarkup and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeTitle = function __writeTitle() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'title', this.title); } this.writeString(this.title); }; this.__writeAddress = function __writeAddress() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'address', this.address); } this.writeString(this.address); }; this.__writeProvider = function __writeProvider() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'provider', this.provider); } this.writeString(this.provider); }; this.__writeVenue_id = function __writeVenue_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'venue_id', this.venue_id); } this.writeString(this.venue_id); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readTitle = function __readTitle() { this.title = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'title', this.title, this._readOffset); } }; this.__readAddress = function __readAddress() { this.address = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'address', this.address, this._readOffset); } }; this.__readProvider = function __readProvider() { this.provider = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'provider', this.provider, this._readOffset); } }; this.__readVenue_id = function __readVenue_id() { this.venue_id = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'venue_id', this.venue_id, this._readOffset); } }; }::false inputBotInlineMessageMediaContact::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a701af2d'; this._typeName = "Telegram.type.InputBotInlineMessageMediaContact"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.reply_markup !== null ? (this.flags | 4) : (this.flags & ~4); this.__writeFlags(); this.__writePhone_number(); this.__writeFirst_name(); this.__writeLast_name(); if (this.reply_markup) { var reply_markupBytes = this.reply_markup.serialize({isBare: false}); this._writeBytes(reply_markupBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); this.__readPhone_number(); this.__readFirst_name(); this.__readLast_name(); if ((this.flags & (1 << 2)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ReplyMarkup, bytes.toString('hex'), 'ReplyMarkup'); } var ReplyMarkup = this.constructor.requireTypeFromBuffer(bytes); if (ReplyMarkup) { var obj = new ReplyMarkup({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.reply_markup = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ReplyMarkup and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writePhone_number = function __writePhone_number() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'phone_number', this.phone_number); } this.writeString(this.phone_number); }; this.__writeFirst_name = function __writeFirst_name() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'first_name', this.first_name); } this.writeString(this.first_name); }; this.__writeLast_name = function __writeLast_name() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'last_name', this.last_name); } this.writeString(this.last_name); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readPhone_number = function __readPhone_number() { this.phone_number = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'phone_number', this.phone_number, this._readOffset); } }; this.__readFirst_name = function __readFirst_name() { this.first_name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'first_name', this.first_name, this._readOffset); } }; this.__readLast_name = function __readLast_name() { this.last_name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'last_name', this.last_name, this._readOffset); } }; }::false botInlineMessageMediaGeo::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'b8d88f3a'; this._typeName = "Telegram.type.BotInlineMessageMediaGeo"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.reply_markup !== null ? (this.flags | 4) : (this.flags & ~4); this.__writeFlags(); var geoBytes = this.geo.serialize({isBare: false}); this._writeBytes(geoBytes); if (this.reply_markup) { var reply_markupBytes = this.reply_markup.serialize({isBare: false}); this._writeBytes(reply_markupBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', GeoPoint, bytes.toString('hex'), 'GeoPoint'); } var GeoPoint = this.constructor.requireTypeFromBuffer(bytes); if (GeoPoint) { var obj = new GeoPoint({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.geo = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type GeoPoint and buffer:' + this._buffer.toString('hex')); } if ((this.flags & (1 << 2)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ReplyMarkup, bytes.toString('hex'), 'ReplyMarkup'); } var ReplyMarkup = this.constructor.requireTypeFromBuffer(bytes); if (ReplyMarkup) { var obj = new ReplyMarkup({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.reply_markup = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ReplyMarkup and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; }::false botInlineMessageMediaVenue::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '2e236643'; this._typeName = "Telegram.type.BotInlineMessageMediaVenue"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.reply_markup !== null ? (this.flags | 4) : (this.flags & ~4); this.__writeFlags(); var geoBytes = this.geo.serialize({isBare: false}); this._writeBytes(geoBytes); this.__writeTitle(); this.__writeAddress(); this.__writeProvider(); this.__writeVenue_id(); if (this.reply_markup) { var reply_markupBytes = this.reply_markup.serialize({isBare: false}); this._writeBytes(reply_markupBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', GeoPoint, bytes.toString('hex'), 'GeoPoint'); } var GeoPoint = this.constructor.requireTypeFromBuffer(bytes); if (GeoPoint) { var obj = new GeoPoint({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.geo = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type GeoPoint and buffer:' + this._buffer.toString('hex')); } this.__readTitle(); this.__readAddress(); this.__readProvider(); this.__readVenue_id(); if ((this.flags & (1 << 2)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ReplyMarkup, bytes.toString('hex'), 'ReplyMarkup'); } var ReplyMarkup = this.constructor.requireTypeFromBuffer(bytes); if (ReplyMarkup) { var obj = new ReplyMarkup({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.reply_markup = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ReplyMarkup and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeTitle = function __writeTitle() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'title', this.title); } this.writeString(this.title); }; this.__writeAddress = function __writeAddress() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'address', this.address); } this.writeString(this.address); }; this.__writeProvider = function __writeProvider() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'provider', this.provider); } this.writeString(this.provider); }; this.__writeVenue_id = function __writeVenue_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'venue_id', this.venue_id); } this.writeString(this.venue_id); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readTitle = function __readTitle() { this.title = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'title', this.title, this._readOffset); } }; this.__readAddress = function __readAddress() { this.address = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'address', this.address, this._readOffset); } }; this.__readProvider = function __readProvider() { this.provider = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'provider', this.provider, this._readOffset); } }; this.__readVenue_id = function __readVenue_id() { this.venue_id = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'venue_id', this.venue_id, this._readOffset); } }; }::false botInlineMessageMediaContact::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'd4b4ed35'; this._typeName = "Telegram.type.BotInlineMessageMediaContact"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.reply_markup !== null ? (this.flags | 4) : (this.flags & ~4); this.__writeFlags(); this.__writePhone_number(); this.__writeFirst_name(); this.__writeLast_name(); if (this.reply_markup) { var reply_markupBytes = this.reply_markup.serialize({isBare: false}); this._writeBytes(reply_markupBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); this.__readPhone_number(); this.__readFirst_name(); this.__readLast_name(); if ((this.flags & (1 << 2)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ReplyMarkup, bytes.toString('hex'), 'ReplyMarkup'); } var ReplyMarkup = this.constructor.requireTypeFromBuffer(bytes); if (ReplyMarkup) { var obj = new ReplyMarkup({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.reply_markup = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ReplyMarkup and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writePhone_number = function __writePhone_number() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'phone_number', this.phone_number); } this.writeString(this.phone_number); }; this.__writeFirst_name = function __writeFirst_name() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'first_name', this.first_name); } this.writeString(this.first_name); }; this.__writeLast_name = function __writeLast_name() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'last_name', this.last_name); } this.writeString(this.last_name); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readPhone_number = function __readPhone_number() { this.phone_number = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'phone_number', this.phone_number, this._readOffset); } }; this.__readFirst_name = function __readFirst_name() { this.first_name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'first_name', this.first_name, this._readOffset); } }; this.__readLast_name = function __readLast_name() { this.last_name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'last_name', this.last_name, this._readOffset); } }; }::false inputBotInlineResultPhoto::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a764d8a8'; this._typeName = "Telegram.type.InputBotInlineResultPhoto"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeType(); var photoBytes = this.photo.serialize({isBare: false}); this._writeBytes(photoBytes); var send_messageBytes = this.send_message.serialize({isBare: false}); this._writeBytes(send_messageBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readType(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputPhoto, bytes.toString('hex'), 'InputPhoto'); } var InputPhoto = this.constructor.requireTypeFromBuffer(bytes); if (InputPhoto) { var obj = new InputPhoto({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.photo = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputPhoto and buffer:' + this._buffer.toString('hex')); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputBotInlineMessage, bytes.toString('hex'), 'InputBotInlineMessage'); } var InputBotInlineMessage = this.constructor.requireTypeFromBuffer(bytes); if (InputBotInlineMessage) { var obj = new InputBotInlineMessage({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.send_message = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputBotInlineMessage and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeString(this.id); }; this.__writeType = function __writeType() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'type', this.type); } this.writeString(this.type); }; this.__readId = function __readId() { this.id = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readType = function __readType() { this.type = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'type', this.type, this._readOffset); } }; }::false inputBotInlineResultDocument::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c4fdf8ff'; this._typeName = "Telegram.type.InputBotInlineResultDocument"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.title !== null ? (this.flags | 2) : (this.flags & ~2); this.flags = this.description !== null ? (this.flags | 4) : (this.flags & ~4); this.__writeFlags(); this.__writeId(); this.__writeType(); if (this.title) { this.__writeTitle(); } if (this.description) { this.__writeDescription(); } var documentBytes = this.document.serialize({isBare: false}); this._writeBytes(documentBytes); var send_messageBytes = this.send_message.serialize({isBare: false}); this._writeBytes(send_messageBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); this.__readId(); this.__readType(); if ((this.flags & (1 << 1)) !== 0) { this.__readTitle(); } if ((this.flags & (1 << 2)) !== 0) { this.__readDescription(); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputDocument, bytes.toString('hex'), 'InputDocument'); } var InputDocument = this.constructor.requireTypeFromBuffer(bytes); if (InputDocument) { var obj = new InputDocument({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.document = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputDocument and buffer:' + this._buffer.toString('hex')); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputBotInlineMessage, bytes.toString('hex'), 'InputBotInlineMessage'); } var InputBotInlineMessage = this.constructor.requireTypeFromBuffer(bytes); if (InputBotInlineMessage) { var obj = new InputBotInlineMessage({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.send_message = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputBotInlineMessage and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeString(this.id); }; this.__writeType = function __writeType() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'type', this.type); } this.writeString(this.type); }; this.__writeTitle = function __writeTitle() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'title', this.title); } this.writeString(this.title); }; this.__writeDescription = function __writeDescription() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'description', this.description); } this.writeString(this.description); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readId = function __readId() { this.id = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readType = function __readType() { this.type = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'type', this.type, this._readOffset); } }; this.__readTitle = function __readTitle() { this.title = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'title', this.title, this._readOffset); } }; this.__readDescription = function __readDescription() { this.description = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'description', this.description, this._readOffset); } }; }::false botInlineMediaResult::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '0b94db17'; this._typeName = "Telegram.type.BotInlineMediaResult"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.photo !== null ? (this.flags | 1) : (this.flags & ~1); this.flags = this.document !== null ? (this.flags | 2) : (this.flags & ~2); this.flags = this.title !== null ? (this.flags | 4) : (this.flags & ~4); this.flags = this.description !== null ? (this.flags | 8) : (this.flags & ~8); this.__writeFlags(); this.__writeId(); this.__writeType(); if (this.photo) { var photoBytes = this.photo.serialize({isBare: false}); this._writeBytes(photoBytes); } if (this.document) { var documentBytes = this.document.serialize({isBare: false}); this._writeBytes(documentBytes); } if (this.title) { this.__writeTitle(); } if (this.description) { this.__writeDescription(); } var send_messageBytes = this.send_message.serialize({isBare: false}); this._writeBytes(send_messageBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); this.__readId(); this.__readType(); if ((this.flags & (1 << 0)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Photo, bytes.toString('hex'), 'Photo'); } var Photo = this.constructor.requireTypeFromBuffer(bytes); if (Photo) { var obj = new Photo({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.photo = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Photo and buffer:' + this._buffer.toString('hex')); } } if ((this.flags & (1 << 1)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Document, bytes.toString('hex'), 'Document'); } var Document = this.constructor.requireTypeFromBuffer(bytes); if (Document) { var obj = new Document({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.document = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Document and buffer:' + this._buffer.toString('hex')); } } if ((this.flags & (1 << 2)) !== 0) { this.__readTitle(); } if ((this.flags & (1 << 3)) !== 0) { this.__readDescription(); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', BotInlineMessage, bytes.toString('hex'), 'BotInlineMessage'); } var BotInlineMessage = this.constructor.requireTypeFromBuffer(bytes); if (BotInlineMessage) { var obj = new BotInlineMessage({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.send_message = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type BotInlineMessage and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeString(this.id); }; this.__writeType = function __writeType() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'type', this.type); } this.writeString(this.type); }; this.__writeTitle = function __writeTitle() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'title', this.title); } this.writeString(this.title); }; this.__writeDescription = function __writeDescription() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'description', this.description); } this.writeString(this.description); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readId = function __readId() { this.id = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readType = function __readType() { this.type = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'type', this.type, this._readOffset); } }; this.__readTitle = function __readTitle() { this.title = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'title', this.title, this._readOffset); } }; this.__readDescription = function __readDescription() { this.description = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'description', this.description, this._readOffset); } }; }::false inputBotInlineMessageID::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '893d0c89'; this._typeName = "Telegram.type.InputBotInlineMessageID"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeDc_id(); this.__writeId(); this.__writeAccess_hash(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readDc_id(); this.__readId(); this.__readAccess_hash(); return this; }; this.__writeDc_id = function __writeDc_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'dc_id', this.dc_id); } this.writeInt(this.dc_id); }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeLong(this.id); }; this.__writeAccess_hash = function __writeAccess_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'access_hash', this.access_hash); } this.writeLong(this.access_hash); }; this.__readDc_id = function __readDc_id() { this.dc_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'dc_id', this.dc_id, this._readOffset); } }; this.__readId = function __readId() { this.id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readAccess_hash = function __readAccess_hash() { this.access_hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'access_hash', this.access_hash, this._readOffset); } }; }::false updateInlineBotCallbackQuery::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '5a7ad2f9'; this._typeName = "Telegram.type.UpdateInlineBotCallbackQuery"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.data !== null ? (this.flags | 1) : (this.flags & ~1); this.flags = this.game_short_name !== null ? (this.flags | 2) : (this.flags & ~2); this.__writeFlags(); this.__writeQuery_id(); this.__writeUser_id(); var msg_idBytes = this.msg_id.serialize({isBare: false}); this._writeBytes(msg_idBytes); this.__writeChat_instance(); if (this.data) { this.__writeData(); } if (this.game_short_name) { this.__writeGame_short_name(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); this.__readQuery_id(); this.__readUser_id(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputBotInlineMessageID, bytes.toString('hex'), 'InputBotInlineMessageID'); } var InputBotInlineMessageID = this.constructor.requireTypeFromBuffer(bytes); if (InputBotInlineMessageID) { var obj = new InputBotInlineMessageID({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.msg_id = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputBotInlineMessageID and buffer:' + this._buffer.toString('hex')); } this.__readChat_instance(); if ((this.flags & (1 << 0)) !== 0) { this.__readData(); } if ((this.flags & (1 << 1)) !== 0) { this.__readGame_short_name(); } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeQuery_id = function __writeQuery_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'query_id', this.query_id); } this.writeLong(this.query_id); }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writeChat_instance = function __writeChat_instance() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'chat_instance', this.chat_instance); } this.writeLong(this.chat_instance); }; this.__writeData = function __writeData() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'data', this.data.toString('hex')); } this.writeBytes(this.data); }; this.__writeGame_short_name = function __writeGame_short_name() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'game_short_name', this.game_short_name); } this.writeString(this.game_short_name); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readQuery_id = function __readQuery_id() { this.query_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'query_id', this.query_id, this._readOffset); } }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readChat_instance = function __readChat_instance() { this.chat_instance = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'chat_instance', this.chat_instance, this._readOffset); } }; this.__readData = function __readData() { this.data = this.readBytes(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'data', this.data.toString('hex'), this._readOffset); } }; this.__readGame_short_name = function __readGame_short_name() { this.game_short_name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'game_short_name', this.game_short_name, this._readOffset); } }; }::false inlineBotSwitchPM::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '9f62203c'; this._typeName = "Telegram.type.InlineBotSwitchPM"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeText(); this.__writeStart_param(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readText(); this.__readStart_param(); return this; }; this.__writeText = function __writeText() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'text', this.text); } this.writeString(this.text); }; this.__writeStart_param = function __writeStart_param() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'start_param', this.start_param); } this.writeString(this.start_param); }; this.__readText = function __readText() { this.text = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'text', this.text, this._readOffset); } }; this.__readStart_param = function __readStart_param() { this.start_param = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'start_param', this.start_param, this._readOffset); } }; }::false messages.peerDialogs::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '54c37133'; this._typeName = "Telegram.type.messages.PeerDialogs"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var dialogsBytes = this.dialogs.serialize({isBare: false}); this._writeBytes(dialogsBytes); var messagesBytes = this.messages.serialize({isBare: false}); this._writeBytes(messagesBytes); var chatsBytes = this.chats.serialize({isBare: false}); this._writeBytes(chatsBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); var stateBytes = this.state.serialize({isBare: false}); this._writeBytes(stateBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Dialog', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.dialogs = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Message', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.messages = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Chat', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.chats = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', updates_State, bytes.toString('hex'), 'updates_State'); } var updates_State = this.constructor.requireTypeFromBuffer(bytes); if (updates_State) { var obj = new updates_State({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.state = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type updates_State and buffer:' + this._buffer.toString('hex')); } return this; }; }::false topPeer::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '5bc0cded'; this._typeName = "Telegram.type.TopPeer"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var peerBytes = this.peer.serialize({isBare: false}); this._writeBytes(peerBytes); this.__writeRating(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Peer, bytes.toString('hex'), 'Peer'); } var Peer = this.constructor.requireTypeFromBuffer(bytes); if (Peer) { var obj = new Peer({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.peer = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Peer and buffer:' + this._buffer.toString('hex')); } this.__readRating(); return this; }; this.__writeRating = function __writeRating() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'rating', this.rating); } this.writeDouble(this.rating); }; this.__readRating = function __readRating() { this.rating = this.readDouble(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'rating', this.rating, this._readOffset); } }; }::false topPeerCategoryBotsPM::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '5b1b66ab'; this._typeName = "Telegram.type.TopPeerCategoryBotsPM"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false topPeerCategoryBotsInline::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'e2778614'; this._typeName = "Telegram.type.TopPeerCategoryBotsInline"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false topPeerCategoryCorrespondents::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'edb73706'; this._typeName = "Telegram.type.TopPeerCategoryCorrespondents"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false topPeerCategoryGroups::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '4aa117bd'; this._typeName = "Telegram.type.TopPeerCategoryGroups"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false topPeerCategoryChannels::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '28961d16'; this._typeName = "Telegram.type.TopPeerCategoryChannels"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false topPeerCategoryPeers::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '914283fb'; this._typeName = "Telegram.type.TopPeerCategoryPeers"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var categoryBytes = this.category.serialize({isBare: false}); this._writeBytes(categoryBytes); this.__writeCount(); var peersBytes = this.peers.serialize({isBare: false}); this._writeBytes(peersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', TopPeerCategory, bytes.toString('hex'), 'TopPeerCategory'); } var TopPeerCategory = this.constructor.requireTypeFromBuffer(bytes); if (TopPeerCategory) { var obj = new TopPeerCategory({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.category = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type TopPeerCategory and buffer:' + this._buffer.toString('hex')); } this.__readCount(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'TopPeer', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.peers = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeCount = function __writeCount() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'count', this.count); } this.writeInt(this.count); }; this.__readCount = function __readCount() { this.count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'count', this.count, this._readOffset); } }; }::false contacts.topPeersNotModified::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'f56e26de'; this._typeName = "Telegram.type.contacts.TopPeersNotModified"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false contacts.topPeers::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a872b770'; this._typeName = "Telegram.type.contacts.TopPeers"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var categoriesBytes = this.categories.serialize({isBare: false}); this._writeBytes(categoriesBytes); var chatsBytes = this.chats.serialize({isBare: false}); this._writeBytes(chatsBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'TopPeerCategoryPeers', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.categories = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Chat', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.chats = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false messageEntityMentionName::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '58ca2d35'; this._typeName = "Telegram.type.MessageEntityMentionName"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeOffset(); this.__writeLength(); this.__writeUser_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readOffset(); this.__readLength(); this.__readUser_id(); return this; }; this.__writeOffset = function __writeOffset() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'offset', this.offset); } this.writeInt(this.offset); }; this.__writeLength = function __writeLength() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'length', this.length); } this.writeInt(this.length); }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__readOffset = function __readOffset() { this.offset = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'offset', this.offset, this._readOffset); } }; this.__readLength = function __readLength() { this.length = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'length', this.length, this._readOffset); } }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; }::false inputMessageEntityMentionName::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c9688e20'; this._typeName = "Telegram.type.InputMessageEntityMentionName"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeOffset(); this.__writeLength(); var user_idBytes = this.user_id.serialize({isBare: false}); this._writeBytes(user_idBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readOffset(); this.__readLength(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputUser, bytes.toString('hex'), 'InputUser'); } var InputUser = this.constructor.requireTypeFromBuffer(bytes); if (InputUser) { var obj = new InputUser({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.user_id = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputUser and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeOffset = function __writeOffset() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'offset', this.offset); } this.writeInt(this.offset); }; this.__writeLength = function __writeLength() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'length', this.length); } this.writeInt(this.length); }; this.__readOffset = function __readOffset() { this.offset = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'offset', this.offset, this._readOffset); } }; this.__readLength = function __readLength() { this.length = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'length', this.length, this._readOffset); } }; }::false inputMessagesFilterChatPhotos::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'b8ec203a'; this._typeName = "Telegram.type.InputMessagesFilterChatPhotos"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false updateReadChannelOutbox::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c7c9d625'; this._typeName = "Telegram.type.UpdateReadChannelOutbox"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeChannel_id(); this.__writeMax_id(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readChannel_id(); this.__readMax_id(); return this; }; this.__writeChannel_id = function __writeChannel_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'channel_id', this.channel_id); } this.writeInt(this.channel_id); }; this.__writeMax_id = function __writeMax_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'max_id', this.max_id); } this.writeInt(this.max_id); }; this.__readChannel_id = function __readChannel_id() { this.channel_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'channel_id', this.channel_id, this._readOffset); } }; this.__readMax_id = function __readMax_id() { this.max_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'max_id', this.max_id, this._readOffset); } }; }::false updateDraftMessage::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '69b92bee'; this._typeName = "Telegram.type.UpdateDraftMessage"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var peerBytes = this.peer.serialize({isBare: false}); this._writeBytes(peerBytes); var draftBytes = this.draft.serialize({isBare: false}); this._writeBytes(draftBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Peer, bytes.toString('hex'), 'Peer'); } var Peer = this.constructor.requireTypeFromBuffer(bytes); if (Peer) { var obj = new Peer({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.peer = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Peer and buffer:' + this._buffer.toString('hex')); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', DraftMessage, bytes.toString('hex'), 'DraftMessage'); } var DraftMessage = this.constructor.requireTypeFromBuffer(bytes); if (DraftMessage) { var obj = new DraftMessage({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.draft = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type DraftMessage and buffer:' + this._buffer.toString('hex')); } return this; }; }::false draftMessageEmpty::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c5ae4bba'; this._typeName = "Telegram.type.DraftMessageEmpty"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false draftMessage::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '1f718efd'; this._typeName = "Telegram.type.DraftMessage"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.no_webpage ? (this.flags | 2) : (this.flags & ~2); this.flags = this.reply_to_msg_id !== null ? (this.flags | 1) : (this.flags & ~1); this.flags = this.entities !== null ? (this.flags | 8) : (this.flags & ~8); this.__writeFlags(); if (this.reply_to_msg_id) { this.__writeReply_to_msg_id(); } this.__writeMessage(); if (this.entities) { var entitiesBytes = this.entities.serialize({isBare: false}); this._writeBytes(entitiesBytes); } this.__writeDate(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 1)) !== 0) { this.__readNo_webpage(); } if ((this.flags & (1 << 0)) !== 0) { this.__readReply_to_msg_id(); } this.__readMessage(); if ((this.flags & (1 << 3)) !== 0) { var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'MessageEntity', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.entities = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } } this.__readDate(); return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeReply_to_msg_id = function __writeReply_to_msg_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'reply_to_msg_id', this.reply_to_msg_id); } this.writeInt(this.reply_to_msg_id); }; this.__writeMessage = function __writeMessage() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'message', this.message); } this.writeString(this.message); }; this.__writeDate = function __writeDate() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'date', this.date); } this.writeInt(this.date); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readNo_webpage = function __readNo_webpage() { this.no_webpage = true; if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'no_webpage', this.no_webpage, this._readOffset); } }; this.__readReply_to_msg_id = function __readReply_to_msg_id() { this.reply_to_msg_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'reply_to_msg_id', this.reply_to_msg_id, this._readOffset); } }; this.__readMessage = function __readMessage() { this.message = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'message', this.message, this._readOffset); } }; this.__readDate = function __readDate() { this.date = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'date', this.date, this._readOffset); } }; }::false messageActionHistoryClear::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '04b6ba9f'; this._typeName = "Telegram.type.MessageActionHistoryClear"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false messages.featuredStickersNotModified::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'cfe3ed04'; this._typeName = "Telegram.type.messages.FeaturedStickersNotModified"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false messages.featuredStickers::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'e5889df8'; this._typeName = "Telegram.type.messages.FeaturedStickers"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeHash(); var setsBytes = this.sets.serialize({isBare: false}); this._writeBytes(setsBytes); var unreadBytes = this.unread.serialize({isBare: false}); this._writeBytes(unreadBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readHash(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'StickerSetCovered', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.sets = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'long', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.unread = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeHash = function __writeHash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'hash', this.hash); } this.writeInt(this.hash); }; this.__readHash = function __readHash() { this.hash = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'hash', this.hash, this._readOffset); } }; }::false updateReadFeaturedStickers::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '42271d57'; this._typeName = "Telegram.type.UpdateReadFeaturedStickers"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false messages.recentStickersNotModified::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '90f8170b'; this._typeName = "Telegram.type.messages.RecentStickersNotModified"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false messages.recentStickers::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '7009e25c'; this._typeName = "Telegram.type.messages.RecentStickers"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeHash(); var stickersBytes = this.stickers.serialize({isBare: false}); this._writeBytes(stickersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readHash(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Document', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.stickers = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeHash = function __writeHash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'hash', this.hash); } this.writeInt(this.hash); }; this.__readHash = function __readHash() { this.hash = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'hash', this.hash, this._readOffset); } }; }::false updateRecentStickers::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '202c429a'; this._typeName = "Telegram.type.UpdateRecentStickers"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false messages.archivedStickers::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'c8a9cb4f'; this._typeName = "Telegram.type.messages.ArchivedStickers"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeCount(); var setsBytes = this.sets.serialize({isBare: false}); this._writeBytes(setsBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readCount(); var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'StickerSetCovered', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.sets = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeCount = function __writeCount() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'count', this.count); } this.writeInt(this.count); }; this.__readCount = function __readCount() { this.count = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'count', this.count, this._readOffset); } }; }::false messages.stickerSetInstallResultSuccess::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '28166438'; this._typeName = "Telegram.type.messages.StickerSetInstallResultSuccess"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false messages.stickerSetInstallResultArchive::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'a810e435'; this._typeName = "Telegram.type.messages.StickerSetInstallResultArchive"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var setsBytes = this.sets.serialize({isBare: false}); this._writeBytes(setsBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'StickerSetCovered', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.sets = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false stickerSetCovered::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'd2a51064'; this._typeName = "Telegram.type.StickerSetCovered"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var setBytes = this.set.serialize({isBare: false}); this._writeBytes(setBytes); var coverBytes = this.cover.serialize({isBare: false}); this._writeBytes(coverBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', StickerSet, bytes.toString('hex'), 'StickerSet'); } var StickerSet = this.constructor.requireTypeFromBuffer(bytes); if (StickerSet) { var obj = new StickerSet({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.set = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type StickerSet and buffer:' + this._buffer.toString('hex')); } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Document, bytes.toString('hex'), 'Document'); } var Document = this.constructor.requireTypeFromBuffer(bytes); if (Document) { var obj = new Document({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.cover = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Document and buffer:' + this._buffer.toString('hex')); } return this; }; }::false updateConfig::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '06dd29a2'; this._typeName = "Telegram.type.UpdateConfig"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false updatePtsChanged::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '8f675433'; this._typeName = "Telegram.type.UpdatePtsChanged"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputMediaPhotoExternal::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '184f5fb5'; this._typeName = "Telegram.type.InputMediaPhotoExternal"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUrl(); this.__writeCaption(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUrl(); this.__readCaption(); return this; }; this.__writeUrl = function __writeUrl() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'url', this.url); } this.writeString(this.url); }; this.__writeCaption = function __writeCaption() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'caption', this.caption); } this.writeString(this.caption); }; this.__readUrl = function __readUrl() { this.url = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'url', this.url, this._readOffset); } }; this.__readCaption = function __readCaption() { this.caption = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'caption', this.caption, this._readOffset); } }; }::false inputMediaDocumentExternal::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '7c60e9e5'; this._typeName = "Telegram.type.InputMediaDocumentExternal"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeUrl(); this.__writeCaption(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readUrl(); this.__readCaption(); return this; }; this.__writeUrl = function __writeUrl() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'url', this.url); } this.writeString(this.url); }; this.__writeCaption = function __writeCaption() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'caption', this.caption); } this.writeString(this.caption); }; this.__readUrl = function __readUrl() { this.url = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'url', this.url, this._readOffset); } }; this.__readCaption = function __readCaption() { this.caption = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'caption', this.caption, this._readOffset); } }; }::false stickerSetMultiCovered::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '1be50734'; this._typeName = "Telegram.type.StickerSetMultiCovered"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var setBytes = this.set.serialize({isBare: false}); this._writeBytes(setBytes); var coversBytes = this.covers.serialize({isBare: false}); this._writeBytes(coversBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', StickerSet, bytes.toString('hex'), 'StickerSet'); } var StickerSet = this.constructor.requireTypeFromBuffer(bytes); if (StickerSet) { var obj = new StickerSet({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.set = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type StickerSet and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'Document', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.covers = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false maskCoords::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'b2dbd6ae'; this._typeName = "Telegram.type.MaskCoords"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeN(); this.__writeX(); this.__writeY(); this.__writeZoom(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readN(); this.__readX(); this.__readY(); this.__readZoom(); return this; }; this.__writeN = function __writeN() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'n', this.n); } this.writeInt(this.n); }; this.__writeX = function __writeX() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'x', this.x); } this.writeDouble(this.x); }; this.__writeY = function __writeY() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'y', this.y); } this.writeDouble(this.y); }; this.__writeZoom = function __writeZoom() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'zoom', this.zoom); } this.writeDouble(this.zoom); }; this.__readN = function __readN() { this.n = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'n', this.n, this._readOffset); } }; this.__readX = function __readX() { this.x = this.readDouble(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'x', this.x, this._readOffset); } }; this.__readY = function __readY() { this.y = this.readDouble(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'y', this.y, this._readOffset); } }; this.__readZoom = function __readZoom() { this.zoom = this.readDouble(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'zoom', this.zoom, this._readOffset); } }; }::false documentAttributeHasStickers::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'f7d20198'; this._typeName = "Telegram.type.DocumentAttributeHasStickers"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false inputStickeredMediaPhoto::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '5721994a'; this._typeName = "Telegram.type.InputStickeredMediaPhoto"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var idBytes = this.id.serialize({isBare: false}); this._writeBytes(idBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputPhoto, bytes.toString('hex'), 'InputPhoto'); } var InputPhoto = this.constructor.requireTypeFromBuffer(bytes); if (InputPhoto) { var obj = new InputPhoto({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.id = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputPhoto and buffer:' + this._buffer.toString('hex')); } return this; }; }::false inputStickeredMediaDocument::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '5b863804'; this._typeName = "Telegram.type.InputStickeredMediaDocument"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var idBytes = this.id.serialize({isBare: false}); this._writeBytes(idBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputDocument, bytes.toString('hex'), 'InputDocument'); } var InputDocument = this.constructor.requireTypeFromBuffer(bytes); if (InputDocument) { var obj = new InputDocument({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.id = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputDocument and buffer:' + this._buffer.toString('hex')); } return this; }; }::false game::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '3b65f9bd'; this._typeName = "Telegram.type.Game"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.document !== null ? (this.flags | 1) : (this.flags & ~1); this.__writeFlags(); this.__writeId(); this.__writeAccess_hash(); this.__writeShort_name(); this.__writeTitle(); this.__writeDescription(); var photoBytes = this.photo.serialize({isBare: false}); this._writeBytes(photoBytes); if (this.document) { var documentBytes = this.document.serialize({isBare: false}); this._writeBytes(documentBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); this.__readId(); this.__readAccess_hash(); this.__readShort_name(); this.__readTitle(); this.__readDescription(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Photo, bytes.toString('hex'), 'Photo'); } var Photo = this.constructor.requireTypeFromBuffer(bytes); if (Photo) { var obj = new Photo({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.photo = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Photo and buffer:' + this._buffer.toString('hex')); } if ((this.flags & (1 << 0)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Document, bytes.toString('hex'), 'Document'); } var Document = this.constructor.requireTypeFromBuffer(bytes); if (Document) { var obj = new Document({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.document = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Document and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeLong(this.id); }; this.__writeAccess_hash = function __writeAccess_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'access_hash', this.access_hash); } this.writeLong(this.access_hash); }; this.__writeShort_name = function __writeShort_name() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'short_name', this.short_name); } this.writeString(this.short_name); }; this.__writeTitle = function __writeTitle() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'title', this.title); } this.writeString(this.title); }; this.__writeDescription = function __writeDescription() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'description', this.description); } this.writeString(this.description); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; this.__readId = function __readId() { this.id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readAccess_hash = function __readAccess_hash() { this.access_hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'access_hash', this.access_hash, this._readOffset); } }; this.__readShort_name = function __readShort_name() { this.short_name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'short_name', this.short_name, this._readOffset); } }; this.__readTitle = function __readTitle() { this.title = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'title', this.title, this._readOffset); } }; this.__readDescription = function __readDescription() { this.description = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'description', this.description, this._readOffset); } }; }::false inputBotInlineResultGame::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'f217a44f'; this._typeName = "Telegram.type.InputBotInlineResultGame"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeShort_name(); var send_messageBytes = this.send_message.serialize({isBare: false}); this._writeBytes(send_messageBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readShort_name(); var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputBotInlineMessage, bytes.toString('hex'), 'InputBotInlineMessage'); } var InputBotInlineMessage = this.constructor.requireTypeFromBuffer(bytes); if (InputBotInlineMessage) { var obj = new InputBotInlineMessage({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.send_message = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputBotInlineMessage and buffer:' + this._buffer.toString('hex')); } return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeString(this.id); }; this.__writeShort_name = function __writeShort_name() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'short_name', this.short_name); } this.writeString(this.short_name); }; this.__readId = function __readId() { this.id = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readShort_name = function __readShort_name() { this.short_name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'short_name', this.short_name, this._readOffset); } }; }::false inputBotInlineMessageGame::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '6458424b'; this._typeName = "Telegram.type.InputBotInlineMessageGame"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.flags = 0; this.flags = this.reply_markup !== null ? (this.flags | 4) : (this.flags & ~4); this.__writeFlags(); if (this.reply_markup) { var reply_markupBytes = this.reply_markup.serialize({isBare: false}); this._writeBytes(reply_markupBytes); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readFlags(); if ((this.flags & (1 << 2)) !== 0) { var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', ReplyMarkup, bytes.toString('hex'), 'ReplyMarkup'); } var ReplyMarkup = this.constructor.requireTypeFromBuffer(bytes); if (ReplyMarkup) { var obj = new ReplyMarkup({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.reply_markup = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type ReplyMarkup and buffer:' + this._buffer.toString('hex')); } } return this; }; this.__writeFlags = function __writeFlags() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'flags', this.flags); } this.writeInt(this.flags); }; this.__readFlags = function __readFlags() { this.flags = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'flags', this.flags, this._readOffset); } }; }::false sendMessageGamePlayAction::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '488f6add'; this._typeName = "Telegram.type.SendMessageGamePlayAction"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } return this; }; }::false messageMediaGame::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '0890b1fd'; this._typeName = "Telegram.type.MessageMediaGame"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var gameBytes = this.game.serialize({isBare: false}); this._writeBytes(gameBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', Game, bytes.toString('hex'), 'Game'); } var Game = this.constructor.requireTypeFromBuffer(bytes); if (Game) { var obj = new Game({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.game = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Game and buffer:' + this._buffer.toString('hex')); } return this; }; }::false inputMediaGame::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'f3433fd3'; this._typeName = "Telegram.type.InputMediaGame"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var idBytes = this.id.serialize({isBare: false}); this._writeBytes(idBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputGame, bytes.toString('hex'), 'InputGame'); } var InputGame = this.constructor.requireTypeFromBuffer(bytes); if (InputGame) { var obj = new InputGame({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.id = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputGame and buffer:' + this._buffer.toString('hex')); } return this; }; }::false inputGameID::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '773e2c03'; this._typeName = "Telegram.type.InputGameID"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeId(); this.__writeAccess_hash(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readId(); this.__readAccess_hash(); return this; }; this.__writeId = function __writeId() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'id', this.id); } this.writeLong(this.id); }; this.__writeAccess_hash = function __writeAccess_hash() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'access_hash', this.access_hash); } this.writeLong(this.access_hash); }; this.__readId = function __readId() { this.id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'id', this.id, this._readOffset); } }; this.__readAccess_hash = function __readAccess_hash() { this.access_hash = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'access_hash', this.access_hash, this._readOffset); } }; }::false inputGameShortName::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '0ae831c3'; this._typeName = "Telegram.type.InputGameShortName"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var bot_idBytes = this.bot_id.serialize({isBare: false}); this._writeBytes(bot_idBytes); this.__writeShort_name(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var bytes = this._buffer.slice(this.getReadOffset(), this.getReadOffset() + 4); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('Retrieve type %s reading the bytes %s %s', InputUser, bytes.toString('hex'), 'InputUser'); } var InputUser = this.constructor.requireTypeFromBuffer(bytes); if (InputUser) { var obj = new InputUser({buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.bot_id = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type InputUser and buffer:' + this._buffer.toString('hex')); } this.__readShort_name(); return this; }; this.__writeShort_name = function __writeShort_name() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'short_name', this.short_name); } this.writeString(this.short_name); }; this.__readShort_name = function __readShort_name() { this.short_name = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'short_name', this.short_name, this._readOffset); } }; }::false keyboardButtonGame::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'cf1cf450'; this._typeName = "Telegram.type.KeyboardButtonGame"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeText(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readText(); return this; }; this.__writeText = function __writeText() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'text', this.text); } this.writeString(this.text); }; this.__readText = function __readText() { this.text = this.readString(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'text', this.text, this._readOffset); } }; }::false messageActionGameScore::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '7628a792'; this._typeName = "Telegram.type.MessageActionGameScore"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writeGame_id(); this.__writeScore(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readGame_id(); this.__readScore(); return this; }; this.__writeGame_id = function __writeGame_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'game_id', this.game_id); } this.writeLong(this.game_id); }; this.__writeScore = function __writeScore() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'score', this.score); } this.writeInt(this.score); }; this.__readGame_id = function __readGame_id() { this.game_id = this.readLong(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'game_id', this.game_id, this._readOffset); } }; this.__readScore = function __readScore() { this.score = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'score', this.score, this._readOffset); } }; }::false highScore::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = 'd0fcff58'; this._typeName = "Telegram.type.HighScore"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } this.__writePos(); this.__writeUser_id(); this.__writeScore(); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } this.__readPos(); this.__readUser_id(); this.__readScore(); return this; }; this.__writePos = function __writePos() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'pos', this.pos); } this.writeInt(this.pos); }; this.__writeUser_id = function __writeUser_id() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'user_id', this.user_id); } this.writeInt(this.user_id); }; this.__writeScore = function __writeScore() { if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('write \'%s\' = %s', 'score', this.score); } this.writeInt(this.score); }; this.__readPos = function __readPos() { this.pos = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'pos', this.pos, this._readOffset); } }; this.__readUser_id = function __readUser_id() { this.user_id = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'user_id', this.user_id, this._readOffset); } }; this.__readScore = function __readScore() { this.score = this.readInt(); if(this.constructor.logger.isDebugEnabled()) { this.constructor.logger.debug('read \'%s\' = %s, offset = %s', 'score', this.score, this._readOffset); } }; }::false messages.highScores::[object Object]::function anonymous(options /**/) { var opts = options ? options : {}; this.constructor.util._extend(this, opts.props); this.constructor.super_.call(this, opts.buffer, opts.offset); this._typeId = '99fd3b9a'; this._typeName = "Telegram.type.messages.HighScores"; this.serialize = function serialize (options) { if (!this.constructor.super_.prototype.serialize.call(this, options)) { return this.retrieveBuffer(); } var scoresBytes = this.scores.serialize({isBare: false}); this._writeBytes(scoresBytes); var usersBytes = this.users.serialize({isBare: false}); this._writeBytes(usersBytes); return this.retrieveBuffer(); }; this.deserialize = function deserialize (options) { if (!this.constructor.super_.prototype.deserialize.call(this, options)) { return false; } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'HighScore', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.scores = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } var Vector = this.constructor.requireTypeByName('Vector'); if (Vector) { var obj = new Vector({module: 'Telegram.type', type: 'User', buffer: this._buffer, offset: this.getReadOffset()}).deserialize({isBare: false}); if (obj) { var typeName = obj.getTypeName() ? obj.getTypeName().substring(obj.getTypeName().lastIndexOf('.') + 1) : ''; this.users = (typeName == 'BoolTrue') ? true : (typeName == 'BoolFalse') ? false : obj; this._readOffset += obj.getReadOffset(); } } else { throw new TypeError('Unable to retrieve the Type constructor for the type Vector and buffer:' + this._buffer.toString('hex')); } return this; }; }::false invokeAfterMsg::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true invokeAfterMsgs::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true auth.checkPhone::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true auth.sendCode::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true auth.signUp::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true auth.signIn::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true auth.logOut::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true auth.resetAuthorizations::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true auth.sendInvites::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true auth.exportAuthorization::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true auth.importAuthorization::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true auth.bindTempAuthKey::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.registerDevice::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.unregisterDevice::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.updateNotifySettings::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.getNotifySettings::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.resetNotifySettings::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.updateProfile::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.updateStatus::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.getWallPapers::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.reportPeer::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true users.getUsers::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true users.getFullUser::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true contacts.getStatuses::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true contacts.getContacts::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true contacts.importContacts::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true contacts.deleteContact::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true contacts.deleteContacts::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true contacts.block::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true contacts.unblock::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true contacts.getBlocked::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true contacts.exportCard::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true contacts.importCard::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getMessages::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getDialogs::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getHistory::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.search::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.readHistory::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.deleteHistory::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.deleteMessages::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.receivedMessages::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.setTyping::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.sendMessage::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.sendMedia::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.forwardMessages::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.reportSpam::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.hideReportSpam::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getPeerSettings::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getChats::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getFullChat::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.editChatTitle::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.editChatPhoto::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.addChatUser::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.deleteChatUser::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.createChat::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true updates.getState::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true updates.getDifference::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true photos.updateProfilePhoto::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true photos.uploadProfilePhoto::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true photos.deletePhotos::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true upload.saveFilePart::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true upload.getFile::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true help.getConfig::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true help.getNearestDc::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true help.getAppUpdate::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true help.saveAppLog::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true help.getInviteText::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true photos.getUserPhotos::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.forwardMessage::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getDhConfig::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.requestEncryption::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.acceptEncryption::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.discardEncryption::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.setEncryptedTyping::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.readEncryptedHistory::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.sendEncrypted::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.sendEncryptedFile::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.sendEncryptedService::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.receivedQueue::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true upload.saveBigFilePart::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true initConnection::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true help.getSupport::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.readMessageContents::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.checkUsername::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.updateUsername::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true contacts.search::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.getPrivacy::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.setPrivacy::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.deleteAccount::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.getAccountTTL::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.setAccountTTL::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true invokeWithLayer::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true contacts.resolveUsername::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.sendChangePhoneCode::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.changePhone::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getAllStickers::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.updateDeviceLocked::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true auth.importBotAuthorization::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getWebPagePreview::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.getAuthorizations::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.resetAuthorization::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.getPassword::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.getPasswordSettings::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.updatePasswordSettings::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true auth.checkPassword::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true auth.requestPasswordRecovery::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true auth.recoverPassword::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true invokeWithoutUpdates::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.exportChatInvite::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.checkChatInvite::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.importChatInvite::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getStickerSet::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.installStickerSet::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.uninstallStickerSet::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.startBot::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true help.getAppChangelog::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getMessagesViews::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.readHistory::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.deleteMessages::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.deleteUserHistory::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.reportSpam::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.getMessages::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.getParticipants::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.getParticipant::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.getChannels::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.getFullChannel::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.createChannel::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.editAbout::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.editAdmin::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.editTitle::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.editPhoto::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.checkUsername::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.updateUsername::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.joinChannel::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.leaveChannel::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.inviteToChannel::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.kickFromChannel::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.exportInvite::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.deleteChannel::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true updates.getChannelDifference::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.toggleChatAdmins::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.editChatAdmin::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.migrateChat::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.searchGlobal::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true help.getTermsOfService::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.reorderStickerSets::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getDocumentByHash::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.searchGifs::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getSavedGifs::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.saveGif::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getInlineBotResults::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.setInlineBotResults::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.sendInlineBotResult::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.toggleInvites::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.exportMessageLink::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.toggleSignatures::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.updatePinnedMessage::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true auth.resendCode::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true auth.cancelCode::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getMessageEditData::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.editMessage::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.editInlineBotMessage::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getBotCallbackAnswer::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.setBotCallbackAnswer::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true contacts.getTopPeers::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true contacts.resetTopPeerRating::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getPeerDialogs::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.saveDraft::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getAllDrafts::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getFeaturedStickers::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.readFeaturedStickers::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getRecentStickers::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.saveRecentSticker::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.clearRecentStickers::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getArchivedStickers::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.sendConfirmPhoneCode::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true account.confirmPhone::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true channels.getAdminedPublicChannels::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getMaskStickers::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getAttachedStickers::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true auth.dropTempAuthKeys::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.setGameScore::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.setInlineGameScore::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getGameHighScores::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true messages.getInlineGameHighScores::[object Object]::function anonymous(options /**/) { var self = arguments.callee; var callback = options.callback; var channel = options.channel; if (!channel) { var msg = 'The \'channel\' option is missing, it\'s mandatory'; self.logger.error(msg); if(callback) { callback(new TypeError(msg)); } return; } var reqPayload = new self.Type(options); channel.callMethod(reqPayload, callback); }::true