BillTheBober Posted June 8, 2020 Report Posted June 8, 2020 (edited) I don't know why it doesn't accept my trade offer I'm stupid client.on('webSession', (sessionID, cookies) => { community.setCookies(cookies); community.startConfirmationChecker(10000, config.identitySercet); }); function acceptOffer(offer) { community.ConfirmationChecker(); console.log("we accepted a offer :)") offer.accept((err) => { if (err) console.log("There was an error accepting the offer."); }); } function declineOffer(offer) { console.log("we decline a offer :(") offer.decline((err) => { if (err) console.log("There was an error declining the offer."); }); } manger.on('newOffer',(offer) =>{ if(offer.partner.getSteam64ID() == config.OwnerId) { acceptOffer(offer); } else { declineOffer(offer); } }) Edited June 8, 2020 by BillTheBober Quote
Op1x3r Posted June 9, 2020 Report Posted June 9, 2020 (edited) What's the point of your acceptOffer() function? Just do offer.accept() Also, you need to check if the offer was accepted successfully. https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/wiki/TradeOffer#acceptskipstateupdate-callback Check stuff like "getExchangeDetails" out. Edited June 9, 2020 by Op1x3r Quote
vrtgn Posted June 9, 2020 Report Posted June 9, 2020 Are you sure offer.partner.getSteam64ID() == config.OwnerId is getting triggered correctly? Or maybe it is and the problem is with your acceptOffer function, I would recommend something like this: function acceptOffer(offer) { offer.accept((err) => { if (err) { console.log('There was an error accepting the offer'); return; } // if we have to give items we have to confirm, otherwise we dont have to if (offer.itemsToGive.length != 0) { community.acceptConfirmationForObject(config.identity_secret, offer.id, (err) => { if (err) { console.log('There was an error confirming the offer'); return; } console.log('Accepted and confirmed the offer'); }) } else { console.log('Accepted the offer'); } }) } 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.