Removed redundant parenthesis

This commit is contained in:
Kwoth
2021-12-20 03:54:30 +01:00
parent edd60ae656
commit 9223d78849
58 changed files with 147 additions and 147 deletions

View File

@@ -20,8 +20,8 @@ public class CustomReactions : NadekoModule<CustomReactionsService>
_clientFactory = clientFactory;
}
private bool AdminInGuildOrOwnerInDm() => (ctx.Guild is null && _creds.IsOwner(ctx.User))
|| (ctx.Guild != null && ((IGuildUser)ctx.User).GuildPermissions.Administrator);
private bool AdminInGuildOrOwnerInDm() => ctx.Guild is null && _creds.IsOwner(ctx.User)
|| ctx.Guild != null && ((IGuildUser)ctx.User).GuildPermissions.Administrator;
[NadekoCommand, Aliases]
public async Task AddCustReact(string key, [Leftover] string message)
@@ -53,7 +53,7 @@ public class CustomReactions : NadekoModule<CustomReactionsService>
if (string.IsNullOrWhiteSpace(message) || id < 0)
return;
if ((channel is null && !_creds.IsOwner(ctx.User)) || (channel != null && !((IGuildUser)ctx.User).GuildPermissions.Administrator))
if (channel is null && !_creds.IsOwner(ctx.User) || channel != null && !((IGuildUser)ctx.User).GuildPermissions.Administrator)
{
await ReplyErrorLocalizedAsync(strs.insuff_perms).ConfigureAwait(false);
return;

View File

@@ -60,7 +60,7 @@ public static class CustomReactionExtensions
if (word.Length < str.Length && str.isValidWordDivider(word.Length))
return WordPosition.Start;
}
else if ((wordIndex + word.Length) == str.Length)
else if (wordIndex + word.Length == str.Length)
{
if (str.isValidWordDivider(wordIndex - 1))
return WordPosition.End;

View File

@@ -264,7 +264,7 @@ public sealed class CustomReactionsService : IEarlyBehavior, IReadyExecutor
if (toDelete is null)
return null;
if ((toDelete.IsGlobal() && guildId is null) || (guildId == toDelete.GuildId))
if (toDelete.IsGlobal() && guildId is null || guildId == toDelete.GuildId)
{
uow.CustomReactions.Remove(toDelete);
await uow.SaveChangesAsync();