mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-05-01 19:49:55 +03:00
fixed a few bugs in settings + code style consistency with string comparison
This commit is contained in:
parent
a06376443f
commit
2493e317d0
8 changed files with 72 additions and 51 deletions
|
@ -12,7 +12,7 @@ public class UnmuteCommand : Command {
|
|||
var author = (SocketGuildUser)context.User;
|
||||
|
||||
var permissionCheckResponse = CommandHandler.HasPermission(ref author, GuildPermission.ModerateMembers);
|
||||
if (permissionCheckResponse != "") {
|
||||
if (permissionCheckResponse is not "") {
|
||||
Error(permissionCheckResponse, true);
|
||||
return;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ public class UnmuteCommand : Command {
|
|||
}
|
||||
|
||||
var interactionCheckResponse = CommandHandler.CanInteract(ref author, ref toUnmute);
|
||||
if (interactionCheckResponse != "") {
|
||||
if (interactionCheckResponse is not "") {
|
||||
Error(interactionCheckResponse, true);
|
||||
return;
|
||||
}
|
||||
|
@ -49,7 +49,8 @@ public class UnmuteCommand : Command {
|
|||
}
|
||||
|
||||
await toUnmute.RemoveRoleAsync(role, requestOptions);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if (toUnmute.TimedOutUntil == null || toUnmute.TimedOutUntil.Value.ToUnixTimeMilliseconds() <
|
||||
DateTimeOffset.Now.ToUnixTimeMilliseconds()) {
|
||||
Error(Messages.MemberNotMuted, false);
|
||||
|
@ -63,4 +64,4 @@ public class UnmuteCommand : Command {
|
|||
Success(feedback, author.Mention, false, false);
|
||||
await Utils.SendFeedback(feedback, guild.Id, author.Mention, true);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue