joaolucas89 Posted May 1, 2016 Report Share Posted May 1, 2016 How to automatically cancel offers if user select my bot items? Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted May 1, 2016 Report Share Posted May 1, 2016 if (offer.itemsToGive.length > 0) { // There are more than 0 items in itemsToGive, so the user requested some items offer.decline(); } Quote Link to comment Share on other sites More sharing options...
joaolucas89 Posted May 1, 2016 Author Report Share Posted May 1, 2016 Yes I have something like that. I always decline offers sent by users. manager.on('newOffer', function(offer) { console.log("New offer #" + offer.id + " from " + offer.partner.getSteam3RenderedID()); offer.decline(function(err) { if (err) { console.log(err); return; } console.log('Offer was declined, we dont accept external offers. Only our bots can send an offer :-D'); }); });So, the big question is: When the event "newOffer" is called? Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted May 1, 2016 Report Share Posted May 1, 2016 It's emitted when a new offer is received. Please read the wiki. Quote Link to comment Share on other sites More sharing options...
joaolucas89 Posted May 2, 2016 Author Report Share Posted May 2, 2016 So, if only my bot sent offers, I can ignore this event? :-P Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted May 2, 2016 Report Share Posted May 2, 2016 Yes. Quote Link to comment Share on other sites More sharing options...
joaolucas89 Posted May 3, 2016 Author Report Share Posted May 3, 2016 And "receivedOfferChanged" too? Right? Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted May 3, 2016 Report Share Posted May 3, 2016 Please, just read the documentation. Quote Link to comment Share on other sites More sharing options...
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.