mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2025-03-14 15:00:07 +08:00
Add sharedfile subscribing support
This commit is contained in:
parent
18011b3fac
commit
d807f10653
@ -59,6 +59,58 @@ SteamCommunity.prototype.postSharedfileComment = function(userID, sid, message,
|
||||
}, "steamcommunity");
|
||||
};
|
||||
|
||||
/**
|
||||
* Subscribes to a sharedfile's comment section. Note: Checkbox on webpage does not update
|
||||
* @param {SteamID | String} userID ID of the user associated to this sharedfile
|
||||
* @param {String} sid ID of the sharedfileof
|
||||
* @param {function} callback - Takes only an Error object/null as the first argument
|
||||
*/
|
||||
Bot.prototype.subscribeSharedfileComments = function(userID, sid, callback) {
|
||||
if (typeof userID === "string") {
|
||||
userID = new SteamID(userID);
|
||||
}
|
||||
|
||||
this.httpRequestPost({
|
||||
"uri": `https://steamcommunity.com/comment/PublishedFile_Public/subscribe/${userID.toString()}/${sid}/`,
|
||||
"form": {
|
||||
"count": 10,
|
||||
"sessionid": this.getSessionID()
|
||||
}
|
||||
}, function(err, response, body) { // eslint-disable-line
|
||||
if (!callback) {
|
||||
return;
|
||||
}
|
||||
|
||||
callback(null || err);
|
||||
}, "steamcommunity");
|
||||
};
|
||||
|
||||
/**
|
||||
* Unsubscribes from a sharedfile's comment section. Note: Checkbox on webpage does not update
|
||||
* @param {SteamID | String} userID - ID of the user associated to this sharedfile
|
||||
* @param {String} sid - ID of the sharedfileof
|
||||
* @param {function} callback - Takes only an Error object/null as the first argument
|
||||
*/
|
||||
Bot.prototype.unsubscribeSharedfileComments = function(userID, sid, callback) {
|
||||
if (typeof userID === "string") {
|
||||
userID = new SteamID(userID);
|
||||
}
|
||||
|
||||
this.httpRequestPost({
|
||||
"uri": `https://steamcommunity.com/comment/PublishedFile_Public/unsubscribe/${userID.toString()}/${sid}/`,
|
||||
"form": {
|
||||
"count": 10,
|
||||
"sessionid": this.getSessionID()
|
||||
}
|
||||
}, function(err, response, body) { // eslint-disable-line
|
||||
if (!callback) {
|
||||
return;
|
||||
}
|
||||
|
||||
callback(null || err);
|
||||
}, "steamcommunity");
|
||||
};
|
||||
|
||||
/**
|
||||
* Downvotes a sharedfile
|
||||
* @param {String} sid - ID of the sharedfile
|
||||
|
Loading…
Reference in New Issue
Block a user