steamutils 1.1.90 → 1.1.91
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +31 -0
- 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 || []
|