forked from TeamInklings/Octobot
Use Snowflake#Empty extension method instead of '== 0' checks (#134)
This commit is contained in:
parent
e283ba5a6d
commit
6247a55a35
3 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)} ");
|
||||
}
|
||||
|
|
Reference in a new issue