nodejs steam trade offer manager not polling

915 views Asked by At

everything else is working in my steam bot but steam-tradeoffer-manager.
client is my steam-user : var client = new SteamUser();

var TradeOfferManager = require("steam-tradeoffer-manager");

var manager = new TradeOfferManager({
    steam: client,
    language: "en",
    pollInterval: 10000,
    cancelTime: 300000
})

Cookies and api key

client.on("webSession", function(sessionID, cookies) {
    manager.apiKey = webAPIKey;
    manager.setCookies(cookies, function() {
        console.log("Trade offer cookies set. Got API Key: " + manager.apiKey);
    })
})

This doesn't work

manager.on('newOffer', function (offer) {
    console.log("New offer!");
});

Bot works perfectly but doesn't detect new offers.

What am I doing wrong. I think the problem could be the polling?.

what have you done to get this to work?

1

There are 1 answers

0
Tomas Gonzalez On

add community to your manager like this:

var manager = new TradeOfferManager({
    steam: client,
    community: community,
    language: "en",
    pollInterval: 10000,
    cancelTime: 300000
})