mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2025-03-05 08:22:35 +08:00
Merge pull request #174 from Unsigno/master
Updated getUserInventoryContexts
This commit is contained in:
commit
7beef548dc
@ -241,7 +241,18 @@ SteamCommunity.prototype.getUserInventoryContexts = function(userID, callback) {
|
|||||||
|
|
||||||
var match = body.match(/var g_rgAppContextData = ([^\n]+);\r?\n/);
|
var match = body.match(/var g_rgAppContextData = ([^\n]+);\r?\n/);
|
||||||
if (!match) {
|
if (!match) {
|
||||||
callback(new Error(body.match(/inventory is currently private\./) ? "Private inventory" : "Malformed response"));
|
var errorMessage = "Malformed response";
|
||||||
|
|
||||||
|
if(body.match(/0 items in their inventory\./)){
|
||||||
|
callback(null, {});
|
||||||
|
return;
|
||||||
|
}else if(body.match(/inventory is currently private\./)){
|
||||||
|
errorMessage = "Private inventory";
|
||||||
|
}else if(body.match(/profile\_private\_info/)){
|
||||||
|
errorMessage = "Private profile";
|
||||||
|
}
|
||||||
|
|
||||||
|
callback(new Error(errorMessage));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user