Skip to content

Fix "relation chat_levels does not exist" on cluster cleave / taunt#40

Merged
HiLleywyn merged 1 commit into
mainfrom
claude/fix-chat-levels-missing-table
Jun 5, 2026
Merged

Fix "relation chat_levels does not exist" on cluster cleave / taunt#40
HiLleywyn merged 1 commit into
mainfrom
claude/fix-chat-levels-missing-table

Conversation

@HiLleywyn
Copy link
Copy Markdown
Owner

What

.clank cluster cleave <id> (and .clank taunt) failed with:

relation "chat_levels" does not exist

Why

Both commands queried a chat_levels table directly — a leftover from the Discoin port, where a chat-leveling system existed. Clankwarden is the slim containment bot and ships no leveling system, so that table is never created (it only exists if a separate leveling bot shares the same database). The raw SELECT threw UndefinedTableError, failing the command.

  • cluster cleave used it to protect high-level members (skip level ≥ 30).
  • taunt/clarion used it to gate the command behind level 15+.

Fix

Route both through a best-effort _chat_level() helper that returns None when the table is absent (cached after the first miss so we don't re-run a failing query or spam logs):

  • No leveling table → the level-based protection/gate is skipped, and the commands work normally. They remain mod-gated (Manage Roles).
  • Leveling table present (shared DB) → behaviour is unchanged: cleave still protects level ≥ 30, taunt still requires level 15+.

py_compile clean. cogs/clank.py only.

Follow-up to #38 / #39.


Generated by Claude Code

.clank cluster cleave and .clank taunt queried a chat_levels table that
Clankwarden never creates (it ships no leveling system; the table only
exists when a separate leveling bot shares the DB). The raw queries threw
relation "chat_levels" does not exist and failed the commands.

Route both through a best-effort _chat_level() helper that returns None when
the table is absent (cached after the first miss) so the level-based
protection (cleave skips lvl>=30) and gate (taunt needs lvl>=15) are skipped
when there is no leveling system, and applied when there is. The commands
stay mod-gated either way.
@HiLleywyn HiLleywyn merged commit f899f33 into main Jun 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants