Change gameID (Deprecated) to game

This commit is contained in:
abalabahaha
2016-01-04 20:46:28 -08:00
parent 69bffc6279
commit 404829a19d
9 changed files with 30 additions and 24 deletions

View File

@@ -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));
}

View File

@@ -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