Node JS steam-tradeoffer-manager

405 views Asked by At

I'm working on a SteamTradeBot but I have a problem with getOffer().

manager.getOffer(trade_id[i],function(offer){...});

My goal is to output the ID and accept the tradeoffer but it doesn't work because offer is set to null.

console.log(offer.id);
                  ^
TypeError: Cannot read property 'id' of null

Is there any way to fix it?

1

There are 1 answers

0
R3ason On

You are missing 'error' callback:

manager.getOffer(trade_id[i],function(err, offer){...});