Net::IRC::SeenExt - Tracks the times people spoke lastly
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";
Net::IRC::SeenExt is a role which installs a event handler listening for all PRIVMSGs. Each time people say something (in public), the current time and the text they said is saved.
Net::IRC::SeenExt
PRIVMSG
If the (optional) role parameter public is set to a true value, Net::IRC::SeenExt installs a public command handler matching ?seen nick
public
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.
seen(Str $nick)
$nick
Beware: This role uses syntax which is not yet accepted, see thread "Syntax for specifying role parameters" on p6l.
Ingo Blechschmidt <iblech@web.de>
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.
To install Perl6::Pugs, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl6::Pugs
CPAN shell
perl -MCPAN -e shell install Perl6::Pugs
For more information on module installation, please visit the detailed CPAN module installation guide.