Auth.pm - A module to handle sessions for IRC::Bot.
use IRC::Bot::Auth my $seen = IRC::Bot::Auth->new(); # later on... # Check to see if $nick has existing session sub on_public { my ( $kernel, $who, $where, $msg ) = @_[ KERNEL, ARG0, ARG1, ARG2 ]; my $nick = ( split /!/, $who )[0]; # Do Stuff... my $check = $auth->is_auth( $nick ); if ( $check != 1 ) { # Do stuff... } else { # Denied } }
Provides session handling for IRC::Bot.
is_auth() takes one argument, users nick, and checks to see if they are authed. Returns 0 if authed, 1 if otherwise.
Use like so:
my $check = $auth->is_auth( $nick );
get_ses() takes a nickname as an argument. Checks to see if user is authed and returns data from session.
my $nick_ses = $auth->get_ses( $nick );
auth_set() Sets users session. Takes a nick for an argument, sets session time at one hour.
$auth->auth_set( $nick );
de_auth() clears the session, takes a nick for an argument.
$auth->de_auth( $nick );
See IRC::Bot
Benjamin Smith defitro@just-another.net
IRC::Bot POE::Component::IRC Cache::FileCache
To install IRC::Bot, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IRC::Bot
CPAN shell
perl -MCPAN -e shell install IRC::Bot
For more information on module installation, please visit the detailed CPAN module installation guide.