function formatData(data) { return { userID: utils.formatID(data.uid.toString()), photoUrl: data.photo, indexRank: data.index_rank, name: data.text, isVerified: data.is_verified, profileUrl: data.path, category: data.category, score: data.score, type: data.type }; }
net.upload("post","/admin/user",query).then(function (data) { if(data.code==200) { context.state.user.list.forEach(function (obj) { if(obj._id==data.data._id) { obj.name=data.data.name; obj.photo=data.data.photo; obj.state=data.data.state; } }) } return data })
utils.handleRatelimit(bot, 'sendGame', this); return bot.sendPhoto(USERID, FILE_PATH).then(resp => { FILE_ID = resp.photo[0].file_id; return bot.sendMessage(USERID, 'chat'); }).then(resp => {
return bot.sendPhoto(USERID, photo).then(resp => { assert.ok(is.object(resp)); assert.ok(is.array(resp.photo)); photoId = resp.photo[0].file_id; }); }); return bot.sendPhoto(USERID, photo).then(resp => { assert.ok(is.object(resp)); assert.ok(is.array(resp.photo)); }); }); return bot.sendPhoto(USERID, photo).then(resp => { assert.ok(is.object(resp)); assert.ok(is.array(resp.photo)); }); }); return bot.sendPhoto(USERID, photo).then(resp => { assert.ok(is.object(resp)); assert.ok(is.array(resp.photo)); }); }); return bot.sendPhoto(USERID, photo).then(resp => { assert.ok(is.object(resp)); assert.ok(is.array(resp.photo)); });
.then(u => { user = u.response; activity.photo.objectId = photo.objectId; activity.fromUser.objectId = user.objectId; return rest.create(config, nobody, 'TestActivity', activity); }) .then(() => { queryWhere.photo.objectId = photo.objectId; return rest.find( config, expect(results.length).toEqual(1); expect(typeof results[0].objectId).toEqual('string'); expect(typeof results[0].photo).toEqual('object'); expect(typeof results[0].fromUser).toEqual('object'); expect(typeof results[0].fromUser.username).toEqual('string');
options(form, opt = {}) { const photo = opt.photo || {}; const need = opt.need || {}; form.title = opt.title; form.description = opt.description; form.payload = opt.payload; form.provider_token = opt.providerToken; form.start_parameter = opt.startParameter; form.currency = opt.currency; form.send_phone_number_to_provider = opt.sendPhoneNumberToProvider; form.send_email_to_provider = opt.sendEmailToProvider; form.prices = JSON.stringify(opt.prices); form.provider_data = JSON.stringify(opt.providerData); if (photo.url) form.photo_url = photo.url; if (Number.isInteger(photo.size)) form.photo_size = photo.size; if (Number.isInteger(photo.width)) form.photo_width = photo.width; if (Number.isInteger(photo.height)) form.photo_height = photo.height; if (need.name === true) form.need_name = need.name; if (need.phoneNumber === true) form.need_phone_number = need.phoneNumber; if (need.email === true) form.need_email = need.email; if (need.shippingAddress === true) form.need_shipping_address = need.shippingAddress; if (opt.isFlexible === true) form.is_flexible = opt.isFlexible; return form; }
getBytes() { return Buffer.concat([ Buffer.from("c9572ef1","hex"), this.channel.getBytes(), this.photo.getBytes(), ]) }
/** * @param {String} W3ID * @returns {Promise<string>} */ async function getPhotoByW3ID(W3ID) { return urls.photo + `/${W3ID}?def=avatar`; }
async function postPhoto(session, media, caption){ try { await Client.Upload.photo(session, media) .then(function(upload) { return Client.Media.configurePhoto(session, upload.params.uploadId, caption); }) return true; }catch(e){ return e; } }
getBytes() { return Buffer.concat([ Buffer.from("8ef5c2df","hex"), struct.pack('<I', (this.participants === undefined || this.participants === false || this.participants === null) ? 0 : 16 | (this.megagroup === undefined || this.megagroup === false || this.megagroup === null) ? 0 : 8 | (this.public === undefined || this.public === false || this.public === null) ? 0 : 4 | (this.broadcast === undefined || this.broadcast === false || this.broadcast === null) ? 0 : 2 | (this.channel === undefined || this.channel === false || this.channel === null) ? 0 : 1), TLObject.serializeBytes(this.title), this.photo.getBytes(), struct.pack('<i', this.participantsCount), (this.participants === undefined || this.participants === false || this.participants ===null) ? Buffer.alloc(0) :Buffer.concat([Buffer.from('15c4b51c', 'hex'),struct.pack('<i', this.participants.length),Buffer.concat(this.participants.map(x => x.getBytes()))]), ]) }
getBytes() { return Buffer.concat([ Buffer.from("0c3b3195","hex"), struct.pack('<i', this.userId), struct.pack('<i', this.date), this.photo.getBytes(), this.previous ? 0xb5757299 : 0x379779bc, ]) }
getBytes() { return Buffer.concat([ Buffer.from("a813cb7f","hex"), this.photo.getBytes(), ]) }
async function postPhoto(session, media, caption){ try { await Client.Upload.photo(session, media) .then(function(upload) { return Client.Media.configurePhoto(session, upload.params.uploadId, caption); }) return true; }catch(e){ return e; } }