NAME
Net::IRC::SeenExt - Tracks the times people spoke lastly
SYNOPSIS
use Net::IRC;
use Net::IRC::SeenExt;
my $bot = Net::IRC.new(...);
$bot does Net::IRC::SeenExt[public => 0];
# or
class MyBot does Net::IRC::SeenExt[public => 0] {...}
my $bot = MyBot.new(...);
my :(date => $date, text => $text) := $bot.seen("iblech");
say "iblech was last seen {time - $date}s ago, saying: $text";
DESCRIPTION
Net::IRC::SeenExt
is a role which installs a event handler listening for all PRIVMSG
s. Each time people say something (in public), the current time and the text they said is saved.
If the (optional) role parameter public
is set to a true value, Net::IRC::SeenExt
installs a public command handler matching ?seen nick
There's also the seen(Str $nick)
method, which can be used to query Net::IRC::SeenExt
for the time $nick
was last seen, too.
BUGS
Beware: This role uses syntax which is not yet accepted, see thread "Syntax for specifying role parameters" on p6l.
AUTHOR
Ingo Blechschmidt <iblech@web.de>
LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlgpl and perlartistic for details.