mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2025-02-06 07:27:03 +08:00
Add sharedfile voting support
This commit is contained in:
parent
6f97370710
commit
18011b3fac
@ -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");
|
||||
};
|
Loading…
Reference in New Issue
Block a user