Jump to content


Photo

i thought offer.accept do not work now

node.js node-steam-tradeoffer-manager

  • Please log in to reply
2 replies to this topic

#1 venfiw

venfiw

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 15 April 2018 - 12:36 PM

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


#2 Eradicate

Eradicate

    Member

  • Member
  • PipPip
  • 25 posts

Posted 16 April 2018 - 02:59 PM

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, 16 April 2018 - 03:00 PM.

  • Dr. McKay and venfiw like this

#3 venfiw

venfiw

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 16 April 2018 - 09:27 PM

 

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 


  • Eradicate likes this





Also tagged with one or more of these keywords: node.js, node-steam-tradeoffer-manager

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users