mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01: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:
@@ -184,10 +184,10 @@ class ClientUser extends User {
|
||||
if (data.game) {
|
||||
game = data.game;
|
||||
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;
|
||||
afk = Boolean(afk);
|
||||
|
||||
@@ -231,7 +231,7 @@ class ClientUser extends User {
|
||||
* @returns {Promise<ClientUser>}
|
||||
*/
|
||||
setGame(game, streamingURL) {
|
||||
if (game === null) return this.setPresence({ game });
|
||||
if (!game) return this.setPresence({ game: null });
|
||||
return this.setPresence({ game: {
|
||||
name: game,
|
||||
url: streamingURL,
|
||||
|
||||
Reference in New Issue
Block a user