Forum teuk.org

🗺️ Mediabot 3.4dev — Marauder’s Map, Remembrall and guarded event portals ⏳🪞🦉

in Mediabot · started by TeuK · 2d ago

TeuK · 2d ago

Mediabot v3 continues its 3.4 development cycle with a new round focused on script observability, practical examples and safer event-driven automation.

This is not a cosmetic update. It makes the script bridge easier to operate, easier to learn and more useful for long-running IRC communities.

🗺️ The Marauder’s Map now shows script timers

Script timers were already supported by the bridge, but operators had no simple way to see what was currently pending.

That gap is now closed.

The partyline now exposes script timers with:

.scriptdryrun timers

It shows how many timers are pending, the configured cap, and the useful metadata for each timer: name, remaining delay, channel, nick, command and script route.

There is also a controlled cleanup command:

.scriptdryrun canceltimers

It cancels pending script timers without executing anything and without unloading the whole plugin.

In Hogwarts terms: the Marauder’s Map finally shows which Time-Turners are armed, where they are going, and who cast them. 🗺️⏳

🔴 Remembrall: a real timer example

The timer system now has a reference example:

premind 300 stretch your legs

The script confirms immediately, then reminds the user later in the original channel.

The example is intentionally simple and practical. It demonstrates the complete lifecycle:

command → confirmation → timer action → delayed timer event → final reminder

It also keeps the safety rules visible:

  • one pending reminder per nick;
  • timer names are sanitized;
  • delays are validated;
  • the reminder message is bounded;
  • the delayed event never creates a timer chain.

This is the kind of example people can copy, modify and actually understand.

Neville would approve. 🔴

🪞 Guarded event portals: join, part and topic

The script bridge can now observe selected channel events:

join
part
topic

This is opt-in. Nothing is routed unless explicitly configured.

Example idea:

EVENTS=join=greet.pl,topic=topicwatch.pl

The design stays deliberately cautious:

  • unknown event names are ignored;
  • there is no fallback to the default script;
  • self-events are not executed;
  • cooldown is enforced per event and channel;
  • script output still goes through the usual apply, IRC and channel-scope guards;
  • errors in event observers cannot break the historical IRC handlers.

So the Mirror of Erised now reflects arrivals, departures and topic changes — but only through guarded doors. 🪞

🛡️ Anti-storm protection

Join and part events can arrive in waves, especially during reconnects, services bursts or netsplits.

To avoid turning the bridge into a fork storm, event routes have a cooldown. By default, a given event/channel pair can trigger only once per window.

That matters. A bot that reacts to every single join in a large burst is not clever; it is dangerous.

This update chooses the safer path.

🧪 Validation

This round was validated with:

10316/10316 tests passed

The previous steps in the same arc also validated:

10231/10231 tests passed  — partyline timer visibility
10267/10267 tests passed  — premind timer example

The startup integrity checks remain clean, and the changes do not require a database schema change.

🧙 Summary

This round makes Mediabot’s script bridge more useful and more trustworthy:

  • operators can inspect and cancel pending script timers;
  • plugin authors get a real timer-based example;
  • scripts can observe join, part and topic events safely;
  • event routes are opt-in, scoped and cooldown-protected;
  • delayed and event-driven actions still respect the same safety gates.

A small arc on paper, but an important one for automation: Mediabot can now see more of the room without letting scripts run wild through the castle. 🪄

You must be logged in to reply.