mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 03:53:29 +01:00
added .oldStatus to presence update
This commit is contained in:
@@ -1083,13 +1083,14 @@ var Client = (function () {
|
|||||||
var presenceUser = new User(data.user);
|
var presenceUser = new User(data.user);
|
||||||
if (presenceUser.equalsStrict(userInCache)) {
|
if (presenceUser.equalsStrict(userInCache)) {
|
||||||
//they're exactly the same, an actual presence update
|
//they're exactly the same, an actual presence update
|
||||||
userInCache.status = data.status;
|
|
||||||
self.trigger("presence", {
|
self.trigger("presence", {
|
||||||
user: userInCache,
|
user: userInCache,
|
||||||
|
oldStatus: userInCache.status,
|
||||||
status: data.status,
|
status: data.status,
|
||||||
server: self.getServer("id", data.guild_id),
|
server: self.getServer("id", data.guild_id),
|
||||||
gameId: data.game_id
|
gameId: data.game_id
|
||||||
});
|
});
|
||||||
|
userInCache.status = data.status;
|
||||||
} else {
|
} else {
|
||||||
//one of their details changed.
|
//one of their details changed.
|
||||||
self.userCache[self.userCache.indexOf(userInCache)] = presenceUser;
|
self.userCache[self.userCache.indexOf(userInCache)] = presenceUser;
|
||||||
|
|||||||
@@ -992,13 +992,14 @@ class Client {
|
|||||||
var presenceUser = new User(data.user);
|
var presenceUser = new User(data.user);
|
||||||
if (presenceUser.equalsStrict(userInCache)) {
|
if (presenceUser.equalsStrict(userInCache)) {
|
||||||
//they're exactly the same, an actual presence update
|
//they're exactly the same, an actual presence update
|
||||||
userInCache.status = data.status;
|
|
||||||
self.trigger("presence", {
|
self.trigger("presence", {
|
||||||
user: userInCache,
|
user: userInCache,
|
||||||
|
oldStatus : userInCache.status,
|
||||||
status: data.status,
|
status: data.status,
|
||||||
server: self.getServer("id", data.guild_id),
|
server: self.getServer("id", data.guild_id),
|
||||||
gameId: data.game_id
|
gameId: data.game_id
|
||||||
});
|
});
|
||||||
|
userInCache.status = data.status;
|
||||||
} else {
|
} else {
|
||||||
//one of their details changed.
|
//one of their details changed.
|
||||||
self.userCache[self.userCache.indexOf(userInCache)] = presenceUser;
|
self.userCache[self.userCache.indexOf(userInCache)] = presenceUser;
|
||||||
|
|||||||
Reference in New Issue
Block a user