aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Izan <[email protected]>2022-02-17 11:47:29 +0000
committerGravatar Izan <[email protected]>2022-02-17 11:48:21 +0000
commitb0e21f0a5f342cd8c9e82ddc357b51e19c3fc9ad (patch)
tree0542a534fe23670ab760c9d9e2c0c3987d8efa4c
parentValidate regex when adding to the filter_token filter (diff)
Include regex error in failure message
f
-rw-r--r--bot/exts/filters/filter_lists.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/exts/filters/filter_lists.py b/bot/exts/filters/filter_lists.py
index d3e6393d3..9d3a52942 100644
--- a/bot/exts/filters/filter_lists.py
+++ b/bot/exts/filters/filter_lists.py
@@ -77,11 +77,11 @@ class FilterLists(Cog):
elif list_type == "FILTER_TOKEN":
try:
_ = re.compile(content)
- except re.error:
+ except re.error as e:
await ctx.message.add_reaction("❌")
await ctx.send(
f"{ctx.author.mention} that's not a valid regex! "
- "You may have forgotten to escape part of the regex."
+ f"Regex error message: {e.msg}."
)
return