steamcommunity 3.43.0 → 3.44.1

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.
@@ -1,8 +1,5 @@
1
1
  <component name="ProjectCodeStyleConfiguration">
2
2
  <code_scheme name="Project" version="173">
3
- <XML>
4
- <option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
5
- </XML>
6
3
  <codeStyleSettings language="JSON">
7
4
  <indentOptions>
8
5
  <option name="USE_TAB_CHARACTER" value="true" />
@@ -1,5 +1,6 @@
1
1
  <component name="ProjectCodeStyleConfiguration">
2
2
  <state>
3
+ <option name="USE_PER_PROJECT_SETTINGS" value="true" />
3
4
  <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
4
5
  </state>
5
6
  </component>
package/.idea/modules.xml CHANGED
@@ -2,6 +2,7 @@
2
2
  <project version="4">
3
3
  <component name="ProjectModuleManager">
4
4
  <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/../node-steamcommunity Wiki/.idea/node-steamcommunity Wiki.iml" filepath="$PROJECT_DIR$/../node-steamcommunity Wiki/.idea/node-steamcommunity Wiki.iml" />
5
6
  <module fileurl="file://$PROJECT_DIR$/.idea/steamcommunity.iml" filepath="$PROJECT_DIR$/.idea/steamcommunity.iml" />
6
7
  </modules>
7
8
  </component>
@@ -5,5 +5,6 @@
5
5
  <content url="file://$MODULE_DIR$" />
6
6
  <orderEntry type="inheritedJdk" />
7
7
  <orderEntry type="sourceFolder" forTests="false" />
8
+ <orderEntry type="module" module-name="node-steamcommunity Wiki" />
8
9
  </component>
9
10
  </module>
package/.idea/vcs.xml CHANGED
@@ -2,5 +2,6 @@
2
2
  <project version="4">
3
3
  <component name="VcsDirectoryMappings">
4
4
  <mapping directory="" vcs="Git" />
5
+ <mapping directory="$PROJECT_DIR$/../node-steamcommunity Wiki" vcs="Git" />
5
6
  </component>
6
7
  </project>
@@ -1,155 +1,155 @@
1
- var SteamCommunity = require('../index.js');
2
- var Helpers = require('../components/helpers.js');
3
- var SteamID = require('steamid');
4
- var xml2js = require('xml2js');
5
-
6
- SteamCommunity.prototype.getSteamGroup = function(id, callback) {
7
- if(typeof id !== 'string' && !Helpers.isSteamID(id)) {
8
- throw new Error("id parameter should be a group URL string or a SteamID object");
9
- }
10
-
11
- if(typeof id === 'object' && (id.universe != SteamID.Universe.PUBLIC || id.type != SteamID.Type.CLAN)) {
12
- throw new Error("SteamID must stand for a clan account in the public universe");
13
- }
14
-
15
- var self = this;
16
- this.httpRequest("https://steamcommunity.com/" + (typeof id === 'string' ? "groups/" + id : "gid/" + id.toString()) + "/memberslistxml/?xml=1", function(err, response, body) {
17
- if (err) {
18
- callback(err);
19
- return;
20
- }
21
-
22
- xml2js.parseString(body, function(err, result) {
23
- if(err) {
24
- callback(err);
25
- return;
26
- }
27
-
28
- callback(null, new CSteamGroup(self, result.memberList));
29
- });
30
- }, "steamcommunity");
31
- };
32
-
33
- function CSteamGroup(community, groupData) {
34
- this._community = community;
35
-
36
- this.steamID = new SteamID(groupData.groupID64[0]);
37
- this.name = groupData.groupDetails[0].groupName[0];
38
- this.url = groupData.groupDetails[0].groupURL[0];
39
- this.headline = groupData.groupDetails[0].headline[0];
40
- this.summary = groupData.groupDetails[0].summary[0];
41
- this.avatarHash = groupData.groupDetails[0].avatarIcon[0].match(/([0-9a-f]+)\.jpg$/)[1];
42
- this.members = parseInt(groupData.groupDetails[0].memberCount[0], 10);
43
- this.membersInChat = parseInt(groupData.groupDetails[0].membersInChat[0], 10);
44
- this.membersInGame = parseInt(groupData.groupDetails[0].membersInGame[0], 10);
45
- this.membersOnline = parseInt(groupData.groupDetails[0].membersOnline[0], 10);
46
- }
47
-
48
- CSteamGroup.prototype.getAvatarURL = function(size, protocol) {
49
- size = size || '';
50
- protocol = protocol || 'http://';
51
-
52
- var url = protocol + "steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/" + this.avatarHash.substring(0, 2) + "/" + this.avatarHash;
53
- if(size == 'full' || size == 'medium') {
54
- return url + "_" + size + ".jpg";
55
- } else {
56
- return url + ".jpg";
57
- }
58
- };
59
-
60
- CSteamGroup.prototype.getMembers = function(addresses, callback) {
61
- if(typeof addresses === 'function') {
62
- callback = addresses;
63
- addresses = null;
64
- }
65
-
66
- this._community.getGroupMembers(this.steamID, callback, null, null, addresses, 0);
67
- };
68
-
69
- CSteamGroup.prototype.join = function(callback) {
70
- this._community.joinGroup(this.steamID, callback);
71
- };
72
-
73
- CSteamGroup.prototype.leave = function(callback) {
74
- this._community.leaveGroup(this.steamID, callback);
75
- };
76
-
77
- CSteamGroup.prototype.getAllAnnouncements = function(time, callback) {
78
- this._community.getAllGroupAnnouncements(this.steamID, time, callback);
79
- };
80
-
81
- CSteamGroup.prototype.postAnnouncement = function(headline, content, hidden, callback) {
82
- this._community.postGroupAnnouncement(this.steamID, headline, content, hidden, callback);
83
- };
84
-
85
- CSteamGroup.prototype.editAnnouncement = function(annoucementID, headline, content, callback) {
86
- this._community.editGroupAnnouncement(this.steamID, annoucementID, headline, content, callback)
87
- };
88
-
89
- CSteamGroup.prototype.deleteAnnouncement = function(annoucementID, callback) {
90
- this._community.deleteGroupAnnouncement(this.steamID, annoucementID, callback)
91
- };
92
-
93
- CSteamGroup.prototype.scheduleEvent = function(name, type, description, time, server, callback) {
94
- this._community.scheduleGroupEvent(this.steamID, name, type, description, time, server, callback);
95
- };
96
-
97
- CSteamGroup.prototype.editEvent = function(id, name, type, description, time, server, callback) {
98
- this._community.editGroupEvent(this.steamID, id, name, type, description, time, server, callback);
99
- };
100
-
101
- CSteamGroup.prototype.deleteEvent = function (id, callback) {
102
- this._community.deleteGroupEvent(this.steamID, id, callback);
103
- };
104
-
105
- CSteamGroup.prototype.setPlayerOfTheWeek = function(steamID, callback) {
106
- this._community.setGroupPlayerOfTheWeek(this.steamID, steamID, callback);
107
- };
108
-
109
- CSteamGroup.prototype.kick = function(steamID, callback) {
110
- this._community.kickGroupMember(this.steamID, steamID, callback);
111
- };
112
-
113
- CSteamGroup.prototype.getHistory = function(page, callback) {
114
- this._community.getGroupHistory(this.steamID, page, callback);
115
- };
116
-
117
-
118
- CSteamGroup.prototype.getAllComments = function(from, count, callback) {
119
- this._community.getAllGroupComments(this.steamID, from, count, callback);
120
- };
121
-
122
- CSteamGroup.prototype.deleteComment = function(cid, callback) {
123
- this._community.deleteGroupComment(this.steamID, cid, callback);
124
- };
125
-
126
- CSteamGroup.prototype.comment = function(message, callback) {
127
- this._community.postGroupComment(this.steamID, message, callback);
128
- };
129
-
130
- /**
131
- * Get requests to join this restricted group.
132
- * @param {function} callback - First argument is null/Error, second is array of SteamID objects
133
- */
134
- CSteamGroup.prototype.getJoinRequests = function(callback) {
135
- this._community.getGroupJoinRequests(this.steamID, callback);
136
- };
137
-
138
- /**
139
- * Respond to one or more join requests to this restricted group.
140
- * @param {SteamID|string|SteamID[]|string[]} steamIDs - The SteamIDs of the users you want to approve or deny membership for (or a single value)
141
- * @param {boolean} approve - True to put them in the group, false to deny their membership
142
- * @param {function} callback - Takes only an Error object/null as the first argument
143
- */
144
- CSteamGroup.prototype.respondToJoinRequests = function(steamIDs, approve, callback) {
145
- this._community.respondToGroupJoinRequests(this.steamID, steamIDs, approve, callback);
146
- };
147
-
148
- /**
149
- * Respond to *ALL* pending group-join requests for this group.
150
- * @param {boolean} approve - True to allow everyone who requested into the group, false to not
151
- * @param {function} callback - Takes only an Error object/null as the first argument
152
- */
153
- CSteamGroup.prototype.respondToAllJoinRequests = function(approve, callback) {
154
- this._community.respondToAllGroupJoinRequests(this.steamID, approve, callback);
155
- };
1
+ var SteamCommunity = require('../index.js');
2
+ var Helpers = require('../components/helpers.js');
3
+ var SteamID = require('steamid');
4
+ var xml2js = require('xml2js');
5
+
6
+ SteamCommunity.prototype.getSteamGroup = function(id, callback) {
7
+ if(typeof id !== 'string' && !Helpers.isSteamID(id)) {
8
+ throw new Error("id parameter should be a group URL string or a SteamID object");
9
+ }
10
+
11
+ if(typeof id === 'object' && (id.universe != SteamID.Universe.PUBLIC || id.type != SteamID.Type.CLAN)) {
12
+ throw new Error("SteamID must stand for a clan account in the public universe");
13
+ }
14
+
15
+ var self = this;
16
+ this.httpRequest("https://steamcommunity.com/" + (typeof id === 'string' ? "groups/" + id : "gid/" + id.toString()) + "/memberslistxml/?xml=1", function(err, response, body) {
17
+ if (err) {
18
+ callback(err);
19
+ return;
20
+ }
21
+
22
+ xml2js.parseString(body, function(err, result) {
23
+ if(err) {
24
+ callback(err);
25
+ return;
26
+ }
27
+
28
+ callback(null, new CSteamGroup(self, result.memberList));
29
+ });
30
+ }, "steamcommunity");
31
+ };
32
+
33
+ function CSteamGroup(community, groupData) {
34
+ this._community = community;
35
+
36
+ this.steamID = new SteamID(groupData.groupID64[0]);
37
+ this.name = groupData.groupDetails[0].groupName[0];
38
+ this.url = groupData.groupDetails[0].groupURL[0];
39
+ this.headline = groupData.groupDetails[0].headline[0];
40
+ this.summary = groupData.groupDetails[0].summary[0];
41
+ this.avatarHash = groupData.groupDetails[0].avatarIcon[0].match(/([0-9a-f]+)\.jpg$/)[1];
42
+ this.members = parseInt(groupData.groupDetails[0].memberCount[0], 10);
43
+ this.membersInChat = parseInt(groupData.groupDetails[0].membersInChat[0], 10);
44
+ this.membersInGame = parseInt(groupData.groupDetails[0].membersInGame[0], 10);
45
+ this.membersOnline = parseInt(groupData.groupDetails[0].membersOnline[0], 10);
46
+ }
47
+
48
+ CSteamGroup.prototype.getAvatarURL = function(size, protocol) {
49
+ size = size || '';
50
+ protocol = protocol || 'http://';
51
+
52
+ var url = protocol + "steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/" + this.avatarHash.substring(0, 2) + "/" + this.avatarHash;
53
+ if(size == 'full' || size == 'medium') {
54
+ return url + "_" + size + ".jpg";
55
+ } else {
56
+ return url + ".jpg";
57
+ }
58
+ };
59
+
60
+ CSteamGroup.prototype.getMembers = function(addresses, callback) {
61
+ if(typeof addresses === 'function') {
62
+ callback = addresses;
63
+ addresses = null;
64
+ }
65
+
66
+ this._community.getGroupMembers(this.steamID, callback, null, null, addresses, 0);
67
+ };
68
+
69
+ CSteamGroup.prototype.join = function(callback) {
70
+ this._community.joinGroup(this.steamID, callback);
71
+ };
72
+
73
+ CSteamGroup.prototype.leave = function(callback) {
74
+ this._community.leaveGroup(this.steamID, callback);
75
+ };
76
+
77
+ CSteamGroup.prototype.getAllAnnouncements = function(time, callback) {
78
+ this._community.getAllGroupAnnouncements(this.steamID, time, callback);
79
+ };
80
+
81
+ CSteamGroup.prototype.postAnnouncement = function(headline, content, hidden, callback) {
82
+ this._community.postGroupAnnouncement(this.steamID, headline, content, hidden, callback);
83
+ };
84
+
85
+ CSteamGroup.prototype.editAnnouncement = function(annoucementID, headline, content, callback) {
86
+ this._community.editGroupAnnouncement(this.steamID, annoucementID, headline, content, callback)
87
+ };
88
+
89
+ CSteamGroup.prototype.deleteAnnouncement = function(annoucementID, callback) {
90
+ this._community.deleteGroupAnnouncement(this.steamID, annoucementID, callback)
91
+ };
92
+
93
+ CSteamGroup.prototype.scheduleEvent = function(name, type, description, time, server, callback) {
94
+ this._community.scheduleGroupEvent(this.steamID, name, type, description, time, server, callback);
95
+ };
96
+
97
+ CSteamGroup.prototype.editEvent = function(id, name, type, description, time, server, callback) {
98
+ this._community.editGroupEvent(this.steamID, id, name, type, description, time, server, callback);
99
+ };
100
+
101
+ CSteamGroup.prototype.deleteEvent = function (id, callback) {
102
+ this._community.deleteGroupEvent(this.steamID, id, callback);
103
+ };
104
+
105
+ CSteamGroup.prototype.setPlayerOfTheWeek = function(steamID, callback) {
106
+ this._community.setGroupPlayerOfTheWeek(this.steamID, steamID, callback);
107
+ };
108
+
109
+ CSteamGroup.prototype.kick = function(steamID, callback) {
110
+ this._community.kickGroupMember(this.steamID, steamID, callback);
111
+ };
112
+
113
+ CSteamGroup.prototype.getHistory = function(page, callback) {
114
+ this._community.getGroupHistory(this.steamID, page, callback);
115
+ };
116
+
117
+
118
+ CSteamGroup.prototype.getAllComments = function(from, count, callback) {
119
+ this._community.getAllGroupComments(this.steamID, from, count, callback);
120
+ };
121
+
122
+ CSteamGroup.prototype.deleteComment = function(cid, callback) {
123
+ this._community.deleteGroupComment(this.steamID, cid, callback);
124
+ };
125
+
126
+ CSteamGroup.prototype.comment = function(message, callback) {
127
+ this._community.postGroupComment(this.steamID, message, callback);
128
+ };
129
+
130
+ /**
131
+ * Get requests to join this restricted group.
132
+ * @param {function} callback - First argument is null/Error, second is array of SteamID objects
133
+ */
134
+ CSteamGroup.prototype.getJoinRequests = function(callback) {
135
+ this._community.getGroupJoinRequests(this.steamID, callback);
136
+ };
137
+
138
+ /**
139
+ * Respond to one or more join requests to this restricted group.
140
+ * @param {SteamID|string|SteamID[]|string[]} steamIDs - The SteamIDs of the users you want to approve or deny membership for (or a single value)
141
+ * @param {boolean} approve - True to put them in the group, false to deny their membership
142
+ * @param {function} callback - Takes only an Error object/null as the first argument
143
+ */
144
+ CSteamGroup.prototype.respondToJoinRequests = function(steamIDs, approve, callback) {
145
+ this._community.respondToGroupJoinRequests(this.steamID, steamIDs, approve, callback);
146
+ };
147
+
148
+ /**
149
+ * Respond to *ALL* pending group-join requests for this group.
150
+ * @param {boolean} approve - True to allow everyone who requested into the group, false to not
151
+ * @param {function} callback - Takes only an Error object/null as the first argument
152
+ */
153
+ CSteamGroup.prototype.respondToAllJoinRequests = function(approve, callback) {
154
+ this._community.respondToAllGroupJoinRequests(this.steamID, approve, callback);
155
+ };