steamutils 1.0.35 → 1.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/SteamClient.js +9 -5
  2. package/package.json +1 -1
package/SteamClient.js CHANGED
@@ -9,7 +9,7 @@ import helpers from "./helpers/protos.js";
9
9
  import {fileURLToPath} from "url";
10
10
  import path from "path";
11
11
  import SteamUtils from "./index.js";
12
- import { v4 as uuidv4 } from 'uuid';
12
+ import {v4 as uuidv4} from 'uuid';
13
13
 
14
14
  const __filename = fileURLToPath(import.meta.url);
15
15
  const __dirname = path.dirname(__filename);
@@ -101,8 +101,9 @@ function SteamClient({
101
101
  }
102
102
 
103
103
  const intervals = {}
104
+
104
105
  function doSetInterval(cb, timeout, key) {
105
- if(!key){
106
+ if (!key) {
106
107
  key = uuidv4()
107
108
  }
108
109
  if (intervals[key] !== undefined) {
@@ -183,7 +184,10 @@ function SteamClient({
183
184
  * @returns {Promise.<Object>}
184
185
  */
185
186
  async function partySearch({
186
- prime = false, game_type = 'Competitive', rank = 'Silver Elite',
187
+ prime = false,
188
+ game_type = 'Competitive',
189
+ rank = 'Silver Elite',
190
+ timeout = 10000,
187
191
  }) {
188
192
 
189
193
  return new Promise(resolve => {
@@ -196,7 +200,7 @@ function SteamClient({
196
200
  game_type: game_type === 'Competitive' ? 8 : 10
197
201
  }))
198
202
  partySearchCallback.push(resolve)
199
- setTimeout(resolve, 10000)
203
+ setTimeout(resolve, timeout)
200
204
  })
201
205
  }
202
206
 
@@ -812,7 +816,7 @@ function SteamClient({
812
816
  playCSGO,
813
817
  doSetInterval,
814
818
  doClearIntervals,
815
- async gamesPlayed(apps){
819
+ async gamesPlayed(apps) {
816
820
  steamClient.gamesPlayed(apps);
817
821
  await sleep(2000)
818
822
  steamClient.setPersona(SteamUser.EPersonaState.LookingToPlay)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.0.35",
3
+ "version": "1.0.36",
4
4
  "dependencies": {
5
5
  "axios": "^1.3.4",
6
6
  "cheerio": "^1.0.0-rc.12",