Hi,
I have been trying to enable polling for a few hours at this point, without any success. I believe polling is not working because neither pollSuccess nor pollFailure are ever emitted. I need to run multiple bots at the same time, so I've created a class for this.
Offers are being sent, but even when setting cancelTime in the constructor (and even on the tradeoffers themselves), they are never cancelled. This leads me to believe polling is not done. What am I doing wrong here?
The relevant code looks something like this:
const SteamTotp = require('steam-totp');
const SteamUser = require('steam-user');
const SteamCommunity = require('steamcommunity');
const TradeOfferManager = require('steam-tradeoffer-manager');
class Bot {
constructor (accountName, sharedSecret, identitySecret) {
this.accountName = accountName;
this.sharedSecret = sharedSecret;
this.identitySecret = identitySecret;
this.user = new SteamUser();
this.community = new SteamCommunity();
this.manager = new TradeOfferManager({
steam: this.user,
community: this.community,
language: 'en',
pollInterval: 5000,
cancelTime: 120000,
cancelOfferCount: 20
});
this.user.logOn({
accountName,
proccess.env.STEAM_PASSWORD
});
this.user.on('steamGuard', (domain, callback) => {
const code = SteamTotp.generateAuthCode(sharedSecret);
callback(code);
});
this.user.on('webSession', (sessionid, cookies) => {
this.manager.setCookies(cookies);
this.community.setCookies(cookies);
});
this.manager.on('pollSuccess', () => {
console.log('Poll success!');
});
this.manager.on('pollFailure', (error) => {
console.log('Poll failure!\n' + error);
});
}
}
...
Thanks in advance for all and any help!