Jump to content
McKay Development

Nothing fired after loggedOn event


Jinxed740

Recommended Posts

Hi, I'm trying to make a bot with this package.

 

After I call the client.logOn method with my account name, password and twoFactorCode, I handle the loggedOn event.

But even if details.eresult is set to OK, I can't put my bot into Online state, and the event who should be fired after the login isn't emitted (like accountInfo, wallet, accountLimitations, ...).

 

There is my little code :

// Require
const config = require('config');
const SteamTOTP = require('steam-totp');
const SteamUser = require('steam-user');

console.log("> Welcome.");

let steamCredentials = config.get('steam');

// Init SteamUser
let client = new SteamUser();

client.on('loggedOn', function(details) {
    if(details.eresult !== SteamUser.EResult.OK) {
        console.log("> An error occurred when login.");
        return;
    }

    console.log("> Login successful.");
    client.setPersona(SteamUser.EPersonaState.Online);
});

// This event is emit when the connection is lost with Steam.
client.on('error', function(e) {
    console.log("> An error occurred :");
    console.log(e);
});

client.on('steamguard', function(domain, callback) {
    console.log("> Steam Guard code needed.");
    let code = SteamTOTP.generateAuthCode(steamCredentials.totp_shared_secret);
    callback(code);
});

client.on('accountInfo', function(name, country, authedMachine, flags, facebookID, facebookName) {
    console.log("> Your name is " + name);
    console.log("> Your country is " + country);
});

// Now, we log on.
console.log("> Initiate Login.");
client.logOn({
    "account_name": steamCredentials.account_name,
    "password": steamCredentials.password,
    "twoFactorCode": SteamTOTP.generateAuthCode(steamCredentials.totp_shared_secret)
});

I can't see why i don't have any event after the login...

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