steamutils 1.1.98 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. package/SteamClient.js +18 -0
  2. package/index.js +33 -0
  3. package/package.json +1 -1
package/SteamClient.js CHANGED
@@ -1198,6 +1198,24 @@ function SteamClient({
1198
1198
  await sleep(2000)
1199
1199
  // steamClient.setPersona(SteamUser.EPersonaState.Online)
1200
1200
  await sendHello()
1201
+
1202
+ if (apps.some(a => (a.game_id || a) == 730)) {
1203
+ await sleep(2000)
1204
+ steamClient.uploadRichPresence(730, {
1205
+ 'game:state': 'game',
1206
+ steam_display: '#display_GameKnownMapScore',
1207
+ currentmap: '#gamemap_de_empire',
1208
+ connect: '+gcconnectG082AA752',
1209
+ version: CSGO_VER,
1210
+ 'game:mode': 'competitive',
1211
+ 'game:mapgroupname': 'mg_de_mirage',
1212
+ 'game:map': 'de_mirage',
1213
+ 'game:server': 'kv',
1214
+ 'watch': '1',
1215
+ 'game:score': "[ 3 : 6 ]",
1216
+ })
1217
+ }
1218
+
1201
1219
  // await sleep(10000)
1202
1220
  // self.steamUser.uploadRichPresence(730, {
1203
1221
  // status: 'bussssss',
package/index.js CHANGED
@@ -2318,6 +2318,33 @@ class SteamUser {
2318
2318
  return await this.getFollowingPlayersList(steamID)
2319
2319
  }
2320
2320
 
2321
+ async getSentFriendRequestList() {
2322
+ const result = await this._httpRequest(`${this._myProfile}/friends/pending`)
2323
+ if (!result?.data || typeof result._$ !== 'function') return null
2324
+ const $ = result._$()
2325
+
2326
+ const data = []
2327
+ $('#search_results_sentinvites > div').each(function () {
2328
+ const el = $(this)
2329
+ const steamId = el.attr('data-steamid')
2330
+ const accountid = parseInt(el.attr('data-accountid'))
2331
+ if (steamId && accountid) {
2332
+ const invite_block_nameEl = el.find('.invite_block_name > a.linkTitle')
2333
+ const name = invite_block_nameEl.text()
2334
+ const link = invite_block_nameEl.attr('href')
2335
+ const avatar = el.find('.playerAvatar a > img[data-miniprofile="' + accountid + '"]').attr('src')
2336
+ data.push({
2337
+ name,
2338
+ link,
2339
+ avatar,
2340
+ steamId,
2341
+ accountid,
2342
+ })
2343
+ }
2344
+ })
2345
+ return data
2346
+ }
2347
+
2321
2348
  async getMatchHistory_initial (matchHistoryType) {
2322
2349
  if (!matchHistoryType) {
2323
2350
  return
@@ -2679,6 +2706,9 @@ class SteamUser {
2679
2706
  block: 1,
2680
2707
  },
2681
2708
  method: 'POST',
2709
+ headers: {
2710
+ 'content-type': 'application/x-www-form-urlencoded'
2711
+ },
2682
2712
  })
2683
2713
 
2684
2714
  return data
@@ -2693,6 +2723,9 @@ class SteamUser {
2693
2723
  block: 0,
2694
2724
  },
2695
2725
  method: 'POST',
2726
+ headers: {
2727
+ 'content-type': 'application/x-www-form-urlencoded'
2728
+ },
2696
2729
  })
2697
2730
 
2698
2731
  return data
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.1.98",
3
+ "version": "1.2.01",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "axios": "^1.3.4",