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,