fix: additional checks for unmuting without an active mute
This commit is contained in:
parent
39e0dfa27f
commit
0ee5f0a863
1 changed files with 4 additions and 2 deletions
|
@ -50,10 +50,12 @@ export async function clearMute(
|
||||||
} else {
|
} else {
|
||||||
// Unmuting someone without an active mute -> remove timeouts and/or mute role
|
// Unmuting someone without an active mute -> remove timeouts and/or mute role
|
||||||
const muteRole = pluginData.config.get().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.roles.remove(muteRole);
|
||||||
}
|
}
|
||||||
await member.timeout(null);
|
if (member.communicationDisabledUntilTimestamp) {
|
||||||
|
await member.timeout(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
pluginData.getPlugin(LogsPlugin).logBotAlert({
|
pluginData.getPlugin(LogsPlugin).logBotAlert({
|
||||||
|
|
Loading…
Add table
Reference in a new issue