diff --git a/classes/CSteamGroup.js b/classes/CSteamGroup.js index 69828f7..680ed4c 100644 --- a/classes/CSteamGroup.js +++ b/classes/CSteamGroup.js @@ -117,3 +117,7 @@ CSteamGroup.prototype.getHistory = function(page, callback) { CSteamGroup.prototype.getAllComments = function(from, count, callback) { this._community.getAllGroupComments(this.steamID, from, count, callback); }; + +CSteamGroup.prototype.deleteComment = function(cid, callback) { + this._community.deleteGroupComment(this.steamID, cid, callback); +}; diff --git a/components/groups.js b/components/groups.js index 86ba37c..ffe7fea 100644 --- a/components/groups.js +++ b/components/groups.js @@ -558,4 +558,27 @@ SteamCommunity.prototype.getAllGroupComments = function(gid, from, count, callba callback(null, comments); }, "steamcommunity"); +}; + +SteamCommunity.prototype.deleteGroupComment = function(gid, cid, callback) { + if(Number.isInteger(cid)) { + callback("Pass the comment id as a string"); + } + + var options = { + uri: "http://steamcommunity.com/comment/Clan/delete/" + gid.getSteamID64() + "/-1/", + form: { + sessionid: this.getSessionID(), + gidcomment: cid + } + }; + + var self = this; + this.httpRequestPost(options, function(err, response, body) { + if(!callback) { + return; + } + + callback(err || null); + }, "steamcommunity"); }; \ No newline at end of file