Jump to content


Photo

error to send trade offer { Error: There was an error sending your trade offer. Please try again later. (15) 0|server | at Object.exports.makeA

node.js node-steam-tradeoffer-manager steam-user steam-totp steamcommunity

  • Please log in to reply
1 reply to this topic

#1 fhk

fhk

    Newbie

  • Member
  • Pip
  • 1 posts

Posted 12 March 2019 - 07:10 AM

const SteamUser = require('steam-user');
const SteamTotp = require('steam-totp');
const SteamCommunity = require('steamcommunity');
const TradeOfferManager = require('steam-tradeoffer-manager');


const client = new SteamUser();
const community = new SteamCommunity();
const manager = new TradeOfferManager({
  steam: client,
  community: community,
  language: 'en'
});

const logInOptions = {
  accountName: "........",
  password: "...........",
  twoFactorCode: SteamTotp.generateAuthCode("............")
};

client.logOn(logInOptions);

client.on('loggedOn', () => {
  console.log('logged on');
client.setPersona(SteamUser.EPersonaState.Online, "bot1");
client.gamesPlayed(570);
});
client.on('webSession', (sid, cookies) => {
console.log(cookies);
  manager.setCookies(cookies);
  community.setCookies(cookies);
  community.startConfirmationChecker(10000, "............");
  mytrade();
});

manager.on('newOffer', offer => {
  console.log('offer detected');
  if (offer.partner.getSteamID64() === '.............') {
    offer.accept((err, status) => {
      if (err) {
        console.log(err);
      } else {
        console.log(status);
      }
    })
  } else {
    console.log('unknown sender');
    offer.decline(err => {
      if (err) {
        console.log(err);
      } else {
        console.log('trade from stranger declined');
      }
    });
  }
});

function mytrade() {
manager.getOfferToken((err, token) => {
if (err) {
console.log("gsfgfasy", err)
}
else {
var partner="id........"
const offer = manager.createOffer('id.....',token);
manager.getUserInventoryContents(partner,570, 2, true, (err, myInv) => {
if (err) {
console.log(err);
} else {
console.log("myenv",myInv[0]);
// myInv.forEach(function(item) {
offer.addTheirItem(myInv[0]);
offer.setMessage('You received a floral shirt!');
offer.send((err, status) => {
if (err) {
console.log(err);
} else {
console.log('trade sent');
console.log(status);
}
})
 
 
// })
}
})


}
})
}

 



#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,070 posts

Posted 12 March 2019 - 09:44 PM

https://steamerrors.com/15







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

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users