steamutils 1.1.96 → 1.1.97

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,8 +2,8 @@
2
2
  <module type="WEB_MODULE" version="4">
3
3
  <component name="NewModuleRootManager">
4
4
  <content url="file://$MODULE_DIR$">
5
- <excludeFolder url="file://$MODULE_DIR$/.tmp" />
6
5
  <excludeFolder url="file://$MODULE_DIR$/temp" />
6
+ <excludeFolder url="file://$MODULE_DIR$/.tmp" />
7
7
  <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
8
  </content>
9
9
  <orderEntry type="inheritedJdk" />
package/.idea/vcs.xml CHANGED
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <project version="4">
3
3
  <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
5
  </component>
6
6
  </project>
package/index.js CHANGED
@@ -2699,8 +2699,15 @@ class SteamUser {
2699
2699
  }
2700
2700
 
2701
2701
  //{ invited: [ '76561199277912057' ], success: 1 }
2702
- async addFriendUser (steamID) {
2703
- const { data } = await this._httpRequestAjax({
2702
+ /*
2703
+ * {
2704
+ failed_invites: [ '76561199227727116' ],
2705
+ failed_invites_result: [ 84 ],
2706
+ success: 1
2707
+ }
2708
+ * */
2709
+ async addFriendUser(steamID) {
2710
+ const {data} = await this._httpRequestAjax({
2704
2711
  url: `actions/AddFriendAjax`,
2705
2712
  data: {
2706
2713
  steamid: steamID,
@@ -2712,6 +2719,21 @@ class SteamUser {
2712
2719
  method: 'POST',
2713
2720
  })
2714
2721
 
2722
+ if (data) {
2723
+ const failed_invites_result_message_mapping = {
2724
+ 25: 'Could not invite %s. Your friends list is full.',
2725
+ 15: 'Could not invite %s. Their friends list is full.',
2726
+ 40: 'Error adding Friend. Communication between you and this user has been blocked.',
2727
+ 11: 'You are blocking all communication with this user. Before communicating with this user, you must unblock them by visiting their Steam Community Profile.',
2728
+ 84: `It looks like you've sent too many friend invites. To prevent spam, you'll have to wait before you can invite more friends. Please note that other players can still add you during this time.`,
2729
+ 24: `Your account does not meet the requirements to use this feature. Visit Steam Support for more information.`,
2730
+ }
2731
+ const failed_invites_result = data?.failed_invites_result?.[0]
2732
+ if (failed_invites_result && failed_invites_result_message_mapping[failed_invites_result]) {
2733
+ data.failed_invites_result_message = failed_invites_result_message_mapping[failed_invites_result]
2734
+ }
2735
+ }
2736
+
2715
2737
  return data
2716
2738
  }
2717
2739
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.1.96",
3
+ "version": "1.1.97",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "axios": "^1.3.4",
@@ -1,5 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <state>
3
- <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
- </state>
5
- </component>