AnyEvent-IRC
view release on metacpan or search on metacpan
lib/AnyEvent/IRC/Client.pm view on Meta::CPAN
=item $cl->ctcp_auto_reply ($ctcp_command, $coderef)
This method installs an auto-reply for the reception of the C<$ctcp_command>
via PRIVMSG, C<@msg> will be used as argument to the C<encode_ctcp> function of
the L<AnyEvent::IRC::Util> package. The replies will be sent with the NOTICE
IRC command.
If C<$coderef> was given and is a code reference, it will called each time a
C<$ctcp_command> is received, this is useful for eg. CTCP PING reply
generation. The arguments will be the same arguments that the C<ctcp> event
callbacks get. (See also C<ctcp> event description above). The return value of
the called subroutine should be a list of arguments for C<encode_ctcp>.
Currently you can only configure one auto-reply per C<$ctcp_command>.
Example:
$cl->ctcp_auto_reply ('VERSION', ['VERSION', 'ScriptBla:0.1:Perl']);
$cl->ctcp_auto_reply ('PING', sub {
my ($cl, $src, $target, $tag, $msg, $type) = @_;
lib/AnyEvent/IRC/Connection.pm view on Meta::CPAN
$self->event ('irc_*' => $m);
$self->event ('irc_' . (lc $m->{command}), $m);
}
=back
=head2 EVENTS
Following events are emitted by this module and shouldn't be emitted
from a module user call to C<event>. See also the documents L<Object::Event> about
registering event callbacks.
=over 4
=item connect => $error
This event is generated when the socket was successfully connected
or an error occurred while connecting. The error is given as second
argument (C<$error>) to the callback then.
=item disconnect => $reason
( run in 0.399 second using v1.01-cache-2.11-cpan-4e96b696675 )