steamutils 1.1.90 → 1.1.92
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/index.js +32 -1
- package/package.json +1 -1
package/index.js
CHANGED
@@ -1045,6 +1045,37 @@ class SteamUser {
|
|
1045
1045
|
}
|
1046
1046
|
}
|
1047
1047
|
|
1048
|
+
static async getUsersSummaryByWebApiKey(webApiKey, steamIds) {
|
1049
|
+
if (!Array.isArray(steamIds)) {
|
1050
|
+
steamIds = [steamIds]
|
1051
|
+
}
|
1052
|
+
let response = await request(`https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=${webApiKey}&steamids=${steamIds.join(',')}`)
|
1053
|
+
return response?.data?.response?.players || []
|
1054
|
+
const resultExample = [{
|
1055
|
+
"steamid": "76561199040402348",
|
1056
|
+
"communityvisibilitystate": 3,
|
1057
|
+
"profilestate": 1,
|
1058
|
+
"personaname": "Na",
|
1059
|
+
"commentpermission": 1,
|
1060
|
+
"profileurl": "https://steamcommunity.com/id/natri99/",
|
1061
|
+
"avatar": "https://avatars.steamstatic.com/834966fea6a0a8a3b7011db7f96d38b61ee0ba64.jpg",
|
1062
|
+
"avatarmedium": "https://avatars.steamstatic.com/834966fea6a0a8a3b7011db7f66d38b51ee0ba64_medium.jpg",
|
1063
|
+
"avatarfull": "https://avatars.steamstatic.com/834966fea6a0a8a3b7011db7f96e38b51ee0ba64_full.jpg",
|
1064
|
+
"avatarhash": "834966fea6a0a8a3b7011db7f96d38b51ee0ba64",
|
1065
|
+
"lastlogoff": 1685298425,
|
1066
|
+
"personastate": 0,
|
1067
|
+
"primaryclanid": "103582791470373577",
|
1068
|
+
"timecreated": 1585473529,
|
1069
|
+
"personastateflags": 0
|
1070
|
+
}]
|
1071
|
+
}
|
1072
|
+
|
1073
|
+
static async getUserFriendListByWebApiKey(webApiKey, steamId) {
|
1074
|
+
const response = await request(`http://api.steampowered.com/ISteamUser/GetFriendList/v0001/?key=${webApiKey}&steamid=${steamId}&relationship=friend`);
|
1075
|
+
return response.data.friendslist.friends.map(({steamid}) => steamid) || []
|
1076
|
+
const resultExample = ["76561198112239954", "76561199239548264", "76561199446829671"]
|
1077
|
+
}
|
1078
|
+
|
1048
1079
|
static async QueryLocations () {
|
1049
1080
|
let response = await request(`https://steamcommunity.com//actions/QueryLocations/`)
|
1050
1081
|
return response?.data || []
|
@@ -1566,7 +1597,7 @@ class SteamUser {
|
|
1566
1597
|
break
|
1567
1598
|
}
|
1568
1599
|
case 429: {
|
1569
|
-
console.log(
|
1600
|
+
console.log(`[${config.method?.toUpperCase()}] Too Many Requests`, config.url)
|
1570
1601
|
tooManyRequestTimestamp = new Date().getTime()
|
1571
1602
|
checkTooManyRequest = true
|
1572
1603
|
await sleep(30000)
|