Added language argument to getUserInventoryContents

This commit is contained in:
Alexander Corn 2017-06-15 10:04:37 -04:00
parent 3045a5d0cc
commit b5142ad0cc
3 changed files with 14 additions and 4 deletions

1
.npmrc Normal file
View File

@ -0,0 +1 @@
package-lock=false

View File

@ -340,15 +340,21 @@ SteamCommunity.prototype.getUserInventory = function(userID, appID, contextID, t
* @param {int} appID - The Steam application ID of the game for which you want an inventory
* @param {int} contextID - The ID of the "context" within the game you want to retrieve
* @param {boolean} tradableOnly - true to get only tradable items and currencies
* @param {string} [language] - The language of item descriptions to return. Omit for default (which may either be English or your account's chosen language)
* @param {function} callback
*/
SteamCommunity.prototype.getUserInventoryContents = function(userID, appID, contextID, tradableOnly, callback) {
SteamCommunity.prototype.getUserInventoryContents = function(userID, appID, contextID, tradableOnly, language, callback) {
var self = this;
if(typeof userID === 'string') {
if (typeof userID === 'string') {
userID = new SteamID(userID);
}
if (typeof language === 'function') {
callback = language;
language = "english";
}
var pos = 1;
get([], []);
@ -359,7 +365,7 @@ SteamCommunity.prototype.getUserInventoryContents = function(userID, appID, cont
"Referer": "https://steamcommunity.com/profiles/" + userID.getSteamID64() + "/inventory"
},
"qs": {
"l": "english", // Default language
"l": language, // Default language
"count": 5000, // Max items per 'page'
"start_assetid": start
},

View File

@ -2,7 +2,10 @@
"name": "steamcommunity",
"version": "3.30.7",
"description": "Provides an interface for logging into and interacting with the Steam Community website",
"keywords": ["steam", "steam community"],
"keywords": [
"steam",
"steam community"
],
"homepage": "https://github.com/DoctorMcKay/node-steamcommunity",
"bugs": {
"url": "https://github.com/DoctorMcKay/node-steamcommunity/issues"