Jump to content
McKay Development

Cannot read property '[object Object]' of null


Dijonigamer

Recommended Posts

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 this
let 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.");
}
});

 

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