Dijonigamer Posted July 18, 2019 Report Share Posted July 18, 2019 Hi, I'm trying to make my bot work but I have the following error: C:\Users\Admin\Desktop\123456789\SteamCardBot-master\index.js:91 console.log("## Logged in as #" + client.steamID + " (" + personas[client.steamID].player_name + ")"); ^ TypeError: Cannot read property '[object Object]' of null at client.getPersonas (C:\Users\Admin\Desktop\123456789\SteamCardBot-master\index.js:91:75) at Immediate.setImmediate (C:\Users\Admin\node_modules\@doctormckay\stdlib\components\promises.js:24:6) at runCallback (timers.js:705:18) at tryOnImmediate (timers.js:676:5) at processImmediate (timers.js:658:5) What am i missing? I've thislet client = new SteamUser(),manager = new TradeOfferManager({"steam": client,"language": "en","pollInterval": "10000","cancelTime": "7200000" // 2 hours in ms}),community = new SteamCommunity(); This is the logg client.logOn({accountName: CONFIG.USERNAME,password: CONFIG.PASSWORD,twoFactorCode: SteamTotp.getAuthCode(CONFIG.SHAREDSECRET),rememberPassword: true});client.on("loggedOn", (details, parental) => {client.getPersonas([client.steamID], (personas) => {console.log("## Logged in as #" + client.steamID + " (" + personas[client.steamID].player_name + ")");});client.setPersona(1);});client.on("webSession", (sessionID, cookies) => {manager.setCookies(cookies, (ERR) => {if (ERR) {console.log("## An error occurred while setting cookies.");} else {console.log("## Websession created and cookies set.");}}); Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted July 19, 2019 Report Share Posted July 19, 2019 You need to update your code for v4. The first argument to all callbacks is now err. Quote Link to comment Share on other sites More sharing options...
Dijonigamer Posted July 20, 2019 Author Report Share Posted July 20, 2019 What is v4?Is only the loggedon what is wrong? Quote Link to comment Share on other sites More sharing options...
aeonix Posted July 20, 2019 Report Share Posted July 20, 2019 Your code is outdated a litte bit. Upgrade it to node-steam-user v4 update or downgrade node-steam-user version. Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted July 20, 2019 Report Share Posted July 20, 2019 Sorry, I could have been a little clearer. Not event callbacks, those are (mostly) unchanged. Callbacks to functions like getPersonas is what I'm talking about. All the changes in v4 can be found here. Dijonigamer 1 Quote Link to comment Share on other sites More sharing options...
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.