Metroo Posted May 31 Report Share Posted May 31 hello everyone ! im trying to make bot which reading incoming offers data and outputing them in console but my code is not working i dont understand why when i run the code the output is cookies set then im sending the trade to bot account but nothing happends const steamUser = require('steam-user') const steamtotp = require('steam-totp') const steamcommunity = require('steamcommunity') const steamTradeofferManager = require('steam-tradeoffer-manager') const config = require('./config') const account = new steamUser() const community = new steamcommunity() const manager = new steamTradeofferManager({ steam : account, community : community, language : 'en', pollInterval : 5000 }) const loginops = { //username accountName : config.account1.username, //password password : config.account1.password, //shared secret twoFactorCode : steamtotp.generateAuthCode(config.account1.shared_secret) } account.logOn(loginops) account.on('loggedOn', () => { account.setPersona(steamUser.EPersonaState.Online) account.gamesPlayed(730) }) account.on('webSession', (sid,cookies) => { manager.setCookies(cookies, function(err) { if (err) { console.log(err); process.exit(1); // Fatal error return; } console.log("Cookies set"); }); community.setCookies(cookies); }) manager.on('newOffer', function(offer) { console.log("New offer #" + offer.id + " from " + offer.partner.getSteam3RenderedID()); offer.accept(function(err, status) { if (err) { console.log("Unable to accept offer: " + err.message); } else { console.log("Offer accepted: " + status); if (status == "pending") { community.acceptConfirmationForObject("identitySecret", offer.id, function(err) { if (err) { console.log("Can't confirm trade offer: " + err.message); } else { console.log("Trade offer " + offer.id + " confirmed"); } }); } } }); }); Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted June 1 Report Share Posted June 1 I'm assuming from your gamesPlayed(730) call that you're trading CS2 items. For steam-tradeoffer-manager to work as expected for trade offers containing CS2 items, you need to enable the useAccessToken constructor option. Quote Link to comment Share on other sites More sharing options...
Metroo Posted June 1 Author Report Share Posted June 1 ok ill try it sir thx for replay ❤️ 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.