mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 13:03: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) {
|
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,
|
||||||
|
|||||||
Reference in New Issue
Block a user