NAME
Seen.pm - A module for handling seen requests for IRC::Bot.
SYNOPSIS
use IRC::Bot::Seen;
my $seen = IRC::Bot::Seen->new();
# later on...
# Log join event, assuming Poe::Component::IRC use..
sub on_join {
my ( $kernel, $who, $where ) = @_[ KERNEL, ARG0, ARG1 ];
my $nick = ( split /!/, $who )[0];
# Do Stuff...
$seen->log_seen( $nick, "Joining $where" );
}
DESCRIPTION
Provides seen functionality for an IRC bot.
METHODS
- log_seen()
-
log_seen() takes two arguments, stores info into cache. Returns nothing.
Use like so:
$seen->log_seen( $nick, $msg );
- get_seen()
-
get_seen() takes a nickname as an argument. Checks to see if nick is defined in the cache and returns the results.
Use like so:
$seen->get_seen( $nick );
- load_current()
-
load_current() takes list from irc_353 (names command) as an argument and loads it into the cache, so current users on the channel are seen.
Use like so:
$seen->load_current( $names );
- clear_seen()
-
clear_seen() clears the cache, takes no args.
CREDITS
See IRC::Bot
AUTHOR
Benjamin Smith defitro@just-another.net
SEE ALSO
IRC::Bot POE::Component::IRC Cache::FileCache