AnyEvent-IRC

 view release on metacpan or  search on metacpan

lib/AnyEvent/IRC/Client.pm  view on Meta::CPAN

336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
my %LOWER_CASEMAP = (
   rfc1459          => sub { tr/A-Z[]\\\^/a-z{}|~/ },
   'strict-rfc1459' => sub { tr/A-Z[]\\/a-z{}|/ },
   ascii            => sub { tr/A-Z/a-z/ },
);
 
sub new {
   my $this = shift;
   my $class = ref($this) || $this;
   my $self = $class->SUPER::new (@_);
 
   $self->reg_cb (irc_001     => \&welcome_cb);
   $self->reg_cb (irc_376     => \&welcome_cb);
   $self->reg_cb (irc_422     => \&welcome_cb);
   $self->reg_cb (irc_005     => \&isupport_cb);
   $self->reg_cb (irc_join    => \&join_cb);
   $self->reg_cb (irc_nick    => \&nick_cb);
   $self->reg_cb (irc_part    => \&part_cb);
   $self->reg_cb (irc_kick    => \&kick_cb);
   $self->reg_cb (irc_quit    => \&quit_cb);

lib/AnyEvent/IRC/Client.pm  view on Meta::CPAN

466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
               $self->register (
                  $info->{nick}, $info->{user}, $info->{real}, $info->{password}
               );
            }
 
            delete $self->{register_cb_guard};
         }
      );
   }
 
   $self->SUPER::connect ($host, $port, $timeout);
}
 
=item $cl->register ($nick, $user, $real, $server_pass)
 
Sends the IRC registration commands NICK and USER.
If C<$server_pass> is passed also a PASS command is generated.
 
NOTE: If you passed the nick, user, etc. already to the C<connect> method
you won't need to call this method, as L<AnyEvent::IRC::Client> will do that
for you.

lib/AnyEvent/IRC/Client.pm  view on Meta::CPAN

599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
=item $cl->send_msg (...)
 
See also L<AnyEvent::IRC::Connection>.
 
=cut
 
sub send_msg {
   my ($self, @a) = @_;
   $self->event (debug_send => @a);
   $self->SUPER::send_msg (@a);
}
 
=item $cl->send_srv ($command, @params)
 
This function sends an IRC message that is constructed by C<mk_msg (undef,
$command, @params)> (see L<AnyEvent::IRC::Util>). If the C<registered> event
has NOT yet been emitted the messages are queued until that event is emitted,
and then sent to the server.
 
B<NOTE:> If you stop the registered event (with C<stop_event>, see L<Object::Event>)

lib/AnyEvent/IRC/Connection.pm  view on Meta::CPAN

62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
anything else.
 
You can also access that member via the C<heap> method.
 
=cut
 
sub new {
  my $this = shift;
  my $class = ref($this) || $this;
 
  my $self = $class->SUPER::new (@_, heap => { });
 
  bless $self, $class;
 
  $self->reg_cb (
     ext_after_send => sub {
        my ($self, $mkmsg_args) = @_;
        $self->send_raw (mk_msg (@$mkmsg_args));
     }
  );



( run in 0.533 second using v1.01-cache-2.11-cpan-26ccb49234f )