summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <>2005-08-02 14:34:15 +0000
committererdgeist <>2005-08-02 14:34:15 +0000
commite166c810083dec53e36c1821f12805c2609dc1e5 (patch)
tree7a9020ed7688002a594ed88ad38fa07a426f46ad
parent541c3322acb4976b172cac6283c2285b9b996edc (diff)
\!magic introduced, <reply> +
-rw-r--r--bot.pl5
1 files changed, 4 insertions, 1 deletions
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{
204 #search in our knowledge 204 #search in our knowledge
205 my $thr = join ' ', $dbh->selectrow_array( 205 my $thr = join ' ', $dbh->selectrow_array(
206 "SELECT trigger, hilfsverb, reply FROM knowledge WHERE trigger = ? ORDER BY RANDOM() LIMIT 1", undef, $msg ); 206 "SELECT trigger, hilfsverb, reply FROM knowledge WHERE trigger = ? ORDER BY RANDOM() LIMIT 1", undef, $msg );
207 $thr =~ s/^.*?(?:<reply> )(.*)$/$1/; 207 $thr =~ s/^.*?(?:<reply> +?)(.*)$/$1/;
208 $thr =~ s/!who/$nick/g; 208 $thr =~ s/!who/$nick/g;
209 $thr =~ s'!date'francoise_date()'eg; 209 $thr =~ s'!date'francoise_date()'eg;
210 $thr =~ s'!time'francoise_time()'eg; 210 $thr =~ s'!time'francoise_time()'eg;
@@ -236,6 +236,9 @@ sub irc_priv_msg{
236 $kernel->post( 'francoise', 'privmsg', $channel, $1) 236 $kernel->post( 'francoise', 'privmsg', $channel, $1)
237 if( $msg =~ /^!say (.*)$/ ); 237 if( $msg =~ /^!say (.*)$/ );
238 238
239 $kernel->post( 'francoise', $1, $2, $3, $4 )
240 if $msg =~ /^!magic +(\S+) +(\S+) +(\S+) (.*)/;
241
239 print "PRIV: [$nick] $msg\n"; 242 print "PRIV: [$nick] $msg\n";
240} 243}
241 244