Jump to content
McKay Development

Recommended Posts

Posted (edited)

Hi I'm using getPersonas to retrieve people's username from a steam id but when I'm calling it ir returns me an error. I've checked npm and I have the last version of steam-user. Is it uncompatible with node-steam?

 

var ids = steamids.map(function(id) {
                           ^

TypeError: steamids.map is not a function
    at SteamUser.getPersonas (***/node_modules/steam-user/components/friends.js:119:21)

 
P.S:
I didn't forget to call the lib:
 
 
// Requires
var Steam        = require("steam"),
    SteamGroups  = require("steam-groups"),
    User         = require('steam-user'),
    util         = require("util"),
    fs           = require("fs"),
    csgo         = require("../"),
    readlineSync = require("readline-sync"),
    crypto       = require("crypto"),
    pg           = require('pg');
// Objects
var bot          = new Steam.SteamClient(),
    steamUser    = new Steam.SteamUser(bot),
    steamFriends = new Steam.SteamFriends(bot),
    steamGroup   = new SteamGroups(bot),
    steamGC      = new Steam.SteamGameCoordinator(bot, 730),
    CSGOCli      = new csgo.CSGOClient(steamUser, steamGC, false),
    advUser      = new User();


Edited by zephylac
Posted (edited)

When using getPersonas, it simply does this.

 

bccixv.png

 

AKA, it does nothing.

 

I'm assuming the callback just doesn't get called???

 

Code: 

function makeAccount(account_name) {
	client.getPersonas([account_name], function(per){
		console.log(per[account_name].player_name);
		accounts.splice(0, 1);
		CountAccounts++
		run();
	});
}
Edited by rusty
  • 3 months later...
Posted

Hello, and sorry for bumping!

 

I am getting this as response, which I supose being invalid:

 

eAwk3j3.png

 

My code:

 

steamUser.getPersonas(["76561198313712684"], function (data) { console.log(data) });
Not sure if helps, but I'm calling this as soon as the webSession event fires (already tried with loggedOn event, same result). Am I missing something?

 

Thank you :)

Posted (edited)
self.steamInterface.on("webSession",
		function (sessionID, sessionCookies) {
			self.sessionID = sessionID;
			self.sessionCookies = sessionCookies;
			
			sessionCookies.forEach(
				function(cookie) {
					self.httpRequestJar.setCookie(self.httpRequest.cookie(cookie), 'https://steamcommunity.com');
				}
			);
			
			self.steamWebInterface.setCookies(sessionCookies);
			self.steamTradeOffers.setCookies(sessionCookies,
				function (e) {
					if(!e) {
						self.apiKey = self.steamTradeOffers.apiKey;
                                                //I DO REQUEST getPersonas HERE
					} else {
						self.emit("error", e);
					}
				}
			);
		}
	);
	
	self.steamInterface.on("loggedOn",
		function (response) {
			if(response.eresult == steamInterface.EResult.OK) {
				self.steamInterface.setPersona(steamInterface.EPersonaState.Online, self.nickname);
			}
		}
	);

Maybe I should wait for an event/callback from setPersona, but how?

Edited by Van Kappa

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