Jump to content
McKay Development

newOffer not being called after VPS switch (I guess)


Recommended Posts

Edit: sorry for posting in the wrong section!

 

Alright, so I've switched bot and switched VPS and it will login to the bot just fine,

then it will spam 'Checking confirmations' in the console of the server,

 

whenever I then try to get an update from `newOffers` it will not receive any whenever I sent a tradeoffer.

Am I missing something or, what happened?

Code (basically from the tutorial provided):
 

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',
  "cancelTime": 90000
});

community.on('debug', console.log);

const logOnOptions = {
	accountName: 'x',
	password: 'x',
	twoFactorCode: SteamTotp.generateAuthCode('x+x/x+I=')
};

client.logOn(logOnOptions);					

client.on('loggedOn', () => {
	console.log('Logged into Steam');

	client.setPersona(SteamUser.Steam.EPersonaState.Online);
});

client.on('webSession', (sessionid, cookies) => {
 	manager.setCookies(cookies);

	community.setCookies(cookies);
	community.startConfirmationChecker(15000, 'x=');	
});

manager.on('newOffer', offer => {
  if (offer.partner.getSteamID64() === 'x') {
    offer.accept((err, status) => {
      if (err) {
        console.log(err);
      } else {
        console.log(`Accepted offer. Status: ${status}.`);
      }
    });
  } else {
    offer.decline(err => {
      if (err) {
        console.log(err);
      } else {
        console.log('Canceled offer from scammer.');
      }
    });
  }
});
Edited by Eradicate
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...