Clean up status type error

This commit is contained in:
Schuyler Cebulskie
2016-10-03 20:27:41 -04:00
parent e24c9c271e
commit 8d777db1d1

View File

@@ -125,7 +125,7 @@ class ClientUser extends User {
*/ */
setPresence(data) { setPresence(data) {
// {"op":3,"d":{"status":"dnd","since":0,"game":null,"afk":false}} // {"op":3,"d":{"status":"dnd","since":0,"game":null,"afk":false}}
return new Promise((resolve, reject) => { return new Promise(resolve => {
let status = this.localPresence.status || this.presence.status; let status = this.localPresence.status || this.presence.status;
let game = this.localPresence.game; let game = this.localPresence.game;
let afk = this.localPresence.afk || this.presence.afk; let afk = this.localPresence.afk || this.presence.afk;
@@ -139,10 +139,7 @@ class ClientUser extends User {
} }
if (data.status) { if (data.status) {
if (typeof data.status !== 'string') { if (typeof data.status !== 'string') throw new TypeError('Status must be a string');
reject(new TypeError('status must be a string'));
return;
}
status = data.status; status = data.status;
} }