Jump to content
McKay Development

Cannot read property 'escrowDays' of undefined


KiTa

Recommended Posts

For some reason I consistently get this error after receiving a trade offer.

steam_bot.js:217
        if (them.escrowDays <= 0) {
                ^

TypeError: Cannot read property 'escrowDays' of undefined
    at /home/teslim/steam-bot/steam_bot.js:217:17
    at Object.exports.makeAnError (/home/teslim/steam-bot/node_modules/steam-tradeoffer-manager/lib/helpers.js:33:4)
    at manager._community.httpRequestGet (/home/teslim/steam-bot/node_modules/steam-tradeoffer-manager/lib/classes/TradeOffer.js:752:12)
    at SteamCommunity._checkCommunityError (/home/teslim/steam-bot/node_modules/steamcommunity/components/http.js:129:3)
    at Request._callback (/home/teslim/steam-bot/node_modules/steamcommunity/components/http.js:51:88)
    at Request.self.callback (/home/teslim/steam-bot/node_modules/request/request.js:187:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (/home/teslim/steam-bot/node_modules/request/request.js:1044:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
Link to comment
Share on other sites


manager.on('newOffer', function(offer) {

console.log("New offer #" + offer.id + " from " + offer.partner.getSteam3RenderedID());

offer.getUserDetails(function(err, me, them) {

if (them.escrowDays <= 0) {

if (offer.partner.getSteamID64() == config.owner) {

offer.accept(function(err) {

if (err) {

console.log("Unable to accept offer: " + err.message);
} else {

community.checkConfirmations(); // Check for confirmations right after accepting the offer
console.log("Offer from master accepted");
}
});
} else if (offer.itemsToGive.length == 0 && !offer.isGlitched()) {

offer.accept(function(err) {

if (err) {

console.log("Unable to accept offer: " + err.message);
} else {

community.checkConfirmations(); // Check for confirmations right after accepting the offer
console.log("Gift from " + offer.partner.getSteamID64() + " accepted");
}
});
} else {

validate(offer, function(accept, report) {

if (accept) {

offer.accept(function(err) {

if (err) {

console.log("Unable to accept offer: " + err.message);
} else {

community.checkConfirmations(); // Check for confirmations right after accepting the offer
console.log("Offer from " + offer.partner.getSteamID64() + " accepted");
}
});
} else if (report) {

console.log("Reporting trade #" + offer.id);
} else {

offer.decline();
}
});
}
} else {

offer.decline();
}
});
});
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...