mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 17:43:30 +01:00
Change gameID (Deprecated) to game
This commit is contained in:
@@ -428,18 +428,18 @@ var Client = (function (_EventEmitter) {
|
||||
|
||||
// def setStatus
|
||||
|
||||
Client.prototype.setStatus = function setStatus(idleStatus, gameID) {
|
||||
Client.prototype.setStatus = function setStatus(idleStatus, game) {
|
||||
var callback = arguments.length <= 2 || arguments[2] === undefined ? function () /*err, {}*/{} : arguments[2];
|
||||
|
||||
if (typeof gameID === "function") {
|
||||
// gameID is the callback
|
||||
callback = gameID;
|
||||
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).then(dataCallback(callback), errorCallback(callback));
|
||||
return this.internal.setStatus(idleStatus, game).then(dataCallback(callback), errorCallback(callback));
|
||||
};
|
||||
|
||||
// def sendTyping
|
||||
|
||||
@@ -1555,8 +1555,8 @@ var InternalClient = (function () {
|
||||
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
|
||||
client.emit("userUpdated", user, presenceUser);
|
||||
|
||||
@@ -112,7 +112,7 @@ var Server = (function (_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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ var User = (function (_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
|
||||
@@ -48,7 +48,7 @@ var User = (function (_Equality) {
|
||||
};
|
||||
|
||||
User.prototype.equalsStrict = function equalsStrict(obj) {
|
||||
if (obj instanceof User) return this.id === obj.id && this.username === obj.username && this.discriminator === obj.discriminator && this.avatar === obj.avatar && this.status === obj.status && this.gameID === obj.gameID;else return false;
|
||||
if (obj instanceof User) return this.id === obj.id && this.username === obj.username && this.discriminator === obj.discriminator && this.avatar === obj.avatar && this.status === obj.status && this.game && obj.game && this.game.name === obj.game.name;else return false;
|
||||
};
|
||||
|
||||
User.prototype.equals = function equals(obj) {
|
||||
|
||||
Reference in New Issue
Block a user