Fix role being mistakenly given in certain situations
This commit is contained in:
parent
d6b822ff17
commit
0a098d5c0c
1 changed files with 2 additions and 1 deletions
|
@ -38,7 +38,8 @@ namespace Noikoio.RegexBot.Module.VoiceRoleSync
|
||||||
{
|
{
|
||||||
// Replace roles only if the roles to be applied are different.
|
// Replace roles only if the roles to be applied are different.
|
||||||
if (settingBefore != null && user.Roles.Contains(settingBefore)) await user.RemoveRoleAsync(settingBefore);
|
if (settingBefore != null && user.Roles.Contains(settingBefore)) await user.RemoveRoleAsync(settingBefore);
|
||||||
if (settingAfter != null && !user.Roles.Contains(settingAfter)) await user.AddRoleAsync(settingAfter);
|
if (settingAfter != null && !user.Roles.Contains(settingAfter) &&
|
||||||
|
(after.IsDeafened || after.IsSelfDeafened)) await user.AddRoleAsync(settingAfter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue