steamutils 1.1.57 → 1.1.58
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.
- package/SteamClient.js +18 -0
- 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);
|
|
@@ -881,6 +882,23 @@ function SteamClient({
|
|
|
881
882
|
}
|
|
882
883
|
log('playingState', playing_blocked, playing_app);
|
|
883
884
|
});
|
|
885
|
+
|
|
886
|
+
steamClient.on('friendRelationship', async function (sid, relationship, previousRelationship) {
|
|
887
|
+
switch (relationship) {
|
|
888
|
+
case EFriendRelationship.None: {
|
|
889
|
+
//we got unfriended.
|
|
890
|
+
break
|
|
891
|
+
}
|
|
892
|
+
case EFriendRelationship.RequestRecipient: {
|
|
893
|
+
//we got invited as a friend
|
|
894
|
+
break
|
|
895
|
+
}
|
|
896
|
+
case EFriendRelationship.Friend: {
|
|
897
|
+
//we got added as a friend
|
|
898
|
+
break
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
});
|
|
884
902
|
}
|
|
885
903
|
|
|
886
904
|
function sendFriendTyping(steamId, callback) {
|