From 3996c2f17f25b59e65461a1195537a52f0a64a7e Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Tue, 6 Jul 2021 12:12:45 +0100 Subject: Use getattr with a default, to protect against DM channels --- bot/exts/filters/filtering.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/exts/filters/filtering.py b/bot/exts/filters/filtering.py index 5d5f59590..77fb324a5 100644 --- a/bot/exts/filters/filtering.py +++ b/bot/exts/filters/filtering.py @@ -284,7 +284,7 @@ class Filtering(Cog): if filter_name == "filter_invites": # Disable invites filter in codejam team channels - category = msg.channel.category + category = getattr(msg.channel, "category", None) if category and category.name == JAM_CATEGORY_NAME: continue -- cgit v1.2.3