Fix minor bug

TypeError: Cannot set properties of null (setting 'status')
This commit is contained in:
March 7th 2022-03-21 10:48:32 +07:00
parent 577922bf31
commit 9307497a0a
2 changed files with 3 additions and 2 deletions

View File

@ -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",

View File

@ -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) {