Merge branch 'master' into feature-get-friends-list

This commit is contained in:
Alex Corn 2021-07-22 03:04:06 -04:00 committed by GitHub
commit 2da6725283
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 62 additions and 0 deletions

61
components/help.js Normal file
View File

@ -0,0 +1,61 @@
const SteamCommunity = require('../index.js');
const Helpers = require('./helpers.js');
/**
* Restore a previously removed steam package from your steam account.
* @param {int|string} packageID
* @param {function} callback
*/
SteamCommunity.prototype.restorePackage = function(packageID, callback) {
this.httpRequestPost({
"uri": "https://help.steampowered.com/wizard/AjaxDoPackageRestore",
"form": {
"packageid": packageID,
"sessionid": this.getSessionID('https://help.steampowered.com'),
"wizard_ajax": 1
},
"json": true
}, (err, res, body) => {
if (err) {
callback(err);
return;
}
if (!body.success) {
callback(body.errorMsg ? new Error(body.errorMsg) : Helpers.eresultError(body.success));
return;
}
callback(null);
});
};
/**
* Remove a steam package from your steam account.
* @param {int|string} packageID
* @param {function} callback
*/
SteamCommunity.prototype.removePackage = function(packageID, callback) {
this.httpRequestPost({
"uri": "https://help.steampowered.com/wizard/AjaxDoPackageRemove",
"form": {
"packageid": packageID,
"sessionid": this.getSessionID('https://help.steampowered.com'),
"wizard_ajax": 1
},
"json": true
}, (err, res, body) => {
if (err) {
callback(err);
return;
}
if (!body.success) {
callback(body.errorMsg ? new Error(body.errorMsg) : Helpers.eresultError(body.success));
return;
}
callback(null);
});
};

View File

@ -577,6 +577,7 @@ require('./components/inventoryhistory.js');
require('./components/webapi.js');
require('./components/twofactor.js');
require('./components/confirmations.js');
require('./components/help.js');
require('./classes/CMarketItem.js');
require('./classes/CMarketSearchResult.js');
require('./classes/CSteamGroup.js');