From e166c810083dec53e36c1821f12805c2609dc1e5 Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Tue, 2 Aug 2005 14:34:15 +0000 Subject: \!magic introduced, + --- bot.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bot.pl b/bot.pl index c95e65b..f0f6459 100644 --- a/bot.pl +++ b/bot.pl @@ -204,7 +204,7 @@ sub irc_pub_msg{ #search in our knowledge my $thr = join ' ', $dbh->selectrow_array( "SELECT trigger, hilfsverb, reply FROM knowledge WHERE trigger = ? ORDER BY RANDOM() LIMIT 1", undef, $msg ); - $thr =~ s/^.*?(?: )(.*)$/$1/; + $thr =~ s/^.*?(?: +?)(.*)$/$1/; $thr =~ s/!who/$nick/g; $thr =~ s'!date'francoise_date()'eg; $thr =~ s'!time'francoise_time()'eg; @@ -236,6 +236,9 @@ sub irc_priv_msg{ $kernel->post( 'francoise', 'privmsg', $channel, $1) if( $msg =~ /^!say (.*)$/ ); + $kernel->post( 'francoise', $1, $2, $3, $4 ) + if $msg =~ /^!magic +(\S+) +(\S+) +(\S+) (.*)/; + print "PRIV: [$nick] $msg\n"; } -- cgit v1.2.3