Forum teuk.org

πŸͺ„ Alohomora! β€” Nine Doors Unlocked (May 2026)

in Mediabot Β· started by TeuK Β· 1h ago

TeuK Β· 1h ago

Overview

Nine quality-of-life improvements land at once β€” locked doors opened, rough edges polished, and the test suite climbs to 236 cases. Operators get karma history in the Partyline, users get French 8-ball and smarter remind management, and every config that was hardcoded now has a key.

β€œAlohomora! Every locked door yields. Every config key finds its lock.” πŸ”‘βœ¨


πŸ“‹ T4 β€” Four Missing Tests Restored (237, 238, 240, 241)

Tests from the previous session that hadn’t made it into the snap:

# What
237 Partyline .quota β€” _cmd_quota, _claude_ratelimit, safe split, 60s window
238 Scheduler daily_channel_report β€” 86400s, top speakers, top karma, ensure_connected
240 Partyline .persona β€” _cmd_persona, safe split, clear subcommand
241 !karmahist DB β€” KARMA_LOG insert in processKarma, DB-first read, fallback

πŸ§ͺ T5 β€” Five New Tests (242–246)

User-facing Wave IV commands now have static analysis coverage:

# What
242 !karmatop β€” queries KARMA, orders by score DESC, LIMIT, ->finish
243 !note / !notes β€” _notes hash, 10-note cap, ordinal ID (C4/fix), del subcommand
244 !pollresult / !pollstop β€” _poll hash, vote percentages, active=0, both logBot
245 !triviascore β€” reads trivia scores, outputs header, logBot
246 !remindlist β€” queries REMINDERS, filters pending, ->finish, empty case

🌍 J2 β€” !choose Accepts French ou Separator

<teuk> m choose cafΓ© | thΓ© | chocolat      ← pipe still works
<teuk> m choose cafΓ© ou thΓ© ou chocolat    ← French separator now works
<mediabotv3> teuk: I choose... thΓ©!

The separator is auto-detected: if the input contains |, it splits on |; otherwise it splits on \s+ou\s+. Syntax notice updated accordingly.


🎱 J3 β€” !8ball French Answers (main.LANG = fr)

[main]
LANG = fr
<teuk> m 8ball Γ§a va marcher ?
<mediabotv3> C'est certain.

<teuk> m 8ball on va gagner ?
<mediabotv3> Très douteux.

20 French answers covering all three Magic 8-Ball categories (positive, non-committal, negative). Falls back to English if LANG is unset or not fr.


πŸ–₯️ J1 β€” Partyline .uptime Shows Claude Stats

.uptime
Uptime:
  Bot     : 3h 14m 7s
  Process : pid 12345
  Name    : mediabotv3 v3.0
  Server  : 14d 6h
Claude AI:
  Requests : 42 (errors: 0, ratelimited: 3)
  Personas : 1 active
  History  : 2 active session(s)

Reads mediabot_claude_requests_total, claude_errors_total, claude_ratelimit_total from Prometheus metrics; counts active personas and history sessions from in-memory hashes.


πŸ“‹ K1 β€” !remind list and !remind cancel <id>

<teuk> m remind list
<mediabotv3> -teuk- Pending reminders:
<mediabotv3> -teuk-   [#12] for boole: bring the logs
<mediabotv3> -teuk-   [#15] for poyan: meeting at 20h

<teuk> m remind cancel 12
<mediabotv3> -teuk- Reminder #12 cancelled.

!remind list shows pending (undelivered) reminders set by the caller on the current channel. !remind cancel <id> deletes one by ID β€” only the creator can cancel their own reminders (from_nick check in SQL).


⏱️ K3 β€” Trivia Timeout Configurable

[main]
TRIVIA_TIMEOUT = 60    # seconds (1–120), default 30

Previously hardcoded to 30 seconds. Now reads main.TRIVIA_TIMEOUT at each !trivia call, clamped to 1–120s.


🎬 K4 β€” !yt search Result Count Configurable

[main]
YT_SEARCH_RESULTS = 5    # 1–5 results, default 3

maxResults in the YouTube Data API query now uses the config value. Clamped to 1–5 (API limit for free tier). The second metadata request (duration + views) adapts automatically.


πŸ€– K6 β€” !ai model

<teuk> m ai model
<mediabotv3> -teuk- Current Claude model: claude-haiku-4-5-20251001

Read-only. Shows the effective model β€” either from anthropic.MODEL in config, or the CLAUDE_MODEL constant default.


πŸ–₯️ K5 β€” Partyline .karmahist [nick]

.karmahist
Recent karma changes on #boulets:
  Boole                +1 (now +7)  by teuk            3m ago
  Poyan                -1 (now +2)  by Boole            12m ago
  teuk                 +1 (now +14) by Poyan            47m ago

.karmahist boole
Karma history for boole on #boulets:
  Boole                +1 (now +7)  by teuk            3m ago

Reads from _karma_log{$channel} (in-memory ring buffer). Shows up to 10 entries (vs 5 in IRC). Calls Mediabot::UserCommands::_seconds_to_human for timestamps. Optional nick filter.


πŸ§ͺ Tests J1–J3 (247–249)

# File What
247 247_usercommands_choose_ou.t J2 marker, ou support, separator auto-detect, logBot
248 248_usercommands_8ball_lang.t J3 marker, LANG config read, @answers_fr, FR selection
249 249_partyline_uptime_claude.t J1 marker, all three Claude metrics, _claude_persona, _claude_history, section header

Total test suite: 236 cases.


πŸ“¦ Files Changed

File Changes
UserCommands.pm K1 !remind list+cancel; K3 trivia timeout; J2 !choose ou; J3 !8ball FR
External.pm K4 yt search count; K6 !ai model
Partyline.pm J1 Claude stats in .uptime; K5 .karmahist [nick]
t/cases/237–249 13 test cases (T4 restored + T5 + T-J)

You must be logged in to reply.