steamutils 1.2.33 → 1.2.35
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/SteamClient.js +7 -0
- package/index.js +16 -0
- package/package.json +1 -1
package/SteamClient.js
CHANGED
@@ -1610,6 +1610,7 @@ function SteamClient({
|
|
1610
1610
|
return playingBlocked
|
1611
1611
|
},
|
1612
1612
|
async getChatHistory(steamId) {
|
1613
|
+
if (!steamClient.steamID) return []
|
1613
1614
|
const mySteamId = typeof steamClient.steamID.getSteamID64 === "function" ? steamClient.steamID.getSteamID64() : steamClient.steamID
|
1614
1615
|
return new Promise(resolve => {
|
1615
1616
|
setTimeout(resolve, 90000)
|
@@ -1638,6 +1639,12 @@ function SteamClient({
|
|
1638
1639
|
community.redeemGift(gid)
|
1639
1640
|
} catch (e) {
|
1640
1641
|
}
|
1642
|
+
},
|
1643
|
+
async requestFreeLicense(...args){
|
1644
|
+
try {
|
1645
|
+
return await steamClient.requestFreeLicense(...args)
|
1646
|
+
} catch (e) {
|
1647
|
+
}
|
1641
1648
|
}
|
1642
1649
|
}
|
1643
1650
|
}
|
package/index.js
CHANGED
@@ -6003,6 +6003,22 @@ class SteamUser {
|
|
6003
6003
|
return {}
|
6004
6004
|
}
|
6005
6005
|
}
|
6006
|
+
|
6007
|
+
async getAmountSpentOnSteam() {
|
6008
|
+
const response = (await this._httpRequest({
|
6009
|
+
url: `https://help.steampowered.com/en/`,
|
6010
|
+
}))?.data
|
6011
|
+
if (!response) {
|
6012
|
+
return null
|
6013
|
+
}
|
6014
|
+
const $ = cheerio.load(response)
|
6015
|
+
const text = $('.help_event_limiteduser .help_event_limiteduser_spend').text()
|
6016
|
+
if (text?.startsWith("Amount Spent on Steam")) {
|
6017
|
+
return text
|
6018
|
+
} else {
|
6019
|
+
return null
|
6020
|
+
}
|
6021
|
+
}
|
6006
6022
|
}
|
6007
6023
|
|
6008
6024
|
export default SteamUser
|