1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-01-31 09:09:00 +03:00

Use Snowflake#Empty extension method instead of '== 0' checks (#134)

This commit is contained in:
Octol1ttle 2023-09-30 20:53:05 +05:00 committed by GitHub
parent e283ba5a6d
commit 6247a55a35
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -101,7 +101,7 @@ public class MuteCommandGroup : CommandGroup
return await _feedback.SendContextualEmbedResultAsync(embed, CancellationToken);
}
if (GuildSettings.MuteRole.Get(data.Settings) != 0)
if (!GuildSettings.MuteRole.Get(data.Settings).Empty())
{
return await RoleMuteUserAsync(
target, reason, duration, guildId, data, channelId, user, currentUser, CancellationToken);

View file

@ -97,7 +97,7 @@ public sealed partial class MemberUpdateService : BackgroundService
var autoUnmuteResult = await TryAutoUnmuteAsync(guildId, id, data, ct);
failedResults.AddIfFailed(autoUnmuteResult);
if (defaultRole.Value is not 0 && !data.Roles.Contains(defaultRole.Value))
if (!defaultRole.Empty() && !data.Roles.Contains(defaultRole.Value))
{
var addResult = await _guildApi.AddGuildMemberRoleAsync(
guildId, id, defaultRole, ct: ct);

View file

@ -174,7 +174,7 @@ public sealed class UtilityService : IHostedService
return Result<string>.FromError(usersResult);
}
if (role.Value is not 0)
if (!role.Empty())
{
builder.Append($"{Mention.Role(role)} ");
}