mirror of
https://github.com/danbulant/discord.js
synced 2026-06-10 02:02:40 +00:00
Clean up status type error
This commit is contained in:
parent
e24c9c271e
commit
8d777db1d1
1 changed files with 2 additions and 5 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue