diff --git a/components/sharedfiles.js b/components/sharedfiles.js index eda5ea8..cb8f116 100644 --- a/components/sharedfiles.js +++ b/components/sharedfiles.js @@ -55,6 +55,48 @@ SteamCommunity.prototype.postSharedfileComment = function(userID, sid, message, return; } + callback(null || err); + }, "steamcommunity"); +}; + +/** + * Downvotes a sharedfile + * @param {String} sid - ID of the sharedfile + * @param {function} callback - Takes only an Error object/null as the first argument + */ +SteamCommunity.prototype.voteDownSharedfile = function(sid, callback) { + this.httpRequestPost({ + "uri": "https://steamcommunity.com/sharedfiles/votedown", + "form": { + "id": sid, + "sessionid": this.getSessionID() + } + }, function(err, response, body) { + if (!callback) { + return; + } + + callback(null || err); + }, "steamcommunity"); +}; + +/** + * Upvotes a sharedfile + * @param {String} sid - ID of the sharedfile + * @param {function} callback - Takes only an Error object/null as the first argument + */ +SteamCommunity.prototype.voteUpSharedfile = function(sid, callback) { + this.httpRequestPost({ + "uri": "https://steamcommunity.com/sharedfiles/voteup", + "form": { + "id": sid, + "sessionid": this.getSessionID() + } + }, function(err, response, body) { + if (!callback) { + return; + } + callback(null || err); }, "steamcommunity"); }; \ No newline at end of file