fix: additional checks for unmuting without an active mute

This commit is contained in:
Dragory 2023-04-01 20:09:09 +03:00
parent 39e0dfa27f
commit 0ee5f0a863
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -50,10 +50,12 @@ export async function clearMute(
} else {
// Unmuting someone without an active mute -> remove timeouts and/or mute role
const muteRole = pluginData.config.get().mute_role;
if (muteRole) {
if (muteRole && member.roles.cache.has(muteRole)) {
await member.roles.remove(muteRole);
}
await member.timeout(null);
if (member.communicationDisabledUntilTimestamp) {
await member.timeout(null);
}
}
} catch {
pluginData.getPlugin(LogsPlugin).logBotAlert({