Jump to content
McKay Development

Zorenko

Member
  • Posts

    13
  • Joined

  • Last visited

Everything posted by Zorenko

  1. So there is no way to change the mail now?
  2. Where can I read the documentation about client.changeEmail
  3. I read the documentation, there is no event associated with sendingOffer
  4. manager.on('newOffer', function(offer) { if (offer.state == 9) { console.log('Offer Sented'); } }); manager.on('sentOfferChanged', function(offer) { if (offer.state == 9) { console.log('Offer Sented'); } }); manager.on('receivedOfferChanged', function(offer) { if (offer.state == 9) { console.log('Offer Sented'); } }); When I send a trade, not a single log does not come
  5. How to get all the skins of their exchange, then to create an exchange with the same skins? let offer = manager.createOffer("https://steamcommunity.com/tradeoffer/new/?partner=149081977&token=Cb2UfEHh"); offer.addMyItems(???????????); offer.send(function(err, status)
  6. https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/blob/master/resources/ETradeOfferState.js If a person received or send trade, he accepted it on the computer, need confirmation on the phone, what is this state?
  7. I need that when the trade was confirmed on the computer, it was canceled and a new one was created, with the same skins My code: manager.on('TradeOfferManager.ETradeOfferState[9]', function(offer, oldState) { let offer = manager.createOffer("https://steamcommunity.com/tradeoffer/new/?partner=149081977&token=Cb2UfEHh"); offer.addMyItems(inventory); offer.send(function(err, status) { if (err) { console.log(err); return; } if (status == 'pending') { // We need to confirm it console.log("Items " + manager.getOffer); console.log(`Offer #${offer.id} sent, but requires confirmation`); community.acceptConfirmationForObject("identitySecret", offer.id, function(err) { if (err) { console.log(err); } else { console.log("Offer confirmed"); } }); } else { console.log(`Offer #${offer.id} sent successfully`); } }); }); When I confirm the exchange on the computer, nothing happens . ETradeOfferState[3] - confirmed trade And another question, how to get things from the trade, then to create a trade with the same things? If ETradeOfferState[offer.state] = ETradeOfferState[9], trade must cancel, I do not know how to make a check offer.state when I get a newOffer or sentOfferChanged
  8. If ETradeOfferState[offer.state] = ETradeOfferState[9], trade must cancel, I do not know how to make a check offer.state when I get a newOffer or sentOfferChanged
  9. I need that when the trade was confirmed on the computer, it was canceled and a new one was created, with the same skins My code: manager.on('TradeOfferManager.ETradeOfferState[9]', function(offer, oldState) { let offer = manager.createOffer("https://steamcommunity.com/tradeoffer/new/?partner=149081977&token=Cb2UfEHh"); offer.addMyItems(inventory); offer.send(function(err, status) { if (err) { console.log(err); return; } if (status == 'pending') { // We need to confirm it console.log("Items " + manager.getOffer); console.log(`Offer #${offer.id} sent, but requires confirmation`); community.acceptConfirmationForObject("identitySecret", offer.id, function(err) { if (err) { console.log(err); } else { console.log("Offer confirmed"); } }); } else { console.log(`Offer #${offer.id} sent successfully`); } }); }); When I confirm the exchange on the computer, nothing happens . ETradeOfferState[3] - confirmed trade And another question, how to get things from the trade, then to create a trade with the same things?
  10. steam.login(logOnOptions, function(err, sessionID, cookies, steamguard) { if (err) { console.log("[Bot] There was an error logging in! Error details: " + err.message); process.exit(1); //terminates program } else { console.log("[Bot] Successfully logged in as " + logOnOptions.accountName); steam.chatLogon(); community.uploadAvatar('https://trinixy.ru/pics5/20180508/uncommon_01.jpg'); manager.setCookies(cookies, function(err) { if (err) { console.log(err); process.exit(1); } }); } steam.startConfirmationChecker(20000, identitySecret); //Auto-confirmation enabled! }); Error: C:\Users\a\Desktop\d>node Donation-Bot.js [Bot] Successfully logged in as john200214 C:\Users\a\node_modules\steamcommunity\components\profile.js:254 callback(new Error("Not Logged In")); ^ TypeError: callback is not a function at SteamCommunity.uploadAvatar (C:\Users\a\node_modules\steamcommunity\components\profile.js:254:3) at C:\Users\a\Desktop\d\Donation-Bot.js:29:13 at SteamCommunity.<anonymous> (C:\Users\a\node_modules\steamcommunity\index.js:202:5) at Request._callback (C:\Users\a\node_modules\steamcommunity\components\http.js:67:15) at Request.self.callback (C:\Users\a\node_modules\request\request.js:185:22) at Request.emit (events.js:189:13) at Request.<anonymous> (C:\Users\a\node_modules\request\request.js:1161:10) at Request.emit (events.js:189:13) at Gunzip.<anonymous> (C:\Users\a\node_modules\request\request.js:1083:12) at Object.onceWrapper (events.js:277:13) C:\Users\a\Desktop\d>pause
  11. I have code SteamCommunity.prototype.uploadAvatar = function(image, format, callback) { if(typeof format === 'function') { callback = format; format = null; } // are we logged in? if (!this.steamID) { callback(new Error("Not Logged In")); return; } var self = this; if(image instanceof Buffer) { doUpload(image); } else if(image.match(/^https?:\/\//)) { this.httpRequestGet({ "uri": image, "encoding": null }, function(err, response, body) { if(err || response.statusCode != 200) { if(callback) { callback(err ? new Error(err.message + " downloading image") : new Error("HTTP error " + response.statusCode + " downloading image")); } return; } if(!format) { format = response.headers['content-type']; } doUpload(body); }, "steamcommunity"); } else { if(!format) { format = image.match(/\.([^\.]+)$/); if(format) { format = format[1]; } } FS.readFile(image, function(err, file) { if(err) { if(callback) { callback(err); } return; } doUpload(file); }) } function doUpload(buffer) { if(!format) { if(callback) { callback(new Error("Unknown image format")); } return; } if(format.match(/^image\//)) { format = format.substring(6); } var filename = ''; var contentType = ''; switch(format.toLowerCase()) { case 'jpg': case 'jpeg': filename = 'avatar.jpg'; contentType = 'image/jpeg'; break; case 'png': filename = 'avatar.png'; contentType = 'image/png'; break; case 'gif': filename = 'avatar.gif'; contentType = 'image/gif'; break; default: if(callback) { callback(new Error("Unknown or invalid image format")); } return; } self.httpRequestPost({ "uri": "https://steamcommunity.com/actions/FileUploader", "formData": { "MAX_FILE_SIZE": buffer.length, "type": "player_avatar_image", "sId": self.steamID.getSteamID64(), "sessionid": self.getSessionID(), "doSub": 1, "json": 1, "avatar": { "value": buffer, "options": { "filename": filename, "contentType": contentType } } }, "json": true }, function(err, response, body) { if(err) { if(callback) { callback(err); } return; } if(body && !body.success && body.message) { if(callback) { callback(new Error(body.message)); } return; } if(response.statusCode != 200) { if(callback) { callback(new Error("HTTP error " + response.statusCode)); } return; } if(!body || !body.success) { if(callback) { callback(new Error("Malformed response")); } return; } if(callback) { callback(null, body.images.full); } }, "steamcommunity"); } }; How to choose a photo and upload it?
×
×
  • Create New...