Jump to content


Photo

cannot set UI mode / no event triggered when receiving message

node.js node-steam-user

  • Please log in to reply
1 reply to this topic

#1 pekinese

pekinese

    Newbie

  • Member
  • Pip
  • 6 posts

Posted 15 July 2017 - 08:08 AM

Using the code below I'm not able to set the UI mode to desktop (3).

I've commented the line out and tried if the event when a new message is received is triggered and this doesn't work too.

 

Any idea how to fix these two problems?

Code:

 

var SteamCommunity = require('steamcommunity');
var steam = new SteamCommunity();
var SteamTotp = require('steam-totp');


var sharedSecret = "";
var logOnOptions = {
  'accountName': "x",
  'password': "y",
  'twoFactorCode': SteamTotp.generateAuthCode(sharedSecret),
};




/logs in via browser
steam.login(logOnOptions, function(err, sessionID, cookies, steamguard) {
if (err) {
console.log("There was an error logging in! Error details: " + err.message);
process.exit(1); //terminates program
} else {
console.log("Successfully logged in as " + logOnOptions.accountName);
steam.chatLogon();
}
});


//check if we're logged into
steam.on('chatLoggedOn', function(){
console.log("ready to chat");
});


steam.on('chatLogOnFailed', function(){
console.log("chat failed!");
  
 });


steam.on('friendRelationship', (steamid, relationship) => {
console.log("new request!");
    steam.chatMessage(steamid, 'Hello there! Thanks for adding me!');
});


steam.on('friendOrChatMessage', (senderId, text) => {


console.log("received: " + text);
});

 



#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 1,363 posts

Posted 15 July 2017 - 04:33 PM

You're listening for events that steam-user emits on a steamcommunity instance.







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

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users