ProxyCC Posted May 18 Report Posted May 18 (edited) I am trying to retrieve steam hours for every client thats getting logged in. The problem what I am getting tho is that it says that their is: No data in PICS package cache yet. Am I not setting data right? My function: async function checkHoursOnRecord(user, account, games, packages) { return new Promise((resolve, reject) => { user.getOwnedApps((err, apps) => { if (err) { console.error(`Error fetching owned games: ${err}`); reject(err); } else if (apps.includes(games, packages)) { user.getProductInfo([games], [packages], false, (err, apps) => { if (err) { console.error(`Error fetching game info: ${err}`); reject(err); } else { const hours = apps[games].appinfo.common.playtime_forever / 60; console.log(`Hours on record on game ${games}: ${hours}`); resolve(hours); } }); } else { resolve(0); } }); }); } const client = new SteamUser({ enablePicsCache: true}); Edited May 18 by ProxyCC Spelling mistake in scentence Quote
Dr. McKay Posted May 19 Report Posted May 19 https://github.com/DoctorMcKay/node-steam-user#getownedappsfilter Don't call getOwnedApps until after the ownershipCached event is emitted. Also, it doesn't take a callback argument. 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.