Forum teuk.org

πŸ§™β€β™‚οΈ Mediabot v3 β€” MB484 β†’ MB490: The Help System Gets Its Hogwarts Letter

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

TeuK Β· 1mo ago

Mediabot keeps moving toward the future 3.3 release, still on the safe 3.2dev-* road.
No stable release switch has been made yet: this is another polishing pass, not the final 3.3 tag.

This round is mostly about one thing: making the bot easier to discover, easier to use, and less confusing for real IRC users.


🧭 Dispatch and help are now locked together

MB484 adds a new quality guard to make sure public commands and the internal help stay synchronized.

That means:

a command in dispatch must have help
a public help entry must point to a real command

No more invisible commands. No more help entries for ghosts.
This is not flashy, but it protects the release from documentation drift.


πŸ“š Help categories are finally clean

MB485 fixes an old annoyance in the help parser: comment lines inside the help heredoc were being parsed as fake commands.

The help category system now has cleaner grouping, including a dedicated factoids category.

Examples:

help commands factoids
help commands stats
help commands channel

The result is much more readable, without flooding the user.


🏰 A real welcome screen for !help

Before this pass, typing !help could feel like opening a locked door with no key.

MB486 changes that. A plain !help now shows a proper entry point with:

categories
navigation examples
help search
help level
help chansets
help <command>
help #channel

This makes the bot discoverable for humans, not just for the person who wrote it.


πŸͺ„ Detailed help for small categories

MB487 improves category display.

Small categories now show useful one-line descriptions:

factoid  - Show details of a fact
learn    - Store a shared channel fact
whatis   - Recall a shared channel fact

Large categories remain compact to avoid NOTICE spam.


🧯 Two real production help bugs fixed

MB488 fixes two bugs seen from a real production screenshot.

First, the help welcome screen was too long and got truncated by the NOTICE queue limit.
It is now compact enough to fit below the cap.

Second, help <category> did not actually work for every category shown in the index.
That is fixed too.

Examples now expected to work:

!help
!help general
!help radio
!help commands factoids

πŸ•°οΈ New command: !onthisday / !otd

MB489 adds a nostalgia feature for long-lived channels.

!onthisday
!otd

The bot looks into CHANNEL_LOG and shows what happened on the same calendar day in previous years.

It reports things like:

number of messages
number of years found
active people
a representative old message

The output is sent as private NOTICE, so it does not flood the channel.

This feature uses existing channel history and the composite CHANNEL_LOG index added earlier. No new table is needed.


πŸ”§ MB490: one last help collision fixed before commit

During the final review, one small but real inconsistency was found.

MB488 promised that when a word is both a category and a command, the command wins.

Expected:

!help stats
β†’ help for the stats command

But a legacy shortcut still routed stats to the stats category.

MB490 fixes that:

!help stats  -> command help for stats
!help logs   -> stats/logs/tools category
!help tools  -> stats/logs/tools category

A new regression test protects this behavior.


⚠️ Important upgrade note for existing instances

This round adds the OnThisDay chanset migration, and previous recent work also added factoids and DidYouMean migrations.

For an existing instance such as Undernet, do not assume the schema is obvious from memory.

After pulling the code, run the schema drift helper against the real config and generate the migration plan:

perl tools/check_schema_drift.pl --conf=mbundernet.conf --generate-migration

Then review/apply what it generates for that instance, and only then run the strict check:

perl tools/check_schema_drift.pl --conf=mbundernet.conf --strict --types

This matters because mbundernet.conf points to the actual target database.
The migration state must be verified against that database, not guessed from mediabot.sql.


βœ… Validation target

Before pushing this as release-ready work, the expected checks are:

perl t/test_commands.pl --filter '695_mb484|696_mb485|697_mb486|698_mb487|699_mb488|700_mb489|701_mb490'

perl tools/security_audit.pl
perl tools/startup_integrity_check.pl

git diff --check

Then the full suite:

perl t/test_commands.pl

πŸ§ͺ Live checks to run

Useful real-world checks after deploy:

!help
!help general
!help stats
!help logs
!help tools
!help commands factoids
!onthisday
!otd

Expected behavior:

help screen is not truncated
help category names work
help stats shows command help
logs/tools still route to the stats category
onthisday works without channel flood

πŸ¦‰ Summary

This pass does not try to reinvent Mediabot. It makes the existing bot easier to approach and safer to ship.

The big wins:

help is cleaner
help is discoverable
help categories are coherent
dispatch/help drift is guarded
production help bugs are fixed
on-this-day adds channel nostalgia
schema migration workflow is clarified for real instances

Mediabot v3.3 is getting close β€” not because it has more tricks, but because the everyday experience is becoming solid.

You must be logged in to reply.