Forum teuk.org

๐Ÿงชโœจ Mediabot v3 enters the Room of Requirements: profiles, moods, duels, quotes and achievement

in Mediabot ยท started by TeuK ยท 3w ago

TeuK ยท 3w ago

Some Mediabot v3 updates are about wiring, stability, caches, SQL hygiene, and all the tiny spells that keep the castle standing.

This one is different.

This one gives Mediabot more presence in the channel.

Not more noise. Not more bloat. Something better: more memory, more playfulness, more awareness of what is happening around it.

Mediabot now starts to feel less like a command parser sitting in a corner, and more like a strange little enchanted object in the common room: watching the rhythm of the channel, remembering small victories, starting games, reading the mood, drawing portraits, and turning old IRC traces into social memory.

Welcome to the Room of Requirements pass.


๐Ÿงช What kind of update is this?

This is not a database migration.

No SQL schema change was required.

Instead, this pass builds on existing data:

CHANNEL_LOG
KARMA
QUOTES
TRIVIA_SCORES
in-memory runtime data
JSON achievement persistence
Prometheus metrics

The idea is simple:

Mediabot already sees a lot.
Now it can do more interesting things with what it sees.

This update adds a large set of social and playful commands, while keeping the implementation inside the existing architecture.


๐Ÿ† Achievements: tiny trophies for IRC life

Mediabot now has a real achievements system.

Achievements are stored in:

var/achievements.json

That means no database schema change was needed.

Achievements can be unlocked when users talk, gain karma, answer trivia, use wordcount, win duels, consult the mood, solve quotegames, and more.

Examples include:

๐Ÿ‘‹ First Steps
๐Ÿ’ฌ Chatterbox
๐Ÿ“ข Megaphone
โญ Legend
๐ŸŒŸ Karma Star
๐ŸŽฏ Trivia Sniper
โš”๏ธ Duel Warrior
๐Ÿ”ฎ Star Gazer
๐Ÿ’ž Matchmaker
๐Ÿ•ต๏ธ Quote Detective
๐ŸŽผ Polyphony

Mediabot can now say:

๐Ÿ† Achievement Unlocked! teuk โ†’ ๐ŸŒŸ Karma Star

It is a small thing, but it changes the feeling of the bot.

IRC has always had memory. Now Mediabot gives some of that memory a shape.


๐Ÿชž !profil: a small magical portrait

The new !profil command gives a compact identity card for a nick on the current channel.

It gathers several signals:

first seen / last seen
message count
rank
days seen
karma
trivia score
24h activity pattern
achievements unlocked

Example style:

!profil teuk

Output concept:

โ•โ•โ• teuk on #boulets โ•โ•โ•  joined 2007-05-12 ยท last 3m ago
  ๐Ÿ’ฌ 47k msgs (rank #1, 6987d seen) ยท ๐ŸŒŸ karma +142 ยท ๐Ÿง  trivia 89
  ๐Ÿ“ˆ 24h: โ–‚โ–„โ–ˆโ–† ยท peak 22h-23h ยท ๐Ÿ† 11/24

It is not just a statistic dump.

It is a quick portrait of a presence.

A little Mirror of Erised for IRC logs, except less dangerous and with more SQL.


๐Ÿงญ !radar: reading the channelโ€™s pulse

!radar is a diagnostic command for channel activity.

It looks for things like:

activity spikes
quiet periods
newcomers
silent ghosts
karma vortex
loudest recent nicks

The default mode reads the present moment.

The historical mode reads a period:

!radar 7d

That gives a small sparkline and highlights the best and quietest days.

This is useful for moderation, curiosity, and just getting a sense of whether the channel is alive, sleeping, or suddenly on fire.

In Hogwarts terms: it is a Marauderโ€™s Map for channel activity.

Except it does not say โ€œI solemnly swearโ€ first.


๐Ÿงญ !dashboard: the channel at a glance

Where !profil is about one nick, !dashboard is about the whole channel.

It summarizes:

total messages
number of nicks
active users in the last hour
top contributors
7-day activity sparkline
24h heatmap
karma activity
achievement count

Example concept:

โ•โ•โ• Dashboard #boulets โ•โ•โ•
  ๐Ÿ’ฌ 2.1M msgs from 1247 nicks ยท ๐Ÿ”Š 23 active in last 60min
  ๐Ÿ‘‘ top: teuk:47k menz:34k poyan:28k
  ๐Ÿ“… 7d: โ–‚โ–„โ–ˆโ–†โ–ƒโ–…โ–‡ ยท ๐Ÿ•ง 24h: โ–โ–โ–‚โ–ƒโ–„โ–†โ–ˆโ–ˆโ–‡โ–…
  โœจ karma 7d: +47/-12
  ๐Ÿ† achievements unlocked on #boulets: 87

It turns the channel into a living scoreboard.

Not competitive in a harsh way. More like the enchanted hourglasses in Hogwarts: quiet, visible, and oddly satisfying.


๐ŸŽฒ !duel: d20 justice for the brave and the foolish

The new !duel command lets two present users face each other with a d20 roll.

Rules include:

natural 20 = critical bonus
natural 1 = fumble penalty
winner gains karma
loser loses karma
24h cooldown per pair
ties do not trigger cooldown

Example:

!duel menz

Concept:

โš”๏ธ teuk (๐ŸŽฒ17) vs menz (๐ŸŽฒ20 ๐Ÿ”ฅCRIT โ†’ 25)
๐Ÿ† menz wins! (+1 karma to menz, -1 to teuk)

It is silly.

It should be silly.

IRC needs silly.

But it is still built with guardrails:

no duel against yourself
no duel against the bot
target must be present
cooldown prevents abuse

That is the right kind of chaos: playful, but not completely feral.


๐Ÿ”ฎ !horoscope: deterministic nonsense, as tradition demands

!horoscope gives a daily IRC horoscope.

It is deterministic:

same nick + same date = same horoscope

So it feels magical while still being testable.

It can include:

mood
event
advice
warning
lucky number
color
chance percentage

Example concept:

โœจ Horoscope du 2026-06-04 pour teuk โ€” humeur magnรฉtique ๐Ÿงฒ
  Un grep nรฉgligรฉ rรฉvรจlera une perle cachรฉe dans tes logs.
  Conseil : commit avant de partir manger.
  ๐ŸŽฒ Chiffre 47 ยท ๐ŸŽจ couleur ardoise ยท ๐Ÿ€ chance 73%

This is one of those features that does not need to be useful to be good.

It just needs to make people smile.


๐Ÿ’ž !compat: IRC affinity, but with receipts

!compat compares two nicks using several dimensions:

hourly overlap
shared vocabulary
mutual karma
co-presence

Example:

!compat teuk menz

Concept:

๐Ÿ’ž teuk โ†” menz : 73% รขmes sล“urs IRC
  ๐Ÿ•‘ hours 22/30 ยท ๐Ÿ“ vocab 18/30 ยท โœจ karma 16/20 ยท ๐Ÿ”„ co-presence 17/20

It is not meant to be scientific.

It is meant to be fun, grounded in real channel traces, and just believable enough to start a conversation.

The best IRC features are often like that.

Half tool. Half joke. Half social glue.

Yes, that is three halves.

Mediabot does not care.


๐Ÿ“œ !quotegame: old quotes become a game

!quotegame turns the existing QUOTES table into a guessing game.

The bot picks a quote, hides the author, and people try to guess who said it.

Example:

๐Ÿ“œ Quotegame! Who said: "j'aurais besoin d'un grep mais sans le warning sur stderr"

Players answer by naming a nick.

The first correct answer scores.

There are also helper commands:

!quotegame top
!quotegame stop

This is a beautiful use of old IRC memory.

Logs and quotes stop being archives.

They become a game.

One detail remains intentionally noted for a future polish pass: the timeout is currently checked lazily when new messages arrive. A proactive timer can be added later, cleanly, without rushing it into this commit.


๐ŸŒก๏ธ !mood: reading the room

!mood analyzes the last hour of channel activity.

It looks at:

positive words
negative words
question marks
exclamation marks
emoji usage
message volume

Example concept:

๐ŸŒก๏ธ Mood #boulets (last 60min): โ˜€๏ธ joyful 73% ยท energy: medium
  18 positives | 7 negatives | 4 ? | 23 ! | top emoji: ๐Ÿ˜‚ร—6

It supports both French and English words.

It does not pretend to understand the human soul.

It just gives a playful approximation of the room.

And sometimes, that is enough.


๐Ÿ“Š Prometheus metrics

This pass also continues the observability work.

New or extended metrics include things like:

mediabot_achievements_unlocked_total{achievement}
mediabot_duel_total{channel}
mediabot_horoscope_total
mediabot_compat_total{channel}
mediabot_quotegame_correct_total
mediabot_mood_total{channel}

That means these social features can also become Grafana panels later.

Because of course they can.

A bot that can duel people should obviously be graphable.


๐Ÿ›ก๏ธ Runtime polish before commit

A few important polishing fixes were made before this update was committed.

The new command handlers were exported properly so dispatch calls do not fail at runtime.

Some Unicode strings were corrected so the bot prints actual symbols instead of raw \x{...} text.

Achievements now persist immediately when unlocked, avoiding the risk of losing a fresh achievement during a debounce window.

This is the quiet part, but it matters.

The spell is only fun if the wand does not explode.


๐Ÿงช Suggested tests

Useful quick checks:

!achievements
!achievements list
!profil teuk
!radar
!radar 7d
!dashboard
!horoscope
!compat teuk menz
!mood
!quotegame
!quotegame stop

For duel:

!duel SomeNickPresentOnChannel
!duel stats
!duel top

Runtime logs to watch:

Undefined subroutine
Wide character
SQL error
Use of uninitialized value
Achievements save error

๐Ÿ•ฏ Final note

This update is not just about adding commands.

It changes what Mediabot feels like.

Before, it was already useful.

Now it is starting to become more social.

It remembers tiny victories. It draws little portraits. It reads the room. It starts games. It compares people in ridiculous but charming ways. It turns quotes into riddles. It makes the channel feel a little more alive.

That is the Room of Requirements energy:

the command appears when the channel needs it

Not because the bot is trying to be loud.

Because the room finally has more stories to tell.

๐Ÿงชโœจ

You must be logged in to reply.