From 4a310f42dec5eb54211600bb99f308ad3e01b7c4 Mon Sep 17 00:00:00 2001 From: timriker Date: Sat, 27 Mar 2004 21:37:03 +0000 Subject: [PATCH] action git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@927 c11ca15a-4712-0410-83d8-924469b57eb5 --- blootbot/src/CLI/Support.pl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/blootbot/src/CLI/Support.pl b/blootbot/src/CLI/Support.pl index 6b2de5b..e61a1b3 100644 --- a/blootbot/src/CLI/Support.pl +++ b/blootbot/src/CLI/Support.pl @@ -51,6 +51,22 @@ sub msg { 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; -- 2.39.5