diff --git a/Events/DirectMessageEvent.cs b/Events/DirectMessageEvent.cs index a91efa3d..abb83616 100644 --- a/Events/DirectMessageEvent.cs +++ b/Events/DirectMessageEvent.cs @@ -4,9 +4,6 @@ public class DirectMessageEvent { public static async void DirectMessageEventHandler(DiscordMessage message) { - // Ignore message if user is blocked - if (await Program.db.SetContainsAsync("dmRelayBlocklist", message.Author.Id)) return; - // Auto-response to contact modmail if DM follows warn/mute and is within configured time limit bool sentAutoresponse = false; @@ -36,6 +33,12 @@ await message.RespondAsync( } } + // Don't relay message if user is a bot (user apps) + if (message.Author.IsBot) return; + + // Don't relay message if user is blocked + if (await Program.db.SetContainsAsync("dmRelayBlocklist", message.Author.Id)) return; + // Log DMs to DM log channel, include note about auto-response if applicable await LogChannelHelper.LogMessageAsync("dms", await DiscordHelpers.GenerateMessageRelay(message, sentAutoresponse: sentAutoresponse)); }