steamutils 1.1.87 → 1.1.88
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 +17 -1
- package/package.json +1 -1
package/SteamClient.js
CHANGED
|
@@ -85,7 +85,8 @@ function SteamClient({
|
|
|
85
85
|
cookie,
|
|
86
86
|
isAutoRequestFreeLicense = true,
|
|
87
87
|
isPartyRegister = true,
|
|
88
|
-
autoPlay = false
|
|
88
|
+
autoPlay = false,
|
|
89
|
+
autoAcceptTradeRequest = false,
|
|
89
90
|
}) {
|
|
90
91
|
const steamClient = new SteamUser()
|
|
91
92
|
let prime = null
|
|
@@ -105,6 +106,7 @@ function SteamClient({
|
|
|
105
106
|
friendRelationship: [],
|
|
106
107
|
tradeOffers: [],
|
|
107
108
|
offlineMessages: [],
|
|
109
|
+
friendsList: [],
|
|
108
110
|
}
|
|
109
111
|
|
|
110
112
|
const gcCallback = {}
|
|
@@ -912,6 +914,20 @@ function SteamClient({
|
|
|
912
914
|
steamClient.on('offlineMessages', async function (count , friends) {
|
|
913
915
|
callEvent(events.offlineMessages, {count , steamIdList: friends})
|
|
914
916
|
});
|
|
917
|
+
|
|
918
|
+
steamClient.on('tradeRequest', async function (steamID , respond ) {
|
|
919
|
+
if (autoAcceptTradeRequest) {
|
|
920
|
+
log(`Incoming trade request from ${steamID.getSteam3RenderedID()}, accepting`);
|
|
921
|
+
respond(true);
|
|
922
|
+
} else {
|
|
923
|
+
log(`Incoming trade request from ${steamID.getSteam3RenderedID()}, wating`);
|
|
924
|
+
}
|
|
925
|
+
});
|
|
926
|
+
|
|
927
|
+
steamClient.on('friendsList', async function () {
|
|
928
|
+
const friends = Object.keys(steamClient.myFriends).filter(steamId => steamClient.myFriends[steamId] === SteamUser.EFriendRelationship.Friend)
|
|
929
|
+
callEvent(events.friendsList, friends)
|
|
930
|
+
});
|
|
915
931
|
}
|
|
916
932
|
|
|
917
933
|
function sendFriendTyping(steamId, callback) {
|