mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2025-03-23 21:50:10 +08:00
Added CSteamGroup.join method
This commit is contained in:
parent
7643d2efad
commit
7f2a287c56
@ -90,6 +90,31 @@ CSteamGroup.prototype.getMembers = function(callback, members, link) {
|
||||
});
|
||||
};
|
||||
|
||||
CSteamGroup.prototype.join = function(callback) {
|
||||
var form = {
|
||||
"action": "join",
|
||||
"sessionID": this._community.getSessionID()
|
||||
};
|
||||
|
||||
var self = this;
|
||||
this._community._request.post("https://steamcommunity.com/gid/" + this.steamID.toString(), {"form": form}, function(err, response, body) {
|
||||
if(!callback) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(err || response.statusCode >= 400) {
|
||||
callback(err || "HTTP error " + response.statusCode);
|
||||
return;
|
||||
}
|
||||
|
||||
if(self._community._checkCommunityError(body, callback)) {
|
||||
return;
|
||||
}
|
||||
|
||||
callback(null);
|
||||
});
|
||||
};
|
||||
|
||||
CSteamGroup.prototype.postAnnouncement = function(headline, content, callback) {
|
||||
var form = {
|
||||
"sessionID": this._community.getSessionID(),
|
||||
|
Loading…
Reference in New Issue
Block a user