hrrs01 Posted May 31, 2017 Report Share Posted May 31, 2017 steamUser.on('tradeOffers', function(c){ manager.getOffers(TradeOfferManager.EOfferFilter.ActiveOnly, function(err, sent, received){ if(err){ console.log(err); return; } received.forEach(function(offer){ console.log(offer.isGlitched()); var money_give = 0; if(!offer.itemsToGive){ offer.decline(); return; } console.log(offer.itemsToGive); offer.itemsToGive.forEach(function(item){ console.log(item.market_hash_name); market.getItemPrice(730, item.market_hash_name, function(err, data){ if(err){ console.log(err); return; } money_give += data.lowest_price; console.log(money_give); },9); }); }); }); }); What is wrong with this snippet? The item object's market_hash_name is returning undefinded. Any reason for why that might be? - https://github.com/DoctorMcKay/node-steamcommunity/wiki/CEconItem#market_hash_name Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted June 1, 2017 Report Share Posted June 1, 2017 Have you set a language in your constructor options? Quote Link to comment Share on other sites More sharing options...
hrrs01 Posted June 1, 2017 Author Report Share Posted June 1, 2017 Jeez, thank you! Any special reason to why the constructer is not set by default? Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted June 1, 2017 Report Share Posted June 1, 2017 Because specifying a language makes the module fetch item descriptions, which involves extra requests. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.