ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/Net-IRC3/samples/netirc3cl
Revision: 1.2
Committed: Sun Jul 16 02:41:37 2006 UTC (20 years, 2 months ago) by elmex
Branch: MAIN
Changes since 1.1: +1 -2 lines
Log Message:
some major change on the module layout

File Contents

# User Rev Content
1 elmex 1.1 #!/usr/bin/perl
2     use strict;
3     use Net::IRC3::Client;
4     $Net::IRC3::Client::DEBUG = 1;
5    
6     my $c = AnyEvent->condvar;
7    
8     my $i = Net::IRC3::Client->new;
9    
10 elmex 1.2 my $pc = $i->connect ("irc.plan9.de", 6667, "net_irc3", "net_irc3", "test bot");
11 elmex 1.1
12     $pc->send_chan ("#test", "PRIVMSG", "hi, i'm a bot!", "#test");
13     $pc->send_srv ("JOIN", undef, "#test");
14    
15     $pc->reg_cb (
16     irc_privmsg => sub {
17     my ($self, $msg) = @_;
18     if ($msg->{trailing} =~ m/net_irc3:\s*(.*)/) {
19     $pc->send_chan ("#test", "PRIVMSG", "yes?", "#test");
20     }
21     }
22     );
23    
24     $pc->reg_cb (
25     disconnect => sub {
26     print "DISCOPNNECT!!!\n";
27     }
28     );
29    
30     $pc->register;
31    
32     $c->wait;