aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Slushie <[email protected]>2020-07-13 16:08:40 +0100
committerGravatar Slushie <[email protected]>2020-07-13 16:08:40 +0100
commitb40a5f0de6758eb9dfb79ac3f34fbc0bf90d8a1e (patch)
tree1de9147059ad432d7ef605d0355715a11b6f058c
parentrename the `_filter_eval` function to be a public function (diff)
check for the filter_cog in case it is unloaded
-rw-r--r--bot/cogs/snekbox.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/bot/cogs/snekbox.py b/bot/cogs/snekbox.py
index 4f73690da..662f90869 100644
--- a/bot/cogs/snekbox.py
+++ b/bot/cogs/snekbox.py
@@ -213,7 +213,9 @@ class Snekbox(Cog):
self.bot.stats.incr("snekbox.python.success")
filter_cog = self.bot.get_cog("Filtering")
- filter_triggered = await filter_cog.filter_eval(msg, ctx.message)
+ filter_triggered = False
+ if filter_cog:
+ filter_triggered = await filter_cog.filter_eval(msg, ctx.message)
if filter_triggered:
response = await ctx.send("Attempt to circumvent filter detected. Moderator team has been alerted.")
else: