venfiw Posted April 15, 2018 Report Posted April 15, 2018 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 offerclient.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 offerclient.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 Quote
Eradicate Posted April 16, 2018 Report Posted April 16, 2018 (edited) 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 April 16, 2018 by Eradicate Dr. McKay and venfiw 2 Quote
venfiw Posted April 17, 2018 Author Report Posted April 17, 2018 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(); Eradicate 1 Quote
Recommended Posts
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.