mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-05-01 19:49:55 +03:00
Remove timeout from user if it exists, but there is a mute role configured
This commit is contained in:
parent
552ebdd4e0
commit
a06376443f
2 changed files with 3 additions and 7 deletions
|
@ -39,7 +39,7 @@ public class UnmuteCommand : Command {
|
|||
var requestOptions = Utils.GetRequestOptions($"({author}) {reason}");
|
||||
var role = Utils.GetMuteRole(ref guild);
|
||||
|
||||
if (role != null) {
|
||||
if (role != null && toUnmute.Roles.Contains(role)) {
|
||||
var rolesRemoved = Boyfriend.GetRemovedRoles(guild.Id);
|
||||
|
||||
if (rolesRemoved.ContainsKey(toUnmute.Id)) {
|
||||
|
@ -48,10 +48,7 @@ public class UnmuteCommand : Command {
|
|||
CommandHandler.ConfigWriteScheduled = true;
|
||||
}
|
||||
|
||||
if (toUnmute.Roles.Contains(role)) { await toUnmute.RemoveRoleAsync(role, requestOptions); } else {
|
||||
Error(Messages.MemberNotMuted, false);
|
||||
return;
|
||||
}
|
||||
await toUnmute.RemoveRoleAsync(role, requestOptions);
|
||||
} else {
|
||||
if (toUnmute.TimedOutUntil == null || toUnmute.TimedOutUntil.Value.ToUnixTimeMilliseconds() <
|
||||
DateTimeOffset.Now.ToUnixTimeMilliseconds()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue