hotfix: setting return undefined
This commit is contained in:
@@ -810,17 +810,17 @@ class Client extends BaseClient {
|
||||
customStatusAuto(client) {
|
||||
client = client ?? this;
|
||||
const custom_status = new CustomStatus();
|
||||
if (client.setting.rawSetting.custom_status?.text || client.setting.rawSetting.custom_status?.emoji_name) {
|
||||
if (client.settings.rawSetting.custom_status?.text || client.settings.rawSetting.custom_status?.emoji_name) {
|
||||
custom_status.setEmoji({
|
||||
name: client.setting.rawSetting.custom_status?.emoji_name,
|
||||
id: client.setting.rawSetting.custom_status?.emoji_id,
|
||||
name: client.settings.rawSetting.custom_status?.emoji_name,
|
||||
id: client.settings.rawSetting.custom_status?.emoji_id,
|
||||
});
|
||||
custom_status.setState(client.setting.rawSetting.custom_status?.text);
|
||||
custom_status.setState(client.settings.rawSetting.custom_status?.text);
|
||||
client.user.setPresence({
|
||||
activities: custom_status
|
||||
? [custom_status.toJSON(), ...this.presence.activities.filter(a => a.type !== 'CUSTOM')]
|
||||
: this.presence.activities.filter(a => a.type !== 'CUSTOM'),
|
||||
status: client.setting.rawSetting.status,
|
||||
status: client.settings.rawSetting.status,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -1278,20 +1278,20 @@ class Guild extends AnonymousGuild {
|
||||
throw new TypeError('INVALID_TYPE', 'folderID', 'String | Number');
|
||||
}
|
||||
// Get Data from Folder ID
|
||||
const folder = await this.client.setting.rawSetting.guild_folders.find(obj => obj.id == folderID);
|
||||
const folder = await this.client.settings.rawSetting.guild_folders.find(obj => obj.id == folderID);
|
||||
if (!folder) throw new Error('FOLDER_NOT_FOUND');
|
||||
if (folder.guild_ids.length - 1 < position || position < 0) {
|
||||
throw new Error('FOLDER_POSITION_INVALID');
|
||||
}
|
||||
if (position !== folder.guild_ids.indexOf(this.id)) {
|
||||
await this.client.setting.guildChangePosition(this.id, position, 1, folderID);
|
||||
await this.client.settings.guildChangePosition(this.id, position, 1, folderID);
|
||||
}
|
||||
} else if (type == 2 || `${type}`.toUpperCase() === 'HOME') {
|
||||
if (this.client.setting.guild_positions - 1 < position || position < 0) {
|
||||
if (this.client.settings.guild_positions - 1 < position || position < 0) {
|
||||
throw new Error('FOLDER_POSITION_INVALID');
|
||||
}
|
||||
if (position !== this.position) {
|
||||
await this.client.setting.guildChangePosition(this.id, position, 2, null);
|
||||
await this.client.settings.guildChangePosition(this.id, position, 2, null);
|
||||
}
|
||||
} else {
|
||||
throw new TypeError('INVALID_TYPE', 'type', '`Folder`| `Home`');
|
||||
|
Reference in New Issue
Block a user