From 9307497a0a8d3b3a90097a03ac8067ed648f3d25 Mon Sep 17 00:00:00 2001 From: March 7th <71698422+aiko-chan-ai@users.noreply.github.com> Date: Mon, 21 Mar 2022 10:48:32 +0700 Subject: [PATCH] Fix minor bug TypeError: Cannot set properties of null (setting 'status') --- package.json | 2 +- src/managers/ClientUserSettingManager.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a82e161..521a260 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "discord.js-selfbot-v13", - "version": "0.1.2", + "version": "0.1.3", "description": "A unofficial discord.js fork for creating selfbots [Based on discord.js v13]", "main": "./src/index.js", "types": "./typings/index.d.ts", diff --git a/src/managers/ClientUserSettingManager.js b/src/managers/ClientUserSettingManager.js index d3654ac..a1102e6 100644 --- a/src/managers/ClientUserSettingManager.js +++ b/src/managers/ClientUserSettingManager.js @@ -103,7 +103,7 @@ class ClientUserSettingManager extends CachedManager { this.showEmojiReactions = data.render_reactions; } if ('custom_status' in data) { - this.customStatus = data.custom_status; + this.customStatus = data.custom_status || {}; this.customStatus.status = data.status; } if ('guild_folders' in data) { @@ -130,6 +130,7 @@ class ClientUserSettingManager extends CachedManager { if (this.client.bot) throw new Error('INVALID_BOT_METHOD'); try { const data = await this.client.api.users('@me').settings.get(); + console.log(data); this._patch(data); return this; } catch (e) {