Merge pull request #211 from Hongarc/master

Add comment group
This commit is contained in:
Alex Corn 2019-02-12 21:35:58 -05:00 committed by GitHub
commit e05efabcb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 0 deletions

View File

@ -123,6 +123,10 @@ CSteamGroup.prototype.deleteComment = function(cid, callback) {
this._community.deleteGroupComment(this.steamID, cid, callback); this._community.deleteGroupComment(this.steamID, cid, callback);
}; };
CSteamGroup.prototype.comment = function(message, callback) {
this._community.postGroupComment(this.steamID, message, callback);
};
/** /**
* Get requests to join this restricted group. * Get requests to join this restricted group.
* @param {function} callback - First argument is null/Error, second is array of SteamID objects * @param {function} callback - First argument is null/Error, second is array of SteamID objects

View File

@ -591,6 +591,30 @@ SteamCommunity.prototype.deleteGroupComment = function(gid, cid, callback) {
}, "steamcommunity"); }, "steamcommunity");
}; };
SteamCommunity.prototype.postGroupComment = function(gid, message, callback) {
if (typeof gid === 'string') {
gid = new SteamID(gid);
}
var options = {
"uri": "https://steamcommunity.com/comment/Clan/post/" + gid.getSteamID64() + "/-1/",
"form": {
"comment": message,
"count": 6,
"sessionid": this.getSessionID()
}
};
var self = this;
this.httpRequestPost(options, function(err, response, body) {
if(!callback) {
return;
}
callback(err || null);
}, "steamcommunity");
};
/** /**
* Get requests to join a restricted group. * Get requests to join a restricted group.
* @param {SteamID|string} gid - The SteamID of the group you want to manage * @param {SteamID|string} gid - The SteamID of the group you want to manage