steamutils 1.2.80 → 1.2.81
Sign up to get free protection for your applications and to get access to all the features.
- package/SteamClient.js +7 -6
- package/package.json +1 -1
package/SteamClient.js
CHANGED
@@ -443,7 +443,7 @@ function SteamClient({
|
|
443
443
|
|
444
444
|
|
445
445
|
function bindEvent() {
|
446
|
-
const
|
446
|
+
const _events = {
|
447
447
|
async disconnected(eresult, msg) {
|
448
448
|
state = 'Offline'
|
449
449
|
log('disconnected', eresult, msg)
|
@@ -1139,7 +1139,7 @@ function SteamClient({
|
|
1139
1139
|
}
|
1140
1140
|
}
|
1141
1141
|
|
1142
|
-
const
|
1142
|
+
const _chatEvents = {
|
1143
1143
|
async friendMessage(data) {
|
1144
1144
|
if (!data) return
|
1145
1145
|
data.message_no_bbcode = data.message_no_bbcode?.replaceAll(`ː`, `:`)
|
@@ -1225,12 +1225,13 @@ function SteamClient({
|
|
1225
1225
|
}
|
1226
1226
|
}
|
1227
1227
|
|
1228
|
-
|
1229
|
-
|
1228
|
+
|
1229
|
+
for (const [name, _event] of Object.entries(_events)) {
|
1230
|
+
steamClient.on(name, _event)
|
1230
1231
|
}
|
1231
1232
|
|
1232
|
-
for (const name
|
1233
|
-
steamClient.chat.on(name,
|
1233
|
+
for (const [name, _event] of Object.entries(_chatEvents)) {
|
1234
|
+
steamClient.chat.on(name, _event)
|
1234
1235
|
}
|
1235
1236
|
}
|
1236
1237
|
|