mirror of
https://github.com/RPCS3/discord-bot.git
synced 2026-01-31 01:25:22 +01:00
hate when properties throw for no reason >:-|
This commit is contained in:
@@ -162,7 +162,7 @@ namespace CompatBot.EventHandlers
|
||||
|
||||
internal static (bool needToChill, bool needToThank) NeedToSilence(DiscordMessage msg)
|
||||
{
|
||||
if (string.IsNullOrEmpty(msg.Content))
|
||||
if (string.IsNullOrEmpty(msg?.Content))
|
||||
return (false, false);
|
||||
|
||||
var needToChill = false;
|
||||
@@ -175,7 +175,7 @@ namespace CompatBot.EventHandlers
|
||||
else
|
||||
needToThank = true;
|
||||
});
|
||||
var mentionsBot = msgContent.Contains("bot") || (msg.MentionedUsers?.Any(u => u.IsCurrent) ?? false);
|
||||
var mentionsBot = msgContent.Contains("bot") || (msg.MentionedUsers?.Any(u => { try { return u.IsCurrent; } catch { return false; }}) ?? false);
|
||||
return (needToChill && mentionsBot, needToThank && mentionsBot);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user