mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 04:53:30 +01:00
Clean up status type error
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user