Poketz Posted February 12, 2017 Report Posted February 12, 2017 Firstly, thanks for the great work on steam-user. It's great. I'm having some issues with getting my friends list, having read the docs I understand it can be accessed via myFriends. I've tried the following but it keeps returning undefined. function getMyFriends(callback) { if(err) return callback(err); if(!user.myFriends) callback(null,user.myFriends) } What event do I need to wait for to ensure it holds something? Quote
Dr. McKay Posted February 13, 2017 Report Posted February 13, 2017 You need to wait for this event: https://github.com/DoctorMcKay/node-steam-user#friendslist Also, the problems I see with your code are that err doesn't exist, and that you're only sending back the friends list if it's falsy (which would never result in sending back the friends list). Quote
Poketz Posted February 14, 2017 Author Report Posted February 14, 2017 Thank you very much, I completley missed the event - couldn't see the forest for the trees. And you're quite right, my code was garbage. Quote
Poketz Posted February 14, 2017 Author Report Posted February 14, 2017 On the top of my Friends is their a way to either establish a list of only my friends that are online. or even better.. an event that advises me when they start a game? Quote
Dr. McKay Posted February 15, 2017 Report Posted February 15, 2017 The user event will be emitted anytime someone's persona data changes (e.g. they go online/offline or start/quit a game). Also, at any time the users property contains the current persona data for everyone we know about. Quote
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.