Changed all == null to is null and all !(* == null) to * is not null

This commit is contained in:
Kwoth
2021-06-19 08:24:09 +02:00
parent 81406cb46a
commit d8c7cdc7f4
125 changed files with 367 additions and 366 deletions

View File

@@ -94,7 +94,7 @@ namespace NadekoBot.Modules.Administration
var embed = new EmbedBuilder()
.WithOkColor();
if (punishment == null)
if (punishment is null)
{
embed.WithDescription(GetText("user_warned",
Format.Bold(user.ToString())));
@@ -430,7 +430,7 @@ namespace NadekoBot.Modules.Administration
{
var defaultMessage = GetText("bandm", Format.Bold(ctx.Guild.Name), msg);
var embed = _service.GetBanUserDmEmbed(Context, guildUser, defaultMessage, msg, time.Time);
if (!(embed is null))
if (embed is not null)
{
var userChannel = await guildUser.GetOrCreateDMChannelAsync();
await userChannel.EmbedAsync(embed);
@@ -497,7 +497,7 @@ namespace NadekoBot.Modules.Administration
{
var defaultMessage = GetText("bandm", Format.Bold(ctx.Guild.Name), msg);
var embed = _service.GetBanUserDmEmbed(Context, user, defaultMessage, msg, null);
if (!(embed is null))
if (embed is not null)
{
var userChannel = await user.GetOrCreateDMChannelAsync();
await userChannel.EmbedAsync(embed);
@@ -613,7 +613,7 @@ namespace NadekoBot.Modules.Administration
var bun = bans.FirstOrDefault(x => x.User.ToString().ToLowerInvariant() == user.ToLowerInvariant());
if (bun == null)
if (bun is null)
{
await ReplyErrorLocalizedAsync("user_not_found").ConfigureAwait(false);
return;
@@ -632,7 +632,7 @@ namespace NadekoBot.Modules.Administration
var bun = bans.FirstOrDefault(x => x.User.Id == userId);
if (bun == null)
if (bun is null)
{
await ReplyErrorLocalizedAsync("user_not_found").ConfigureAwait(false);
return;