TomYoki Posted May 5, 2017 Report Posted May 5, 2017 (edited) Hello, I tried making getInventoryContents into a function so It'd be able to update time to time,however I get this error: :384 manager.getInventoryContents(440, 2, true, function(err, inventory) { ^ TypeError: Cannot read property 'getInventoryContents' of undefined Part of code: function LoadInventory(manager, callback){ manager.getInventoryContents(440, 2, true, function(err, inventory) { if (err) { console.log(err); return; } if (inventory.length == 0) { // Inventory empty console.log("TF2 inventory is empty"); return; } else { Edited May 5, 2017 by TomYoki Quote
SunriseM Posted May 5, 2017 Report Posted May 5, 2017 Show the code where you call that function. Are you using multiple accounts? because that is the only reason i see to add manager as parameter in the function. Quote
TomYoki Posted May 5, 2017 Author Report Posted May 5, 2017 Oh, I forgot to set manager when calling the function.Now I have new issue tho \node_modules\steamcommunity\components\users.js:357 "uri": "https://steamcommunity.com/inventory/" + userID.getSteamID64() + "/" + appID + "/" + contextID, ^ TypeError: Cannot read property 'getSteamID64' of null I used to have this before I set SteamID for tradeoffer manager,and it works fine when I call it from chat command.However functions don't seem to like it Part of code: function LoadInventory(manager, callback){ manager.getInventoryContents(440, 2, true, function(err, inventory) { if (err) { console.log(err); return; } if (inventory.length == 0) { // Inventory empty console.log("TF2 inventory is empty"); return; } else { //My tids and bits console.log("Found " + inventory.length + " TF2 items"); } }); setTimeout(LoadInventory, 3600000); } LoadInventory(manager); Quote
SunriseM Posted May 5, 2017 Report Posted May 5, 2017 Are you logged in the bot steam account before the function is called? Quote
TomYoki Posted May 5, 2017 Author Report Posted May 5, 2017 Oh, thanks a lot. Such a simple fix that I didn't check for. 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.