Jump to content
McKay Development

i thought offer.accept do not work now


Recommended Posts

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

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

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

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

client.chatMessage(offer.partner.getSteamID64(), "Thanks for trade with me");

console.log("Offer accepted");

}

})

} else {

offer.decline(function(err) {

if (err) {

console.log("Unable to decline offer: " + err.message);

} else {

community.checkConfirmations(); // Check for confirmations right after declineing the offer

client.chatMessage(offer.partner.getSteamID64(), "Sorry, I'm not ready to trade with you yet");

console.log("Offer decline");

}

})

}

});

 

 

when i gave my bot one skin,it's can accept.

 

when i take this skin back it's can't work.

it just don't confirmations the offer,but told me Thanks for trade with me,and i can see Offer accepted on console.

same code can work before yestarday,but it can't work now

Link to comment
Share on other sites

Whenever you get an offer you need to confirm it, or the bot does.

 

You can do this by setting up a interval that confirms the confirmations every X seconds, but this method is deprecated I believe, you should now be using;
 

           community.acceptConfirmationForObject(data.identity_secret, offer.id, function(err){
              if(err){
                console.log(err);
                return;
              }

              console.log('Succesfully confirmed the offer.');
            })


Replace with your bots identity secret and the offerid of the sent out offer.

Edit: might of misread it.

Edited by Eradicate
Link to comment
Share on other sites

 

Whenever you get an offer you need to confirm it, or the bot does.

 

You can do this by setting up a interval that confirms the confirmations every X seconds, but this method is deprecated I believe, you should now be using;

 

           community.acceptConfirmationForObject(data.identity_secret, offer.id, function(err){
              if(err){
                console.log(err);
                return;
              }

              console.log('Succesfully confirmed the offer.');
            })


Replace with your bots identity secret and the offerid of the sent out offer.

 

Edit: might of misread it.

 

 

 

thank u my friend, it worked after i replace community.checkConfirmations();  :D 

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