| 1 | package Bot::BasicBot::Pluggable::Terminal; | ||
| 2 | $Bot::BasicBot::Pluggable::Terminal::VERSION = '1.20'; | ||
| 3 | use warnings; | ||
| 4 | use strict; | ||
| 5 | use base qw(Test::Bot::BasicBot::Pluggable); | ||
| 6 | |||
| 7 | # Loader lets you tell the bot to load other modules. | ||
| 8 | |||
| 9 | sub run { | ||
| 10 | my $self = shift; | ||
| 11 | while (1) { | ||
| 12 | last if eof STDIN; | ||
| 13 | my $in = <STDIN>; | ||
| 14 | chomp $in; | ||
| 15 | |||
| 16 | # strip off whitespace before and after the message | ||
| 17 | $in =~ s!(^\s*|\s*$)!!g; | ||
| 18 | |||
| 19 | last if $in eq 'quit'; | ||
| 20 | my $ret = $self->tell( $in, 1, 1, $ENV{USER} ); | ||
| 21 | print "$ret\n" if $ret; | ||
| 22 | } | ||
| 23 | } | ||
| 24 | |||
| 25 | 1; | ||
| 26 | |||
| 27 | __END__ | ||
| 28 | |||
| 29 | =head1 NAME | ||
| 30 | |||
| 31 | bot-basicbot-pluggable.pl - A standard Bot::BasicBot::Pluggable script | ||
| 32 | |||
| 33 | =head1 VERSION | ||
| 34 | |||
| 35 | version 1.20 | ||
| 36 | |||
| 37 | =head1 DESCRIPTION | ||
| 38 | |||
| 39 | A standard Bot::BasicBot::Pluggable interface. You can /query the bot | ||
| 40 | to load in more modules. Change the admin password ASAP - See perldoc | ||
| 41 | L<Bot::BasicBot::Pluggable::Auth> for details of this. | ||
| 42 | |||
| 43 | =head1 USAGE | ||
| 44 | |||
| 45 | bot-basicbot-pluggable-cli | ||
| 46 | |||
| 47 | =head2 SEE ALSO | ||
| 48 | |||
| 49 | Bot::BasicBot::Pluggable |