alex7kom / node-steam-weblogon

WebLogOn implementation for node-steam 1.x **NO LONGER MAINTAINED**
MIT License
27 stars 9 forks source link

Error on index.js:16 #1

Closed amaennel closed 8 years ago

amaennel commented 8 years ago

Hi I'm receiving this error:

/home/alex/Desktop/skinswin-Bot/node_modules/steam-weblogon/index.js:16 this._steamClient.on('logOnResponse', handleLogOnResponse.bind(this)); ^ TypeError: Cannot read property 'on' of undefined at new SteamWebLogOn (/home/alex/Desktop/skinswin-Bot/node_modules/steam-weblogon/index.js:16:20) at Object. (/home/alex/Desktop/skinswin-Bot/tradebot.js:27:21) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Function.Module.runMain (module.js:501:10) at startup (node.js:129:16) at node.js:814:3

when calling the code below:

steamClient.on('connected', function() {

steamUser.logOn(logOnOptions); steamWebLogOn.webLogOn(function(sessionID, newCookie) { getSteamAPIKey({ sessionID: sessionID, webCookie: newCookie }, function(err, APIKey) { offers.setup({ sessionID: sessionID, webCookie: newCookie, APIKey: APIKey }, function() { offerItems(); }); }); }); console.warn("[SteamUser] Login credentials were sent"); });

I'm using the newest version of all libraries and node 0.12.8 and can't figure out the error.

Thank you for your help. Alex

Nikoly0072 commented 8 years ago

Не правильно используете функцию, читайте документацию к модулю.

alex7kom commented 8 years ago

@AlexPlayin You should call it after a successful login (that's why in README it is called from logOnResponse event), otherwise it won't work.