Adding .deleteComment()

This commit is contained in:
Jarzon 2017-02-08 12:30:47 -05:00
parent e2dae00af2
commit f7ebe68bd8
2 changed files with 27 additions and 0 deletions

View File

@ -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);
};

View File

@ -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");
};