Forum teuk.org

πŸͺ„ Protego Maxima! β€” 18 Spells, Three Waves, Zero Bugs (May 2026)

in Mediabot Β· started by TeuK Β· 6d ago

TeuK Β· 6d ago

Overview

Three full feature waves land at once. The X-series sharpens Claude’s memory and operator tooling. The Y-series brings safety, exports, and deeper game mechanics. The Z-series finishes the job β€” rankings, AI digests, time-extension, and Prometheus counters for everything.

β€œProtego Maxima! The codebase is shielded. The operator is armed. Dumbledore would approve.” πŸ°πŸ›‘οΈβš‘


πŸ€– X1 β€” !ai pin <msg> β€” Persistent Context

Pin a message into every Claude prompt for the current nick+channel:

<teuk> m ai pin You are a Debian expert speaking in French
<mediabotv3> -teuk- Pinned context: You are a Debian expert speaking in French

<teuk> m ai pin           ← show current pin
<teuk> m ai pin clear     ← remove it

The pinned text is prepended as [Always remember: ...] before the system prompt. Stored in _claude_pinned{nick\x00chan}. Capped at 300 chars.


πŸ“‘ X3 β€” Partyline .reloadconf

Reload the config file without restarting the bot:

.reloadconf
Config reloaded.

Calls $bot->{conf}->reload if available. Error is reported if the conf object has no reload method.


πŸƒ X4 β€” !choose last + Y8 β€” !choose history

<teuk> m choose last
<mediabotv3> teuk: last choice was: pizza

<teuk> m choose history
<mediabotv3> Last choices: pizza | sushi | ramen | pizza | sushi

Each choice is stored in _choose_last and _choose_history (ring buffer, max 5).


πŸŽ“ X5 β€” !trivia <category>

<teuk> m trivia science
<mediabotv3> Trivia (science): What is the atomic number of carbon?

First non-numeric argument to !trivia is treated as a category filter passed to the Open Trivia API.


🚨 X6 β€” !remind ! <nick> <msg> β€” Urgent Reminder

Prefix your reminder with ! to mark it as high-priority:

<teuk> m remind ! boole apporte les logs

The reminder is stored with [!] prepended β€” stands out when delivered.


πŸ“Š X10 β€” Trivia Metrics

Two new Prometheus counters:

mediabot_trivia_correct_total    β€” incremented on each correct answer
mediabot_trivia_timeout_total    β€” incremented on each time-out

πŸ”’ Y1 β€” !ai relay <#chan> <prompt>

Route an AI response to a channel from a private session:

/msg mediabotv3 ai relay #boulets explain IPv6 in one line
<mediabotv3> #boulets: IPv6 is a 128-bit address space...

🚫 Y2 β€” Strict Anti-Self-Vote

<teuk> teuk++
<mediabotv3> teuk: you can't vote for yourself.

Case-insensitive comparison, fires before the cooldown check.


πŸ“€ Y3 β€” !note export

Export all notes in one line:

<teuk> m note export
<mediabotv3> -teuk- Notes: 1. read the docs | 2. fix backups | 3. call Gwen

πŸ§‘β€πŸ’» Y4 β€” Partyline .nickinfo <nick>

.nickinfo teuk
Nick     : teuk
ID       : 42
Email    : teuk@teuk.org
Hosts    : *!teuk@*.teuk.org | *!teuk@localhost
Last login: 2026-05-18 21:08:16

Queries USER, USER_HOST, and USER_LOG in one SQL call.


πŸ’‘ Y5 β€” Trivia Half-Time Hint

After half the timeout has elapsed (e.g. 15s into a 30s window), the bot reveals the first letter of the answer:

<mediabotv3> Hint: s____

The hint_given flag prevents double-hinting.


↩️ Y6 β€” !unvote

<teuk> m unvote
<mediabotv3> teuk cancelled their vote (2 vote(s) remaining).

Removes $nick from $poll->{votes}. Works only while the poll is active.


πŸ“ˆ Y9 β€” Poll Vote Metrics

mediabot_poll_votes_total    β€” incremented on each !vote cast

πŸ† Z1 β€” !karma Shows Rank Inline

<teuk> m karma boole
<mediabotv3> boole: karma +7 (rank #2)

Rank is computed with a single COUNT(*)+1 query against the KARMA table, inside eval {} for graceful degradation.


πŸ“ Z2 β€” !ai summary [n]

<teuk> m ai summary 15
<mediabotv3> -teuk- Three users debated IPv6 adoption...

Fetches the last N messages (5–50, default 10) from CHANNEL_LOG, builds a transcript, and asks Claude to summarise in 2–3 sentences. Response delivered as a botNotice to the caller.


πŸ›‘ Z4 β€” !triviastop (Master)

<teuk> m triviastop
<mediabotv3> Trivia stopped by teuk. Answer: serendipity

Requires Master level. Clears active, multi_total, and multi_current so a new game can start immediately.


⏲️ Z5 β€” !pollextend <secs>

<teuk> m pollextend 60
<mediabotv3> Poll extended by 60s (127s remaining).

Adds seconds to $poll->{deadline}. Range: 10–600s.


🎯 Z6 β€” .flushcooldown <nick> <#chan> (Targeted)

.flushcooldown teuk #boulets
Karma cooldown cleared for teuk on #boulets.

Previously .flushcooldown only cleared an entire channel or everything. Now supports a nick #chan argument to remove one specific cooldown key.


πŸ“‰ Z7 β€” !karmadiff [nick]

<teuk> m karmadiff boole
<mediabotv3> boole: karma changed by +3 in the last 24h (3 vote(s)).

Reads the in-memory _karma_log ring buffer, filters by nick and timestamp (last 86400s).


πŸ“Š Z10 β€” Poll Creation and Closure Metrics

mediabot_poll_created_total    β€” incremented on each !poll start
mediabot_poll_closed_total     β€” incremented on each !pollresult

πŸ§ͺ Tests (296–316)

# Feature
296 X1: _claude_pinned, inject comment, pin clear
297 X3: .reloadconf, conf->reload, help
298 X4: _choose_last, last choice label
299 X5: trivia_cat variable
300 X6: remind_urgent, [!] prefix
301 X10: trivia_correct_total, trivia_timeout_total
302 Y1: Y1, relay_chan variable
303 Y2: self-vote message, case-insensitive
304 Y3: export subcommand, Notes: label
305 Y4: _cmd_nickinfo, USER_HOST, ->finish, dispatch
306 Y5: hint_given, Hint: output, half-time
307 Y6: mbUnvote_ctx, delete vote, dispatch
308 Y8: _choose_history, Last choices, cap 5
309 Y9: poll_votes_total
310 Z1: rank_z1, rank #
311 Z2: CHANNEL_LOG, Summarise this IRC, n_msgs
312 Z4: mbTriviaStop_ctx, Master, Trivia stopped by
313 Z5: mbPollExtend_ctx, deadline, Poll extended by
314 Z6: targeted nick+chan, cd_key
315 Z7: mbKarmaDiff_ctx, _karma_log, 86400
316 Z10: poll_created_total, poll_closed_total

Total test suite: 303 cases.


πŸ“¦ Files Changed

File Changes
UserCommands.pm Y2/Y3/Y5/Y6/Y8/Y9/Z1/Z4/Z5/Z7/Z10
External.pm X1/Y1/Z2
Partyline.pm X3/Y4/Z6
Mediabot.pm Dispatchers + help for all new commands
t/cases/296–316 21 test cases

You must be logged in to reply.