forked from Galactic/galactic-bot
bugfix
This commit is contained in:
parent
9ca14d5e39
commit
f6e3f6c38d
@ -191,7 +191,7 @@ class DiscordClient extends Client {
|
||||
}
|
||||
|
||||
defaultConfig(type) {
|
||||
if(this._defaultConfig[type]) return this._defaultConfig[type];
|
||||
if (this._defaultConfig[type]) return JSON.parse(JSON.stringify(this._defaultConfig[type]));
|
||||
const settings = this.registry.components.filter((c) => c._type === 'setting' && c.resolve === type);
|
||||
let def = type === 'GUILD' ? DefaultGuild : DefaultUser;
|
||||
for(const setting of settings.values()) {
|
||||
@ -203,7 +203,7 @@ class DiscordClient extends Client {
|
||||
}
|
||||
}
|
||||
this._defaultConfig[type] = def;
|
||||
return def;
|
||||
return JSON.parse(JSON.stringify(def));
|
||||
}
|
||||
|
||||
async _setActivity() {
|
||||
|
@ -122,7 +122,7 @@ class UtilityHook extends Observer {
|
||||
const me = await guild.resolveMember(this.client.user);
|
||||
if (!me.permissions.has('ManageRoles')) return;
|
||||
|
||||
const _roles = await guild.resolveRoles(setting.roles);
|
||||
const _roles = await guild.resolveRoles(setting.roles || []);
|
||||
if (_roles.some((r) => r.position >= me.roles.highest.position)) return;
|
||||
const roles = _roles.map((r) => r.id);
|
||||
// Sometimes the member isn't available on the API for some reason,
|
||||
|
@ -215,7 +215,7 @@ class SettingsMigrator {
|
||||
const { moderation, modlogs, muterole, mutetype, automod, wordFilter, ignore, invitefilter,
|
||||
chatlogs, activity, selfrole, killitwithfire, memberlogs, staffRole, staffRule, modpoints,
|
||||
userlogs, grantable, privatelog, linkfilter, autorole, welcomer, prefix, protection } = result;
|
||||
const settings = this.client.defaultConfig('GUILD');
|
||||
const settings = JSON.parse(JSON.stringify(this.client.defaultConfig('GUILD')));
|
||||
|
||||
if (staffRole || staffRole) {
|
||||
settings.staff = {
|
||||
|
Loading…
Reference in New Issue
Block a user