2 # CLI/Support.pl: Stubs for functions that are from IRC/*
3 # Author: Tim Riker <Tim@Rikers.org>
4 # Version: v0.1 (20021028)
11 use vars qw($uh $message);
14 &status("Using CLI...");
15 &status("Now type what you want.");
17 $nuh = "local!local\@local";
21 $ident = $param{'ircUser'};
22 $chan = $talkchannel = "_local";
27 # install libterm-readline-gnu-perl to get history support
29 my $term = new Term::ReadLine 'infobot';
30 my $prompt = "$who> ";
31 #$OUT = $term->OUT || STDOUT;
32 while ( defined ($_ = $term->readline($prompt)) ) {
36 last if ($message =~ m/^quit$/);
37 $_ = &process() if $message;
43 my ($nick, $msg) = @_;
45 &ERROR("msg: nick == NULL.");
51 &WARN("msg: msg == $msg.");
57 } elsif ($postprocess = &getChanConf('postprocess', $talkchannel)) {
58 &DEBUG("say: $postprocess $msg");
59 &parseCmdHook($postprocess . ' ' . $msg);
64 &status(">$nick< $msg");
66 print("$nick: $msg\n");
69 # Usage: &action(nick || chan, txt);
71 my ($target, $txt) = @_;
73 &WARN("action: txt == NULL.");
77 if (length $txt > 480) {
78 &status("action: txt too long; truncating.");
79 chop($txt) while (length $txt > 480);
82 &status("* $ident/$target $txt");
86 my ($nick,$chan) = @_;
90 sub performStrictReply {
98 sub performAddressedReply {
99 return unless ($addressed);
105 # vim:ts=4:sw=4:expandtab:tw=80