patched vow system

This commit is contained in:
Subinacls
2026-06-09 07:39:43 -04:00
parent 154735e133
commit 3034a474be
2 changed files with 130 additions and 16 deletions
+11 -4
View File
@@ -30,6 +30,8 @@ from utils.config import (
from cogs.moderation import (
get_or_create_xcom_role,
get_or_create_xcom_channel,
get_or_create_xcom_mod_channel,
_post_to_mod_channel,
VOTE_XCOM_THRESHOLD,
VOTE_RESET_DAYS,
)
@@ -157,9 +159,9 @@ class ExcommunicadoBot(commands.Bot):
result = add_keyword_points(
message.guild.id, author.id, matched_weight, reset_days=VOTE_RESET_DAYS
)
print(
f"[KEYWORD] {author} matched {matched_terms} (+{matched_weight}) "
f"-> score {result['score']} in {message.guild.name}"
logger.info(
"Keyword match: user=%s terms=%s (+%d) -> score=%d guild=%s",
author, matched_terms, matched_weight, result["score"], message.guild.name,
)
me = message.guild.me
can_manage = me is not None and author.top_role < me.top_role
@@ -178,10 +180,15 @@ class ExcommunicadoBot(commands.Bot):
timestamp=now,
)
log_embed.add_field(name="Matched", value=", ".join(matched_terms[:10]) or "", inline=False)
await _post_to_mod_channel(message.guild, None, log_embed)
await self.log_action(message.guild, log_embed)
logger.warning(
"Keyword auto-XCOM: user=%s guild=%s score=%d",
author, message.guild.name, result["score"],
)
return
except Exception as kw_err:
print(f"[KEYWORD] Auto-XCOM failed: {kw_err}")
logger.exception("Keyword auto-XCOM failed: %s", kw_err)
times = USER_MESSAGE_TIMES[message.author.id]
times.append(now)