fix(auto-delete): guard nickname reset on role hierarchy + surface LLM parse errors

- resetOffensiveNickname: skip when target role sits above bot
  (member.manageable) instead of hammering a doomed setNickname PATCH
  that Discord rejects with 50013 'Missing Permissions'. Log the
  Discord error code on failure for clear diagnosis.
- llmCaller: include contentPreview (first 200 chars) in the parse-
  failure warning so non-JSON LLM responses are debuggable.
This commit is contained in:
asepharyana
2026-08-17 20:52:09 +07:00
parent 479f4719ba
commit b38616e051
2 changed files with 23 additions and 0 deletions
@@ -119,6 +119,7 @@ export async function callModerationLLM(
{
error: state.lastParseError,
contentLength: rawContent.length,
contentPreview: rawContent.slice(0, 200),
targetIds,
model: config.AI_LLM_MODEL,
},