Message Filters Should Not Attempt to Delete Messages in DMs
Filters that attempt to delete offending message(s) should check whether or not the message was sent in a DM, since the bot cannot delete others' DM messages.

```
Forbidden: 403 Forbidden (error code: 50003): Cannot execute action on a DM channel
  File "discord/client.py", line 312, in _run_event
    await coro(*args, **kwargs)
  File "bot/cogs/filtering.py", line 114, in on_message
    await self._filter_message(msg)
  File "bot/cogs/filtering.py", line 176, in _filter_message
    await msg.delete()
  File "discord/message.py", line 762, in delete
    await self._state.http.delete_message(self.channel.id, self.id)
  File "discord/http.py", line 221, in request
    raise Forbidden(r, data)

Unhandled exception in on_message.
```

Sentry Issue: [BOT-3W](https://sentry.io/organizations/python-discord/issues/1650443849/?referrer=github_integration)
diff --git a/bot/cogs/filtering.py b/bot/cogs/filtering.py
index 6a703f5a..1e21a4ce 100644
--- a/bot/cogs/filtering.py
+++ b/bot/cogs/filtering.py
@@ -4,7 +4,7 @@ from typing import Optional, Union
 
 import discord.errors
 from dateutil.relativedelta import relativedelta
-from discord import Colour, DMChannel, Member, Message, TextChannel
+from discord import Colour, Member, Message, TextChannel
 from discord.ext.commands import Cog
 from discord.utils import escape_markdown
 
@@ -161,8 +161,10 @@ class Filtering(Cog):
                         match = await _filter["function"](msg)
 
                     if match:
-                        # If this is a filter (not a watchlist), we should delete the message.
-                        if _filter["type"] == "filter":
+                        is_private = msg.channel.type is discord.ChannelType.private
+
+                        # If this is a filter (not a watchlist) and not in a DM, delete the message.
+                        if _filter["type"] == "filter" and not is_private:
                             try:
                                 # Embeds (can?) trigger both the `on_message` and `on_message_edit`
                                 # event handlers, triggering filtering twice for the same message.
@@ -181,7 +183,7 @@ class Filtering(Cog):
                             if _filter["user_notification"]:
                                 await self.notify_member(msg.author, _filter["notification_msg"], msg.channel)
 
-                        if isinstance(msg.channel, DMChannel):
+                        if is_private:
                             channel_str = "via DM"
                         else:
                             channel_str = f"in {msg.channel.mention}"
['bot/cogs/filtering.py']