From f09adc84a400f538c0a7967cbf416c40328c5ff0 Mon Sep 17 00:00:00 2001 From: 3urobeat <35304405+HerrEurobeat@users.noreply.github.com> Date: Fri, 12 May 2023 23:30:10 +0200 Subject: [PATCH] Add (disabled) sharedfile favorite support --- components/sharedfiles.js | 44 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/components/sharedfiles.js b/components/sharedfiles.js index 0d0a6b9..13ac48a 100644 --- a/components/sharedfiles.js +++ b/components/sharedfiles.js @@ -31,6 +31,28 @@ SteamCommunity.prototype.deleteSharedfileComment = function(userID, sid, cid, ca }, "steamcommunity"); }; +/** + * Favorites a sharedfile + * @param {String} sid - ID of the sharedfile + * @param {function} callback - Takes only an Error object/null as the first argument + */ +/* SteamCommunity.prototype.favoriteSharedfile = function(sid, callback) { + this.httpRequestPost({ + "uri": "https://steamcommunity.com/sharedfiles/favorite", + "form": { + "id": sid, + "appid": , // TODO: How to get appid the sharedfile is associated to? + "sessionid": this.getSessionID() + } + }, function(err, response, body) { + if (!callback) { + return; + } + + callback(null || err); + }, "steamcommunity"); +}; */ + /** * Posts a comment to a sharedfile * @param {SteamID | String} userID - ID of the user associated to this sharedfile @@ -85,6 +107,28 @@ Bot.prototype.subscribeSharedfileComments = function(userID, sid, callback) { }, "steamcommunity"); }; +/** + * Unfavorites a sharedfile + * @param {String} sid - ID of the sharedfile + * @param {function} callback - Takes only an Error object/null as the first argument + */ +/* SteamCommunity.prototype.unfavoriteSharedfile = function(sid, callback) { + this.httpRequestPost({ + "uri": "https://steamcommunity.com/sharedfiles/unfavorite", + "form": { + "id": sid, + "appid": , // TODO: How to get appid the sharedfile is associated to? + "sessionid": this.getSessionID() + } + }, function(err, response, body) { + 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