steamutils 1.1.87 → 1.1.88

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/SteamClient.js +17 -1
  2. 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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.1.87",
3
+ "version": "1.1.88",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "axios": "^1.3.4",