mirror of
https://github.com/danbulant/discord.js
synced 2026-07-08 12:40:50 +00:00
Fix #1399 (Trying to unset games with values other than null doesn't end up displaying properly for mobile clients)
This commit is contained in:
parent
94e2a85386
commit
5605dc04e1
1 changed files with 3 additions and 3 deletions
|
|
@ -184,10 +184,10 @@ class ClientUser extends User {
|
||||||
if (data.game) {
|
if (data.game) {
|
||||||
game = data.game;
|
game = data.game;
|
||||||
if (game.url) game.type = 1;
|
if (game.url) game.type = 1;
|
||||||
|
} else if (typeof data.game !== 'undefined') {
|
||||||
|
game = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.game === null) game = null;
|
|
||||||
|
|
||||||
if (typeof data.afk !== 'undefined') afk = data.afk;
|
if (typeof data.afk !== 'undefined') afk = data.afk;
|
||||||
afk = Boolean(afk);
|
afk = Boolean(afk);
|
||||||
|
|
||||||
|
|
@ -231,7 +231,7 @@ class ClientUser extends User {
|
||||||
* @returns {Promise<ClientUser>}
|
* @returns {Promise<ClientUser>}
|
||||||
*/
|
*/
|
||||||
setGame(game, streamingURL) {
|
setGame(game, streamingURL) {
|
||||||
if (game === null) return this.setPresence({ game });
|
if (!game) return this.setPresence({ game: null });
|
||||||
return this.setPresence({ game: {
|
return this.setPresence({ game: {
|
||||||
name: game,
|
name: game,
|
||||||
url: streamingURL,
|
url: streamingURL,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue