steamutils 1.2.5 → 1.2.7

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/index.js +10 -10
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -962,7 +962,8 @@ class SteamUser {
962
962
  const name = $('.persona_name .actual_persona_name').text().trim()
963
963
  const $personaLevel = $('.persona_level .friendPlayerLevelNum')
964
964
  const level = $personaLevel.length ? parseInt($personaLevel.text()) : null
965
- const notYetSetup = NotYetSetupProfileTextList.includes(profile_private_info)
965
+ const notYetSetupLink = $('#btn > a').attr('href') || ''
966
+ const notYetSetup = NotYetSetupProfileTextList.includes(profile_private_info) || notYetSetupLink.endsWith("edit?welcomed=1")
966
967
 
967
968
  const g_rgProfileDataExample = {
968
969
  url: 'https://steamcommunity.com/id/natri99/',
@@ -972,13 +973,12 @@ class SteamUser {
972
973
  }
973
974
  let g_rgProfileData = JSON_parse(html.substringBetweenOrNull('g_rgProfileData = ', '"};') + '"}')
974
975
  if (!g_rgProfileData && notYetSetup) {
975
- const editLink = $('#btn > a').attr('href')
976
- if (editLink?.endsWith("edit?welcomed=1")) {
977
- const steamId = editLink.split('https://steamcommunity.com/profiles/')[1].split('/')[0]
976
+ if (notYetSetupLink.endsWith("edit?welcomed=1")) {
977
+ const steamId = notYetSetupLink.split('https://steamcommunity.com/profiles/')[1].split('/')[0]
978
978
  const helloText = $('#hello').text()
979
979
  let personaname = helloText.substring(helloText.indexOf(",") + 1).trim()
980
980
  if (personaname.endsWith(".")) {
981
- personaname = personaname.substring(0, text.length - 1).trim()
981
+ personaname = personaname.substring(0, personaname.length - 1).trim()
982
982
  }
983
983
  g_rgProfileData = {
984
984
  url: 'https://steamcommunity.com/profiles/' + steamId,
@@ -1021,8 +1021,8 @@ class SteamUser {
1021
1021
  const avatarHash = SteamUser.GetAvatarHashFromMultipleURL(avatarFulls)
1022
1022
  const location = $('img.profile_flag').attr('src')?.substringBetweenOrNull('/images/countryflags/', '.')?.toUpperCase() || ''
1023
1023
 
1024
- const playerAvatarClass = $('.profile_header .playerAvatar').attr('class')
1025
- const onlineState = ['online', 'offline', 'in-game'].find(_onlineState => playerAvatarClass.includes(_onlineState))
1024
+ const playerAvatarClass = $('.profile_header .playerAvatar').attr('class') || ''
1025
+ const onlineState = ['online', 'offline', 'in-game'].find(_onlineState => playerAvatarClass.includes(_onlineState)) || 'offline'
1026
1026
  const gamename = $('.profile_in_game .profile_in_game_name').text()?.trim() || ''
1027
1027
  let stateMessageGame = ''
1028
1028
  if (onlineState === 'in-game') {
@@ -1040,9 +1040,9 @@ class SteamUser {
1040
1040
  location,
1041
1041
  summary: SteamUser._formatSummary(g_rgProfileData.summary),
1042
1042
  notYetSetup,
1043
- profile_private_info: profile_private_info ? ((notYetSetup
1043
+ profile_private_info: notYetSetup
1044
1044
  ? '___NotYetSetupProfile___'
1045
- : (PrivateProfileTextList.includes(profile_private_info) ? '___PrivateProfile___' : profile_private_info))) : null,
1045
+ : (PrivateProfileTextList.includes(profile_private_info) ? '___PrivateProfile___' : profile_private_info),
1046
1046
  lobbyLink,
1047
1047
  addFriendEnable,
1048
1048
  isPrivate: PrivateProfileTextList.includes(profile_private_info),
@@ -2888,7 +2888,7 @@ class SteamUser {
2888
2888
  }
2889
2889
 
2890
2890
  async setupProfile () {
2891
- const profile = await this._httpRequest(`/edit?welcomed=1`)
2891
+ const profile = await this._httpRequest(`${this._myProfile}/edit?welcomed=1`)
2892
2892
  if (!profile.data) {
2893
2893
  return false
2894
2894
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.2.05",
3
+ "version": "1.2.07",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "axios": "^1.3.4",