Jump to content


Photo
Question

setPersona appears to not work

node.js node-steam-user

Best Answer VenomZ75 , 24 June 2019 - 03:55 PM

I managed to get it working. As you suggested, there was a typo I didn't spot in the config file (module_export instead of module_exports). Many thanks for your help!

Go to the full post


  • Please log in to reply
3 replies to this topic

#1 VenomZ75

VenomZ75

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 24 June 2019 - 01:59 PM

Hi there, I'm using steam-user to try to make a bot, but I cannot get it to set it's status to online. Furthermore, is there a way to check if the login was successful as the loggedOn event appears to trigger even if I try entering bogus account details. Code is as follows:
 

const SteamUser = require ("steam-user");
const SteamTotp = require ("steam-totp");
const config = require("./config");

const client = new SteamUser();
const details = {
accountName: config.accountName,
password: config.password,
twoFactorCode: SteamTotp.generateAuthCode("redacted"),
rememberPassword: true
};

client.logOn(details);

client.on("loggedOn", () => {
console.log("signed in");
client.setPersona(1);
})

Edited by Dr. McKay, 24 June 2019 - 02:35 PM.
removed secret


#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,212 posts

Posted 24 June 2019 - 02:35 PM

That looks right. Make sure your config.accountName is set properly.



#3 VenomZ75

VenomZ75

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 24 June 2019 - 03:55 PM   Best Answer

I managed to get it working. As you suggested, there was a typo I didn't spot in the config file (module_export instead of module_exports). Many thanks for your help!


Edited by VenomZ75, 24 June 2019 - 03:57 PM.

  • Dr. McKay likes this

#4 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,212 posts

Posted 24 June 2019 - 04:05 PM

Great, glad you got it working. As an explanation for why you were getting loggedOn emitting, if accountName isn't specified or is undefined, then steam-user will log onto an anonymous user account.


  • VenomZ75 likes this





Also tagged with one or more of these keywords: Question, node.js, node-steam-user

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users