diff --git a/src/structure/components/observers/CommandHandler.js b/src/structure/components/observers/CommandHandler.js index ba33de7..a20a495 100644 --- a/src/structure/components/observers/CommandHandler.js +++ b/src/structure/components/observers/CommandHandler.js @@ -56,7 +56,7 @@ class CommandHandler extends Observer { || nonsilent.length && nonsilent.some((i) => i.args?.missing.includes('SendMessages')) || silent.length && !nonsilent.length) return; - if (inhibitors.length) return this._generateError(invoker, { type: 'inhibitor', ...inhibitors[0] }).catch(this.logger.error); + if (inhibitors.length) return this._generateError(invoker, { type: 'inhibitor', ...inhibitors[0] }).catch(this.logger.error.bind(this.logger)); const response = await this._parseMessage(invoker, parameters); // There was an error if _parseResponse return value is truthy, i.e. an error message was sent diff --git a/src/structure/components/observers/UtilityHook.js b/src/structure/components/observers/UtilityHook.js index d562098..897279b 100644 --- a/src/structure/components/observers/UtilityHook.js +++ b/src/structure/components/observers/UtilityHook.js @@ -122,7 +122,7 @@ class UtilityHook extends Observer { const _roles = await guild.resolveRoles(setting.roles); const roles = _roles.map((r) => r.id); - await member.roles.add(roles, 'Adding autoroles').catch(this.client.logger.error); + await member.roles.add(roles, 'Adding autoroles').catch(this.logger.error.bind(this.logger)); } diff --git a/src/structure/infractions/Mute.js b/src/structure/infractions/Mute.js index 780aa72..aaba9ac 100644 --- a/src/structure/infractions/Mute.js +++ b/src/structure/infractions/Mute.js @@ -166,7 +166,7 @@ class MuteInfraction extends Infraction { if (inf.id === this.id && member) { const reason = `Case ${this.case} resolve`; - const roles = [...new Set([...member.roles.cache.map((r) => r.id), ...removedRoles])]; + const roles = [...new Set([...member.roles.cache.map((r) => r.id), ...removedRoles || []])]; switch (muteType) { case 0: try {