diff --git a/classes/CSteamGroup.js b/classes/CSteamGroup.js index c18889f..8440987 100644 --- a/classes/CSteamGroup.js +++ b/classes/CSteamGroup.js @@ -123,6 +123,10 @@ CSteamGroup.prototype.deleteComment = function(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. * @param {function} callback - First argument is null/Error, second is array of SteamID objects diff --git a/components/groups.js b/components/groups.js index 5bd42b4..d4906de 100644 --- a/components/groups.js +++ b/components/groups.js @@ -591,6 +591,30 @@ SteamCommunity.prototype.deleteGroupComment = function(gid, cid, callback) { }, "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. * @param {SteamID|string} gid - The SteamID of the group you want to manage