steamutils 1.0.78 → 1.0.80

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 +26 -0
  2. package/package.json +1 -1
package/SteamClient.js CHANGED
@@ -156,6 +156,21 @@ function SteamClient({
156
156
  })
157
157
  }
158
158
 
159
+ function offAllEvent() {
160
+ for (const name in events) {
161
+ for (const event of events[name]) {
162
+ if (event.timeout) {
163
+ try {
164
+ clearTimeout(event.timeout)
165
+ } catch (e) {
166
+ }
167
+ delete event.timeout
168
+ }
169
+ }
170
+ delete events[name]
171
+ }
172
+ }
173
+
159
174
  const intervals = {}
160
175
  const intervalRandoms = {}
161
176
 
@@ -845,6 +860,16 @@ function SteamClient({
845
860
  steamID, message
846
861
  })
847
862
  });
863
+
864
+ steamClient.on('playingState', async function (playing_blocked, playing_app) {
865
+ if(playing_app === 0){
866
+ playing_app = null
867
+ }
868
+ if (playing_blocked) {//true, false
869
+ console.log("Playing else where")
870
+ }
871
+ log('playingState', playing_blocked, playing_app);
872
+ });
848
873
  }
849
874
 
850
875
  function sendFriendTyping(steamId, callback) {
@@ -1106,6 +1131,7 @@ function SteamClient({
1106
1131
  return steamClient?._logOnDetails
1107
1132
  },
1108
1133
  onEvent,
1134
+ offAllEvent,
1109
1135
  setPersona(state, name) {
1110
1136
  steamClient.setPersona(state, name)
1111
1137
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.0.78",
3
+ "version": "1.0.80",
4
4
  "dependencies": {
5
5
  "axios": "^1.3.4",
6
6
  "cheerio": "^1.0.0-rc.12",