mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
Change gameID (Deprecated) to game
This commit is contained in:
@@ -350,16 +350,16 @@ export default class Client extends EventEmitter {
|
||||
}
|
||||
|
||||
// def setStatus
|
||||
setStatus(idleStatus, gameID, callback = (/*err, {}*/) => { }) {
|
||||
if (typeof gameID === "function") {
|
||||
// gameID is the callback
|
||||
callback = gameID;
|
||||
setStatus(idleStatus, game, callback = (/*err, {}*/) => { }) {
|
||||
if (typeof game === "function") {
|
||||
// game is the callback
|
||||
callback = game;
|
||||
} else if (typeof idleStatus === "function") {
|
||||
// idleStatus is the callback
|
||||
callback = idleStatus;
|
||||
}
|
||||
|
||||
return this.internal.setStatus(idleStatus, gameID)
|
||||
return this.internal.setStatus(idleStatus, game)
|
||||
.then(dataCallback(callback), errorCallback(callback));
|
||||
}
|
||||
|
||||
|
||||
@@ -1371,8 +1371,8 @@ export default class InternalClient {
|
||||
if (presenceUser.equals(user)) {
|
||||
// a real presence update
|
||||
user.status = data.status;
|
||||
user.gameID = data.game_id;
|
||||
client.emit("presence", user, data.status, data.game_id);
|
||||
user.game = data.game;
|
||||
client.emit("presence", user, data.status, data.game);
|
||||
|
||||
} else {
|
||||
// a name change or avatar change
|
||||
|
||||
@@ -65,7 +65,7 @@ export default class Server extends Equality {
|
||||
var user = client.internal.users.get("id", presence.user.id);
|
||||
if (user) {
|
||||
user.status = presence.status;
|
||||
user.gameID = presence.game_id;
|
||||
user.game = presence.game;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ export default class User extends Equality{
|
||||
this.id = data.id;
|
||||
this.avatar = data.avatar;
|
||||
this.status = data.status || "offline";
|
||||
this.gameID = data.game_id || null;
|
||||
this.game = data.game || null;
|
||||
this.typing = {
|
||||
since : null,
|
||||
channel : null
|
||||
@@ -49,7 +49,7 @@ export default class User extends Equality{
|
||||
this.discriminator === obj.discriminator &&
|
||||
this.avatar === obj.avatar &&
|
||||
this.status === obj.status &&
|
||||
this.gameID === obj.gameID
|
||||
(this.game && obj.game && this.game.name === obj.game.name)
|
||||
);
|
||||
else
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user