Jump to content
McKay Development

azz_man

Member
  • Posts

    2
  • Joined

  • Last visited

azz_man's Achievements

  1. Ok that helped and made a lot more sense. So I am now able to use the command however it is not returning the player count. I'm positive it's because I'm not using the method correctly as I'm not sure what to put for the second parameter. Right now I have this: const SteamUser = require('steam-user');var user = new SteamUser(); user.logOn();console.log(user.getPlayerCount(504370,30));and when I print the player count I get this as a result: Promise { <pending> } I also tried to do: var count = Promise.resolve(user.getPlayerCount(504370,[]))console.log(count); however this still just prints: Promise { <pending> } Any idea what I'm doing wrong, I'm sure it's a lot as I'm very new to this.
  2. So I want to create a very simple discord bot. I already have it running except I cannot figure out how to integrate this library properly. I want the bot to simply retrieve the amount of players on a certain steam game and then return the amount of players. Here's my code so far: const SteamUser = require('./node-steam-user-master/index.js');var user = new SteamUser(); user.login({"accountName": "","password": ""}); user.on('loggedOn', function(details){console.log(user.steamID);}) I will also note I have been getting an error when I try to run this code (I do have the accountName and password fields filled in on my actual program) This is the error I get: ---------------------------------------------------------------------------------------------------------------------- internal/modules/cjs/loader.js:638 throw err; ^ Error: Cannot find module '@doctormckay/stats-reporter' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:690:17) at require (internal/modules/cjs/helpers.js:25:18) at Object.<anonymous> (D:\Discord_Code\bot\node-steam-user-master\index.js:1:1) at Module._compile (internal/modules/cjs/loader.js:776:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3)---------------------------------------------------------------------------------------------------------------------- So that's my first problem, but the other is how do I use the getPlayerCount Method? I'm assuming I need to use a different constructor because the SteamUser doesn't seem to have that method available. Any help would be appreciated, thanks.
×
×
  • Create New...