How do I get the inventory of a steam account without limiting the number of results?

278 Views Asked by At

I am trying to make a steam bot and trying to program it like the Kalizar bot: https://steamcommunity.com/id/KalizarLevelUpBot/

Now when you chat with the Kalizar bot and type the !stats command, the bot replies with how many hydra keys, tf2 keys, CS:GO keys, etc. he has in its inventory.

I have been trying to program a similar thing, just for CS:GO keys, what I've got so far:

const steaminventory = require("get-steam-inventory");
const ownsteamid = "<mybot'ssteamidcomeshere>";

let rawData = data.raw.descriptions;
let tradables = 0;
let nonTradables = 0;
rawData.forEach((key) => {
  if (key.tradable == 1) {
    tradables++;
  } else {
    nonTradables++;
  }

client.chatMessage(
  steamID,
  "I have " + tradables + " tradable CSGO keys and " + nonTradables + " non-tradable ones."
   );
});

and It works! but the only problem is that it gives the output only 26 times even though there are around 90 keys that match the description like,

`I have 0 tradable CSGO keys and 1 non-tradable ones.

I have 0 tradable CSGO keys and 2 non-tradable ones.

I have 0 tradable CSGO keys and 3 non-tradable ones.

I have 0 tradable CSGO keys and 4 non-tradable ones.

I have 0 tradable CSGO keys and 5 non-tradable ones.

...`

I want to output it as many times as the number of keys. So if there are 90 keys, it should give the output 90 times, instead 26 times. I don't even know where the "26" times come from but in cases, the keys are a number higher than that, it seems to output 26 times and omits all the keys afterward.

0

There are 0 best solutions below