Ceddini Posted January 18, 2021 Report Share Posted January 18, 2021 (edited) I think I've done everything right, but it still isn't reacting to the friendsList event. const colors = require('colors'); const SteamUser = require('steam-user'); const { enablePicsCache } = require('steam-user/resources/default_options'); const clientOptions = { enablePicsCache: true, // autoRelogin: true, }; const client = new SteamUser(clientOptions); const logOnOptions = { accountName: process.env.STEAM_USER, password: process.env.STEAM_PASS, }; client.logOn(logOnOptions); client.on('error', (err) => { console.log(err); }); client.on('loggedOn', () => { console.log('Logged into Steam'.green); }); client.on('friendsList', () => { console.log('Friends list loaded'.green); console.log(client.myFriends); }); client.on('appOwnershipCached', () => { console.log('All games have been cached'.green); const games = client.getOwnedApps(true); // console.log(games); }); Both 'appOwnershipCached' and 'loggedOn' work beautifully, but somehow friendsList doesn't work. Same goes for 'friendsGroupList' and 'friendPersonasLoaded'. Does it have something to do with my privacy settings? I changed them and the issue remains. Edited January 18, 2021 by Ceddini Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted January 19, 2021 Report Share Posted January 19, 2021 You need to set your persona state to something besides Offline in order for friends stuff to work. client.setPersona(SteamUser.EPersonaState.Online) Ceddini 1 Quote Link to comment Share on other sites More sharing options...
Ceddini Posted January 19, 2021 Author Report Share Posted January 19, 2021 Thank you very much! It's working beautifully now! Dr. McKay 1 Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted January 19, 2021 Report Share Posted January 19, 2021 Glad to hear it. May I ask why you have the third line? You shouldn't need to do that. Quote Link to comment Share on other sites More sharing options...
Ceddini Posted January 19, 2021 Author Report Share Posted January 19, 2021 I don't know exactly why, but VSCode randomly imported it without me doing anything. Or at least I don't remember what I did. I can normally trust vscode with the imports, so I left it alone. But I just removed it and it still works, so I guess vscode was just being a bit moody . 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.