From 2142d824272c738c3d4ac9f20dd59cc4f02e345e Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Sun, 2 Oct 2022 20:19:49 +0100 Subject: Make autoban report silently fail if output will be sent to a non-mod channel --- bot/exts/filters/filter_lists.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bot/exts/filters/filter_lists.py b/bot/exts/filters/filter_lists.py index edc2d09f3..c429b0eb9 100644 --- a/bot/exts/filters/filter_lists.py +++ b/bot/exts/filters/filter_lists.py @@ -15,6 +15,7 @@ from bot.constants import Channels, Colours from bot.converters import ValidDiscordServerInvite, ValidFilterListType from bot.log import get_logger from bot.pagination import LinePaginator +from bot.utils.channel import is_mod_channel log = get_logger(__name__) WEEKLY_REPORT_ISO_DAY = 3 # 1=Monday, 7=Sunday @@ -315,6 +316,9 @@ class FilterLists(Cog): seven_days_ago = arrow.utcnow().shift(days=-7) if not channel: channel = self.bot.get_channel(Channels.mod_meta) + elif not is_mod_channel(channel): + # Silently fail if output is going to be a non-mod channel. + return added_autobans = defaultdict(list) # Extract all autoban filters added in the past 7 days from each filter type -- cgit v1.2.3