Jump to content
McKay Development

Recommended Posts

Posted

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.

Posted

I'm sorry, I've looked through it and tried a bunch of stuff, but I can't figure it out because the commands in steamcommunity are asking for a type of object that the client isn't. I may be entirely wrong here, but all I need is for you to show me an example, Im just so confused.

Posted

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);
    });
});
Posted
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

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