anupkrbid-dev Posted August 28, 2018 Report Posted August 28, 2018 client.on('appOwnershipCached', function() { const appIDs = client.getOwnedApps(); const appDetails = client.getProductInfo(appIDs, () => { fs.writeFileSync('./logs/info.json', JSON.stringify(appDetails, null, 4)); }); }); This is my code I was trying to get the product info of all the app I have but I got this error Logged into Steam! /mnt/e/Projects/web/steam-bot/node_modules/steam-user/components/apps.js:134 packages = packages.map(function(pkg) { ^ TypeError: packages.map is not a function at SteamUser.getProductInfo (/mnt/e/Projects/web/steam-bot/node_modules/steam-user/components/apps.js:134:22) at SteamUser.<anonymous> (/mnt/e/Projects/web/steam-bot/bot.js:51:29) at emitNone (events.js:106:13) at SteamUser.emit (events.js:208:7) at /mnt/e/Projects/web/steam-bot/node_modules/steam-user/components/apps.js:481:9 at /mnt/e/Projects/web/steam-bot/node_modules/steam-user/components/apps.js:295:5 at Object.cb (/mnt/e/Projects/web/steam-bot/node_modules/steam-user/components/messages.js:174:4) at CMClient._netMsgReceived (/mnt/e/Projects/web/steam-bot/node_modules/steam-client/lib/cm_client.js:321:26) at CMClient.handlers.(anonymous function) (/mnt/e/Projects/web/steam-bot/node_modules/steam-client/lib/cm_client.js:603:8) at CMClient._netMsgReceived (/mnt/e/Projects/web/steam-bot/node_modules/steam-client/lib/cm_client.js:305:24) Can anyone Plese help? Quote
Dr. McKay Posted August 28, 2018 Report Posted August 28, 2018 Please double-check the docs. Argument 2 to getProductInfo is an array of packages, not the callback. Pass an empty array if you don't care about any packages. Also, it doesn't return the data; the data is passed to the callback. anupkrbid-dev 1 Quote
anupkrbid-dev Posted August 29, 2018 Author Report Posted August 29, 2018 Oh yes. Thanks for correcting me. I think the data I am getting from product details are same data I would get if I call client.picsCache.apps Am I right? Quote
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.