Jump to content
McKay Development

them.escrowDays does not work?


Recommended Posts

console.log('[OFFER] Checking trade hold');

offer.getUserDetails(function(them) { //check for escrow

if (them.escrowDays > 0) {
    offer.decline();
    console.log('[OFFER] Declined - Trade hold');
    tradelog.info('Trade offer #' + offer.id + ' from ' + offer.partner.getSteamID64() + ' declined: trade hold');
    } else {
        //script to check trade contents
    }
});

I have this part in the manager.on('newOffer', function (offer) { part, so them and offer are defined. The error I'm getting is: Cannot property 'escrowDays' of null.

Edited by jafix
Link to comment
Share on other sites

console.log('[OFFER] Checking trade hold');
		
		offer.getUserDetails(function(err, them) { //check for escrow
		if (err) {
			throw err;
		}
		
		if (them.escrowDays != 0) {
			offer.decline();
			console.log('[OFFER] Declined - Trade hold');
			tradelog.info('Trade offer #' + offer.id + ' from ' + offer.partner.getSteamID64() + ' declined: trade hold');
			client.chatMessage(offer.partner.getSteamID64(), "Sorry, we don't accept trade hold");
			} else {
                            //check trade contents
                        }
                    });

This is my script now but my bot accepted an offer resulting in a trade hold, why is that?

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...