CVS: blootbot/src/CLI Support.pl,1.3,1.4
Brought to you by:
timriker
From: Tim R. <tim...@us...> - 2004-03-27 21:48:29
|
Update of /cvsroot/blootbot/blootbot/src/CLI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21828/src/CLI Modified Files: Support.pl Log Message: action Index: Support.pl =================================================================== RCS file: /cvsroot/blootbot/blootbot/src/CLI/Support.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Support.pl 4 Sep 2003 17:14:01 -0000 1.3 +++ Support.pl 27 Mar 2004 21:37:03 -0000 1.4 @@ -51,6 +51,22 @@ print("$nick: $msg\n"); } +# Usage: &action(nick || chan, txt); +sub action { + my ($target, $txt) = @_; + if (!defined $txt) { + &WARN("action: txt == NULL."); + return; + } + + if (length $txt > 480) { + &status("action: txt too long; truncating."); + chop($txt) while (length $txt > 480); + } + + &status("* $ident/$target $txt"); +} + sub IsNickInChan { my ($nick,$chan) = @_; return 1; |