!7 concept User { S channelID, name; long greeted; } module GreetNewVisitors > DynPrintLogAndEnabled { start { dm_vmBus_onMessage_q('gotYouTubeLiveStreamMessage, voidfunc(O msg) { if (!enabled) ret; S publishedAt = getString(msg, 'publishedAt); if (cmp(publishedAt, ymdWithMinuses(now()-hoursToMS(2)) < 0) ret; // general ignore-old-messages safety thing (rough) S channelID = getString(msg, 'authorChannelId); S name = getString(msg, 'authorDisplayName); if (empty(channelID)) ret; print("Got recent message from " + name + " (" + channelID + ")"); User user = uniq_sync(User, +channelID); cset(user, +name); if (user.greeted == 0) { user.greeted = now(); print("Hello " + name); } }); } }