mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
store gameId on user object
This commit is contained in:
@@ -179,4 +179,4 @@ var ChannelPermissions = (function () {
|
||||
return ChannelPermissions;
|
||||
})();
|
||||
|
||||
module.exports = ChannelPermissions;
|
||||
module.exports = ChannelPermissions;
|
||||
|
||||
@@ -1091,6 +1091,7 @@ var Client = (function () {
|
||||
gameId: data.game_id
|
||||
});
|
||||
userInCache.status = data.status;
|
||||
userInCache.gameId = data.game_id;
|
||||
} else {
|
||||
//one of their details changed.
|
||||
self.userCache[self.userCache.indexOf(userInCache)] = presenceUser;
|
||||
@@ -1288,7 +1289,9 @@ var Client = (function () {
|
||||
for (var _iterator9 = data.presences[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) {
|
||||
var presence = _step9.value;
|
||||
|
||||
self.getUser("id", presence.user.id).status = presence.status;
|
||||
var user = self.getUser("id", presence.user.id);
|
||||
user.status = presence.status;
|
||||
user.gameId = presence.game_id;
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError9 = true;
|
||||
@@ -1864,4 +1867,4 @@ var Client = (function () {
|
||||
return Client;
|
||||
})();
|
||||
|
||||
module.exports = Client;
|
||||
module.exports = Client;
|
||||
|
||||
@@ -10,4 +10,4 @@ exports.LOGIN = exports.AUTH + "/login";
|
||||
exports.LOGOUT = exports.AUTH + "/logout";
|
||||
exports.USERS = exports.API + "/users";
|
||||
exports.SERVERS = exports.API + "/guilds";
|
||||
exports.CHANNELS = exports.API + "/channels";
|
||||
exports.CHANNELS = exports.API + "/channels";
|
||||
|
||||
@@ -169,4 +169,4 @@ var EvaluatedPermissions = (function () {
|
||||
return EvaluatedPermissions;
|
||||
})();
|
||||
|
||||
module.exports = EvaluatedPermissions;
|
||||
module.exports = EvaluatedPermissions;
|
||||
|
||||
@@ -222,4 +222,4 @@ var Member = (function (_User) {
|
||||
return Member;
|
||||
})(User);
|
||||
|
||||
module.exports = Member;
|
||||
module.exports = Member;
|
||||
|
||||
@@ -69,4 +69,4 @@ var PMChannel = (function () {
|
||||
return PMChannel;
|
||||
})();
|
||||
|
||||
module.exports = PMChannel;
|
||||
module.exports = PMChannel;
|
||||
|
||||
@@ -199,4 +199,4 @@ var ServerPermissions = (function () {
|
||||
return ServerPermissions;
|
||||
})();
|
||||
|
||||
module.exports = ServerPermissions;
|
||||
module.exports = ServerPermissions;
|
||||
|
||||
@@ -149,4 +149,4 @@ var Channel = (function () {
|
||||
return Channel;
|
||||
})();
|
||||
|
||||
module.exports = Channel;
|
||||
module.exports = Channel;
|
||||
|
||||
@@ -9,4 +9,4 @@ var Discord = {
|
||||
Client: Client
|
||||
};
|
||||
|
||||
module.exports = Discord;
|
||||
module.exports = Discord;
|
||||
|
||||
@@ -200,4 +200,4 @@ Internal.XHR.setUsername = function (token, avatar, email, newPassword, password
|
||||
});
|
||||
};
|
||||
|
||||
exports.Internal = Internal;
|
||||
exports.Internal = Internal;
|
||||
|
||||
@@ -32,4 +32,4 @@ var Invite = (function () {
|
||||
return Invite;
|
||||
})();
|
||||
|
||||
module.exports = Invite;
|
||||
module.exports = Invite;
|
||||
|
||||
@@ -82,4 +82,4 @@ var Message = (function () {
|
||||
return Message;
|
||||
})();
|
||||
|
||||
module.exports = Message;
|
||||
module.exports = Message;
|
||||
|
||||
@@ -341,4 +341,4 @@ var Server = (function () {
|
||||
return Server;
|
||||
})();
|
||||
|
||||
module.exports = Server;
|
||||
module.exports = Server;
|
||||
|
||||
@@ -13,6 +13,7 @@ var User = (function () {
|
||||
this.id = data.id;
|
||||
this.avatar = data.avatar;
|
||||
this.status = data.status || "offline";
|
||||
this.gameId = data.game_id || null;
|
||||
}
|
||||
|
||||
// access using user.avatarURL;
|
||||
@@ -54,4 +55,4 @@ var User = (function () {
|
||||
return User;
|
||||
})();
|
||||
|
||||
module.exports = User;
|
||||
module.exports = User;
|
||||
|
||||
@@ -1000,6 +1000,7 @@ class Client {
|
||||
gameId: data.game_id
|
||||
});
|
||||
userInCache.status = data.status;
|
||||
userInCache.gameId = data.game_id;
|
||||
} else {
|
||||
//one of their details changed.
|
||||
self.userCache[self.userCache.indexOf(userInCache)] = presenceUser;
|
||||
@@ -1168,7 +1169,9 @@ class Client {
|
||||
}
|
||||
|
||||
for (var presence of data.presences) {
|
||||
self.getUser("id", presence.user.id).status = presence.status;
|
||||
var user = self.getUser("id", presence.user.id);
|
||||
user.status = presence.status;
|
||||
user.gameId = presence.game_id;
|
||||
}
|
||||
|
||||
return server;
|
||||
|
||||
@@ -5,6 +5,7 @@ class User{
|
||||
this.id = data.id;
|
||||
this.avatar = data.avatar;
|
||||
this.status = data.status || "offline";
|
||||
this.gameId = data.game_id || null;
|
||||
}
|
||||
|
||||
// access using user.avatarURL;
|
||||
|
||||
Reference in New Issue
Block a user