mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 04:53:30 +01:00
Clean up Presence
This commit is contained in:
@@ -13,24 +13,16 @@ class Presence {
|
|||||||
*/
|
*/
|
||||||
this.status = data.status || 'offline';
|
this.status = data.status || 'offline';
|
||||||
|
|
||||||
if (data.game) {
|
/**
|
||||||
/**
|
* The game that the user is playing, `null` if they aren't playing a game.
|
||||||
* The game that the user is playing, `null` if they aren't playing a game.
|
* @type {?Game}
|
||||||
* @type {Game}
|
*/
|
||||||
*/
|
this.game = data.game ? new Game(data.game) : null;
|
||||||
this.game = new Game(data.game);
|
|
||||||
} else {
|
|
||||||
this.game = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
update(data) {
|
update(data) {
|
||||||
this.status = data.status || this.status;
|
this.status = data.status || this.status;
|
||||||
if (data.game) {
|
this.game = data.game ? new Game(data.game) : null;
|
||||||
this.game = new Game(data.game);
|
|
||||||
} else {
|
|
||||||
this.game = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -65,9 +57,9 @@ class Game {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* If the game is being streamed, a link to the stream
|
* If the game is being streamed, a link to the stream
|
||||||
* @type {string}
|
* @type {?string}
|
||||||
*/
|
*/
|
||||||
this.url = data.url;
|
this.url = data.url || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user