steamutils 1.1.86 → 1.1.88

Sign up to get free protection for your applications and to get access to all the features.
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/index.js CHANGED
@@ -5490,7 +5490,7 @@ class SteamUser {
5490
5490
 
5491
5491
  async getTradeURL(){
5492
5492
  const result = await this._httpRequest(`${this.getMyProfileURL()}/tradeoffers/privacy`)
5493
- const $ = cherrio.load(result.data)
5493
+ const $ = cherrio.load(result?.data || '')
5494
5494
  const trade_offer_access_url = $('#trade_offer_access_url').attr('value')
5495
5495
  return trade_offer_access_url
5496
5496
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.1.86",
3
+ "version": "1.1.88",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "axios": "^1.3.4",