steamutils 1.1.57 → 1.1.59

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 +20 -0
  2. package/package.json +1 -1
package/SteamClient.js CHANGED
@@ -10,6 +10,7 @@ import {fileURLToPath} from "url";
10
10
  import path from "path";
11
11
  import SteamUtils from "./index.js";
12
12
  import {v4 as uuidv4} from 'uuid';
13
+ import EFriendRelationship from "steam-user/enums/EFriendRelationship.js";
13
14
 
14
15
  const __filename = fileURLToPath(import.meta.url);
15
16
  const __dirname = path.dirname(__filename);
@@ -101,6 +102,7 @@ function SteamClient({
101
102
  error: [],
102
103
  playersProfile: [],
103
104
  partyInvite: [],
105
+ friendRelationship: [],
104
106
  }
105
107
 
106
108
  const gcCallback = {}
@@ -881,6 +883,24 @@ function SteamClient({
881
883
  }
882
884
  log('playingState', playing_blocked, playing_app);
883
885
  });
886
+
887
+ steamClient.on('friendRelationship', async function (sid, relationship, previousRelationship) {
888
+ callEvent(events.friendRelationship, {steamId: sid, relationship, previousRelationship})
889
+ switch (relationship) {
890
+ case EFriendRelationship.None: {
891
+ //we got unfriended.
892
+ break
893
+ }
894
+ case EFriendRelationship.RequestRecipient: {
895
+ //we got invited as a friend
896
+ break
897
+ }
898
+ case EFriendRelationship.Friend: {
899
+ //we got added as a friend
900
+ break
901
+ }
902
+ }
903
+ });
884
904
  }
885
905
 
886
906
  function sendFriendTyping(steamId, callback) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.1.57",
3
+ "version": "1.1.59",
4
4
  "main":"index.js",
5
5
  "dependencies": {
6
6
  "axios": "^1.3.4",