Jump to content
McKay Development

Error: This trade offer is no longer valid.


Recommended Posts

Hello

 

My bot is not running. I send an offer to it and then start it. Trade offer gets accepted but I get the error message "This trade offer is no longer valid."

 

It's happening when retrieving UserDetails:

		if (offer.itemsToGive.length === 0) {

			offer.getUserDetails((err, me, them) => {
				if (typeof (them) !== 'undefined') {
					donator = them.personaName;
					console.log(`donator is: ${donator}`);
				} else { console.log(err); }
			});

because I'm not getting donator's name.

 

 

This is my console.log:

Error: This trade offer is no longer valid.
    at SteamCommunity._checkTradeError (D:\Portable\Birba\node_modules\steamcommunity\components\http.js:144:13)
    at Request._callback (D:\Portable\Birba\node_modules\steamcommunity\components\http.js:52:80)
    at Request.self.callback (D:\Portable\Birba\node_modules\request\request.js:185:22)
    at Request.emit (events.js:182:13)
    at Request.<anonymous> (D:\Portable\Birba\node_modules\request\request.js:1161:10)
    at Request.emit (events.js:182:13)
    at Gunzip.<anonymous> (D:\Portable\Birba\node_modules\request\request.js:1083:12)
    at Object.onceWrapper (events.js:273:13)
    at Gunzip.emit (events.js:187:15)
    at endReadableNT (_stream_readable.js:1094:12)
Donation accepted. Status: accepted.
 

Problem is, I'm posting a comment on bot's profile upon successful incoming donation and if there are offers BEFORE I run the bot, comments are not posted, since there's a check on "donator" and it doesn't return.

 

BUT:

 

If I keep the bot running and then send one more offer, it gets accepted and all is working fine without errors.

 

donator is: roughnecks

 

Donation accepted. Status: accepted.

 

Comment Posted

Link to comment
Share on other sites

I read that in the doc but what's your definition of active? Maybe you mean that it's not a "new" trade offer but when a trade is pending to me is still "active" because I can accept it until it's canceled.

 

So there's no other way to get sender's name for all the trades if I can't keep my bot always running?

Link to comment
Share on other sites

  • 2 weeks later...

manager.on('newOffer', offer => {

if (offer.partner.getSteamID64() === '76561198061492959') {
offer.accept((err, status) => {
if (err) {
console.log(err);
} else {
console.log(`Accepted offer from owner. Status: ${status}.`);
}
});
} else {

if (offer.itemsToGive.length === 0) {

offer.getUserDetails((err, me, them) => {
if (typeof (them) !== 'undefined') {
donator = them.personaName;
//console.log(`donator is: ${donator}`);
} else { console.log('getuserdetails' + err); }
});

offer.accept((err, status) => {

offer.getReceivedItems((err, items) => {
if (typeof (items) !== 'undefined') {
donationnum = items.length;
//console.log(`donationnum is: ${donationnum}`);
} else { console.log('getreceiveditems' + err); }
});

if (err) {
console.log(err);
} else {
console.log(`Donation accepted. Status: ${status}.`);
success = 1;
}
});

setTimeout(postComment, 3000);

} else {
offer.decline(err => {
if (err) {
console.log(err);
} else {
console.log('Offer declined (wanted our items).');
}
});
}
}
});
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...