Quote.pm - A module to record user quotes for IRC::Bot.
use Bot::Quote my $quote = Bot::Quote->new(); # later on... # Lets look and see if they have a quote recorded. sub on_public { my ( $kernel, $who, $where, $msg ) = @_[ KERNEL, ARG0, ARG1, ARG2 ]; my $nick = ( split /!/, $who )[0]; # Do Stuff... elsif ( $msg =~ m/^!quote/i ) { my @arg = split ( / /, $msg ); my $name = $arg[1]; if ($name) { my $said = $quote->quote_query( $name ); $kernel->post( 'privmsg', $where, $said ); } else { $kernel->post( 'privmsg', $where, "Need help, $nick?"); } }
Provides methods for recording quotes for users on a channel
quote_set() takes two arguments, users nick and the quote to record.
Use like so:
my $set = $quote->set_quote( $nick, $text ); $kernel->post( 'privmsg', $where, $set );
quote_query() Takes one argument, a nick. Checks to see if nick has quote recorded. If so, it will return the quote, otherwise it will let you know if it was not found.
my $get = $quote->quote_query( $nick ); $kernel->post( 'privmsg', $where, $get );
quote_forget() Takes one argumet, a nick. This will remove the nick from the cache. Returns a message letting you know nick has been removed.
my $forget = $quote->quote_forget( $nick ); $kernel->post( 'privmsg', $where, $forget );
See Bot
Benjamin Smith defitro@just-another.net
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.