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> ";
32 #$OUT = $term->OUT || STDOUT;
33 while ( defined( $_ = $term->readline($prompt) ) ) {
37 last if ( $message =~ m/^quit$/ );
38 $_ = &process() if $message;
44 my ( $nick, $msg ) = @_;
45 if ( !defined $nick ) {
46 &ERROR('msg: nick == NULL.');
50 if ( !defined $msg ) {
52 &WARN("msg: msg == $msg.");
59 elsif ( $postprocess = &getChanConf( 'postprocess', $talkchannel ) ) {
60 &DEBUG("say: $postprocess $msg");
61 &parseCmdHook( $postprocess . ' ' . $msg );
66 &status(">$nick< $msg");
68 print("$nick: $msg\n");
71 # Usage: &action(nick || chan, txt);
73 my ( $target, $txt ) = @_;
74 if ( !defined $txt ) {
75 &WARN('action: txt == NULL.');
79 if ( length $txt > 480 ) {
80 &status('action: txt too long; truncating.');
81 chop($txt) while ( length $txt > 480 );
84 &status("* $ident/$target $txt");
88 my ( $nick, $chan ) = @_;
92 sub performStrictReply {
100 sub performAddressedReply {
101 return unless ($addressed);
107 # vim:ts=4:sw=4:expandtab:tw=80