Forum teuk.org

πŸ§™β€β™‚οΈ Mediabot v3 β€” MB497 β†’ MB502: Channel engagement gets a soul

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

TeuK Β· 1mo ago

Mediabot v3 is still on the safe 3.2dev-* line while the future 3.3 release is being shaped.

This round is not about random feature sprawl. It is about making long-lived IRC channels feel alive: remembering people, surfacing history, celebrating quotes, showing activity, and giving a channel a sense of progress.


πŸ‘€ !seen becomes more useful

!seen already had the basics, but the last message could be ugly when it contained IRC formatting codes or control characters.

MB497 cleans that up.

The last stored message is now sanitized before display:

colors removed
bold/reset/reverse/italic/underline removed
control chars replaced
spaces normalized
text bounded safely

It also adds a small activity hint:

[N msg in last 24h]

So instead of only knowing that someone was seen three hours ago, the channel can tell whether they are an active regular or just passing through.

Example:

teuk was last seen 3h ago on #teuk saying: salut ! [42 msg in last 24h]

🌑️ !mood gets a pulse

!mood already measured the channel mood over the last hour.

MB498 adds the missing social pulse:

driven by: alice (25), bob (12), carol (7)
peak today: 21h-22h (88 msgs)

So the command now answers three questions:

How does the channel feel?
Who is driving the conversation?
When did the channel peak today?

The new pulse is best-effort. If the extra queries fail, the base mood still works.


πŸ“… !onthisday can target a date

!onthisday was already a strong nostalgia feature, but it only looked at today’s calendar date.

MB499 adds explicit dates:

!onthisday
!onthisday 12-25
!onthisday 01/01
!otd 07-14

The default behavior remains unchanged, and the daily digest remains compatible.

The SQL uses bound placeholders for the date, not interpolation.


🧯 !mood is hardened

MB500 closes two robustness gaps in !mood.

Before this pass, !mood could run multiple CHANNEL_LOG scans without:

a DB availability guard
a cooldown

Now it has both.

If the DB is unavailable, the command answers cleanly instead of crashing.

If someone spams !mood, the bot asks them to wait.


πŸ† Quote hall of fame: !topquote

MB501 adds a real hall of fame for quotes.

New commands:

!topquote
!topquote 10
!halloffame

Quotes now get a recall counter:

QUOTES.hits

The counter is incremented when a quote is displayed by id or randomly. Search/list views do not count, to avoid noise.

Example output:

Hall of fame #teuk β€” most recalled quotes:
  1. [id:42] <alice> the legendary line (18 recalls)
  2. [id:17] <bob> another classic (9 recalls)

There is a graceful fallback before migration: if the hits column is not present yet, the command lists recent quotes instead of crashing.


🎯 Channel milestones: !milestone

MB502 adds a channel-progress feature.

New commands:

!milestone
!milestones

It reports:

total public messages logged
next round milestone
remaining messages
progress percentage
ETA based on the last 30 days
logging start date
lifetime average

Example:

#teuk: 98,750 public messages logged
  next milestone: 100,000 (1,250 to go, 98%) Β· ~4 days at 300 msg/day
  logging since 2019-03-15 (7.3 years) Β· lifetime average 37 msg/day

This is read-only and uses the existing CHANNEL_LOG.

No hot-path automatic announcement was added, deliberately. Automatic milestone announcements would need a scheduler-based design later, not a COUNT(*) on every message.


⚠️ Upgrade note for existing instances

This pass adds a real schema change:

QUOTES.hits

and its migration:

install/migrations/20260710_quotes_hits.sql

For an existing instance such as Undernet, do not guess the schema state.

Generate the migration plan against the real config:

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

Then review/apply the generated migration plan, including the quotes hits migration if needed.

After that, 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.
A fresh install uses install/mediabot.sql, but an upgraded instance must be checked against its own live schema.


βœ… Suggested validation before commit

Focused tests:

perl t/test_commands.pl --filter '707_mb497|708_mb498|709_mb499|710_mb500|711_mb501|712_mb502'

Safety checks:

perl tools/security_audit.pl
perl tools/startup_integrity_check.pl
git diff --check

Full suite:

perl t/test_commands.pl

πŸ§ͺ Live smoke tests

Run on a channel with real history:

!seen <nick>
!mood
!onthisday
!onthisday 01-01
!topquote
!topquote 10
!halloffame
!milestone

Expected:

seen output is clean and bounded
mood shows pulse and cooldown works
onthisday accepts explicit dates
topquote works after migration
topquote does not crash before migration
milestone shows total/progress/ETA

πŸ¦‰ Summary

This pass makes Mediabot feel less like a command box and more like a channel companion.

The big wins:

cleaner and richer !seen
social pulse in !mood
date-targeted !onthisday
hardened mood command
quote hall of fame
channel milestones
one small schema evolution for quote recalls

This is strong 3.3 material.

You must be logged in to reply.