Rechercher une page de manuel
IRC::Bot::Quote.3pm
Langue: en
Version: 2006-01-25 (mandriva - 01/05/08)
Section: 3 (Bibliothèques de fonctions)
NAME
Quote.pm - A module to record user quotes for IRC::Bot.SYNOPSIS
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?"); }
}
DESCRIPTION
Provides methods for recording quotes for users on a channelMETHODS
- quote_set()
- 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()
- 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.
Use like so:
my $get = $quote->quote_query( $nick ); $kernel->post( 'privmsg', $where, $get );
- quote_forget()
- 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.
Use like so:
my $forget = $quote->quote_forget( $nick ); $kernel->post( 'privmsg', $where, $forget );
CREDITS
See BotAUTHOR
Benjamin Smith defitro@just-another.netSEE ALSO
Bot POE::Component::IRC Cache::FileCacheContenus ©2006-2024 Benjamin Poulain
Design ©2006-2024 Maxime Vantorre