From ec54e31b5c5f480df62ac25fd84af76136ca83aa Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Fri, 20 Dec 2024 01:14:52 -0500 Subject: [PATCH] add additional debug logs for adding keywords --- nomen/notifications.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nomen/notifications.py b/nomen/notifications.py index e0e3172..da9c406 100644 --- a/nomen/notifications.py +++ b/nomen/notifications.py @@ -152,12 +152,14 @@ class Notifications(Cog): """ if test_keyword(keyword, regex): + log.debug("Keyword too common") await ctx.send(f"{'Regex' if regex else 'Keyword'} matches a word that is too common") return conflicts = await fetch_unpacked(ctx.bot.db, existing, params) if conflicts: + log.debug("Keyword conflicts with existing keyword") await ctx.send(f"Any instance of `{keyword}` would be matched by existing keywords (check DMs)") await ctx.author.send( f"Conflicts with keyword `{keyword}`:\n" + "\n".join(f"- `{conflict}`" for conflict in conflicts) @@ -167,12 +169,15 @@ class Notifications(Cog): conflicts = await fetch_unpacked(ctx.bot.db, redundant, params) if conflicts: + log.debug("Keyword renders existing redundant") await ctx.send(f"Adding `{keyword}` will cause existing keywords to never match (check DMs)") await ctx.author.send( f"Keywords redundant from `{keyword}`:\n" + "\n".join(f" - `{conflict}`" for conflict in conflicts) ) return + log.debug("Keyword valid, adding") + await ctx.bot.db.execute( "INSERT INTO keywords (guild_id, keyword, user_id, regex) VALUES (:guild_id, :keyword, :user_id, :regex)", params,