mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 01:38:27 -04:00
Changed all == null to is null and all !(* == null) to * is not null
This commit is contained in:
@@ -345,7 +345,7 @@ namespace NadekoBot.Modules.Gambling.Common.Blackjack
|
||||
|
||||
public Task PrintState()
|
||||
{
|
||||
if (StateUpdated == null)
|
||||
if (StateUpdated is null)
|
||||
return Task.CompletedTask;
|
||||
return StateUpdated.Invoke(this);
|
||||
}
|
||||
|
@@ -300,7 +300,7 @@ namespace NadekoBot.Modules.Gambling.Common
|
||||
|
||||
public static string GetHandValue(List<Card> cards)
|
||||
{
|
||||
if (handValues == null)
|
||||
if (handValues is null)
|
||||
InitHandValues();
|
||||
foreach (var kvp in handValues.Where(x => x.Value(cards)))
|
||||
{
|
||||
|
@@ -169,12 +169,12 @@ namespace NadekoBot.Modules.Gambling.Common.Events
|
||||
if (_emote.Name != r.Emote.Name)
|
||||
return;
|
||||
var gu = (r.User.IsSpecified ? r.User.Value : null) as IGuildUser;
|
||||
if (gu == null // no unknown users, as they could be bots, or alts
|
||||
if (gu is null // no unknown users, as they could be bots, or alts
|
||||
|| msg.Id != _msg.Id // same message
|
||||
|| gu.IsBot // no bots
|
||||
|| (DateTime.UtcNow - gu.CreatedAt).TotalDays <= 5 // no recently created accounts
|
||||
|| (_noRecentlyJoinedServer && // if specified, no users who joined the server in the last 24h
|
||||
(gu.JoinedAt == null || (DateTime.UtcNow - gu.JoinedAt.Value).TotalDays < 1))) // and no users for who we don't know when they joined
|
||||
(gu.JoinedAt is null || (DateTime.UtcNow - gu.JoinedAt.Value).TotalDays < 1))) // and no users for who we don't know when they joined
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user