mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2024-12-29 16:10:12 +08:00
Add ability to get user aliases
This commit is contained in:
parent
3ba0a8592e
commit
89a1df67ec
@ -150,6 +150,10 @@ CSteamUser.prototype.inviteToGroup = function(groupID, callback) {
|
||||
this._community.inviteUserToGroup(this.steamID, groupID, callback);
|
||||
};
|
||||
|
||||
CSteamUser.prototype.getAliases = function(callback) {
|
||||
this._community.getUserAliases(this.steamID, callback);
|
||||
};
|
||||
|
||||
CSteamUser.prototype.getInventoryContexts = function(callback) {
|
||||
this._community.getUserInventoryContexts(this.steamID, callback);
|
||||
};
|
||||
|
@ -190,6 +190,32 @@ SteamCommunity.prototype.inviteUserToGroup = function(userID, groupID, callback)
|
||||
}, "steamcommunity");
|
||||
};
|
||||
|
||||
SteamCommunity.prototype.getUserAliases = function(userID, callback) {
|
||||
if(typeof userID === 'string') {
|
||||
userID = new SteamID(userID);
|
||||
}
|
||||
|
||||
var endpoint = "/profiles/" + userID.getSteamID64();
|
||||
|
||||
var self = this;
|
||||
this.httpRequestGet({
|
||||
"uri": "https://steamcommunity.com" + endpoint + "/ajaxaliases",
|
||||
"json": true
|
||||
}, function(err, response, body) {
|
||||
if (err) {
|
||||
callback(err);
|
||||
return;
|
||||
}
|
||||
|
||||
if(typeof body !== 'object') {
|
||||
callback(new Error("Malformed response"));
|
||||
return;
|
||||
}
|
||||
|
||||
callback(null, body);
|
||||
}, "steamcommunity");
|
||||
};
|
||||
|
||||
SteamCommunity.prototype.getUserInventoryContexts = function(userID, callback) {
|
||||
if(typeof userID === 'string') {
|
||||
userID = new SteamID(userID);
|
||||
|
Loading…
Reference in New Issue
Block a user