Jump to content
McKay Development

How to get inventory contents of a steamuser


HeilShuckle

Recommended Posts

I'm trying to figure out how to get the contents of the inventory of my own bot. I use

 

const SteamUser = require('steam-user');

const client = new SteamUser();

 

but I haven't been able to find a way to load the inventory with something like 

 

client.getInventoryContents();

 

I'm sure there's a way to do it, but i'm flat lining in my head right now.

Link to comment
Share on other sites


community = new SteamCommunity();
community.login({"accountName": "username", "password": "password", "twoFactorCode": "ABCDE"}, (err, sessionID, cookies, steamguard, oAuthToken) => {
    if (err) {
        throw err;
    }

    community.getUserInventoryContents("[U:1:46143802]", 730, 2, true, (err, inventory) => {
        if (err) {
            throw err;
        }
       
        console.log(inventory);
    });
});
Link to comment
Share on other sites

community = new SteamCommunity();
community.login({"accountName": "username", "password": "password", "twoFactorCode": "ABCDE"}, (err, sessionID, cookies, steamguard, oAuthToken) => {
    if (err) {
        throw err;
    }

    community.getUserInventoryContents("[U:1:46143802]", 730, 2, true, (err, inventory) => {
        if (err) {
            throw err;
        }
        
        console.log(inventory);
    });
});

https://github.com/DoctorMcKay/node-steamcommunity/wiki/CSteamUser#getinventorycontentsappid-contextid-tradableonly-language-callback

didn't say we have to put steam id :V and i cant get it working until i saw this code

Link to comment
Share on other sites

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...