diff --git a/structure/moderation/infractions/Mute.js b/structure/moderation/infractions/Mute.js index 0a7a932..1e13be6 100644 --- a/structure/moderation/infractions/Mute.js +++ b/structure/moderation/infractions/Mute.js @@ -74,10 +74,15 @@ class MuteInfraction extends Infraction { muteRole: role ? role.id : null }; //Info will be saved in database and into the callback when resolved. - const callbacks = this.client.moderationManager.callbacks.filter((c) => c.infraction.type === 'MUTE' - && c.infraction.target === this.target.id); + const callback = this.client.moderationManager.callbacks.filter((c) => c.infraction.type === 'MUTE' + && c.infraction.target === this.target.id).first(); + + if(callback) { + this.data.removedRoles = [...new Set([...this.data.removedRoles, ...callback.infraction.data.removedRoles])]; + this.client.moderationManager._removeExpiration(callback); + } - if(callbacks.size > 0) callbacks.map((c) => this.client.moderationManager._removeExpiration(c)); + // if(callbacks.size > 0) callbacks.map((c) => this.client.moderationManager._removeExpiration(c)); await this.handle(); return this._succeed();