Add sharedfile voting support

This commit is contained in:
3urobeat 2023-05-12 22:10:37 +02:00
parent 6f97370710
commit 18011b3fac
No known key found for this signature in database
GPG Key ID: 6842D80775A4E952

View File

@ -58,3 +58,45 @@ SteamCommunity.prototype.postSharedfileComment = function(userID, sid, message,
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");
};