Jump to content
McKay Development

Recommended Posts

Posted (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 by ProxyCC
Spelling mistake in scentence

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...