mirror of
https://github.com/danbulant/discord.js
synced 2026-05-25 04:52:22 +00:00
added .oldStatus to presence update
This commit is contained in:
parent
083ed54274
commit
eb539015ca
2 changed files with 4 additions and 2 deletions
|
|
@ -1083,13 +1083,14 @@ var Client = (function () {
|
|||
var presenceUser = new User(data.user);
|
||||
if (presenceUser.equalsStrict(userInCache)) {
|
||||
//they're exactly the same, an actual presence update
|
||||
userInCache.status = data.status;
|
||||
self.trigger("presence", {
|
||||
user: userInCache,
|
||||
oldStatus: userInCache.status,
|
||||
status: data.status,
|
||||
server: self.getServer("id", data.guild_id),
|
||||
gameId: data.game_id
|
||||
});
|
||||
userInCache.status = data.status;
|
||||
} else {
|
||||
//one of their details changed.
|
||||
self.userCache[self.userCache.indexOf(userInCache)] = presenceUser;
|
||||
|
|
|
|||
|
|
@ -992,13 +992,14 @@ class Client {
|
|||
var presenceUser = new User(data.user);
|
||||
if (presenceUser.equalsStrict(userInCache)) {
|
||||
//they're exactly the same, an actual presence update
|
||||
userInCache.status = data.status;
|
||||
self.trigger("presence", {
|
||||
user: userInCache,
|
||||
oldStatus : userInCache.status,
|
||||
status: data.status,
|
||||
server: self.getServer("id", data.guild_id),
|
||||
gameId: data.game_id
|
||||
});
|
||||
userInCache.status = data.status;
|
||||
} else {
|
||||
//one of their details changed.
|
||||
self.userCache[self.userCache.indexOf(userInCache)] = presenceUser;
|
||||
|
|
|
|||
Loading…
Reference in a new issue