mirror of
https://github.com/danbulant/discord.js
synced 2026-05-26 13:32:04 +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) {
|
||||
// {"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 game = this.localPresence.game;
|
||||
let afk = this.localPresence.afk || this.presence.afk;
|
||||
|
|
@ -139,10 +139,7 @@ class ClientUser extends User {
|
|||
}
|
||||
|
||||
if (data.status) {
|
||||
if (typeof data.status !== 'string') {
|
||||
reject(new TypeError('status must be a string'));
|
||||
return;
|
||||
}
|
||||
if (typeof data.status !== 'string') throw new TypeError('Status must be a string');
|
||||
status = data.status;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue