.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "AnyEvent::IRC 3pm" .TH AnyEvent::IRC 3pm "2022-06-06" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" AnyEvent::IRC \- An event based IRC protocol client API .SH "VERSION" .IX Header "VERSION" Version 0.97 .SH "SYNOPSIS" .IX Header "SYNOPSIS" Using the simplistic AnyEvent::IRC::Connection: .PP .Vb 2 \& use AnyEvent; \& use AnyEvent::IRC::Connection; \& \& my $c = AnyEvent\->condvar; \& \& my $con = new AnyEvent::IRC::Connection; \& \& $con\->connect ("localhost", 6667); \& \& $con\->reg_cb ( \& connect => sub { \& my ($con) = @_; \& $con\->send_msg (NICK => \*(Aqtestbot\*(Aq); \& $con\->send_msg (USER => \*(Aqtestbot\*(Aq, \*(Aq*\*(Aq, \*(Aq0\*(Aq, \*(Aqtestbot\*(Aq); \& }, \& irc_001 => sub { \& my ($con) = @_; \& print "$_[1]\->{prefix} says I\*(Aqm in the IRC: $_[1]\->{params}\->[\-1]!\en"; \& $c\->broadcast; \& } \& ); \& \& $c\->wait; .Ve .PP Using the more sophisticated AnyEvent::IRC::Client: .PP .Vb 2 \& use AnyEvent; \& use AnyEvent::IRC::Client; \& \& my $c = AnyEvent\->condvar; \& \& my $timer; \& my $con = new AnyEvent::IRC::Client; \& \& $con\->reg_cb (registered => sub { print "I\*(Aqm in!\en"; }); \& $con\->reg_cb (disconnect => sub { print "I\*(Aqm out!\en"; $c\->broadcast }); \& $con\->reg_cb ( \& sent => sub { \& my ($con) = @_; \& \& if ($_[2] eq \*(AqPRIVMSG\*(Aq) { \& print "Sent message!\en"; \& \& $timer = AnyEvent\->timer ( \& after => 1, \& cb => sub { \& undef $timer; \& $con\->disconnect (\*(Aqdone\*(Aq) \& } \& ); \& } \& } \& ); \& \& $con\->send_srv ( \& PRIVMSG => \*(Aqelmex\*(Aq, \& "Hello there I\*(Aqm the cool AnyEvent::IRC test script!" \& ); \& \& $con\->connect ("localhost", 6667, { nick => \*(Aqtestbot\*(Aq }); \& $c\->wait; \& $con\->disconnect; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The AnyEvent::IRC module consists of AnyEvent::IRC::Connection, AnyEvent::IRC::Client and AnyEvent::IRC::Util. AnyEvent::IRC is just a module that holds this overview over the other modules. .PP AnyEvent::IRC can be viewed as toolbox for handling \s-1IRC\s0 connections and communications. It won't do everything for you, and you still need to know a few details of the \s-1IRC\s0 protocol. .PP AnyEvent::IRC::Client is a more highlevel \s-1IRC\s0 connection that already processes some messages for you and will generated some events that are maybe useful to you. It will also do \s-1PING\s0 replies for you, manage channels a bit, nicknames and \s-1CTCP.\s0 .PP AnyEvent::IRC::Connection is a lowlevel connection that only connects to the server and will let you send and receive \s-1IRC\s0 messages. AnyEvent::IRC::Connection does not imply any client behaviour, you could also use it to implement an \s-1IRC\s0 server. .PP Note that these modules use AnyEvent as it's \s-1IO\s0 event subsystem. You can integrate them into any application with a event system that AnyEvent has support for (eg. Gtk2 or Event). .SH "EXAMPLES" .IX Header "EXAMPLES" See the samples/ directory for some examples on how to use AnyEvent::IRC. .SH "AUTHOR" .IX Header "AUTHOR" Robin Redeker, \f(CW\*(C`\*(C'\fR .SH "SEE ALSO" .IX Header "SEE ALSO" AnyEvent::IRC::Util .PP AnyEvent::IRC::Connection .PP AnyEvent::IRC::Client .PP AnyEvent .PP \&\s-1RFC 1459\s0 \- Internet Relay Chat: Client Protocol .PP \&\s-1RFC 2812\s0 \- Internet Relay Chat: Client Protocol .SH "BUGS" .IX Header "BUGS" Please report any bugs or feature requests to \&\f(CW\*(C`bug\-net\-irc3 at rt.cpan.org\*(C'\fR, or through the web interface at . I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. .SH "SUPPORT" .IX Header "SUPPORT" You can find documentation for this module with the perldoc command. .PP .Vb 1 \& perldoc AnyEvent::IRC .Ve .PP You can also look for information at: .IP "\(bu" 4 AnnoCPAN: Annotated \s-1CPAN\s0 documentation .Sp .IP "\(bu" 4 \&\s-1CPAN\s0 Ratings .Sp .IP "\(bu" 4 \&\s-1RT: CPAN\s0's request tracker .Sp .IP "\(bu" 4 Search \s-1CPAN\s0 .Sp .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" Thanks to Marc Lehmann for the new AnyEvent module! .PP And these people have helped to work on AnyEvent::IRC: .PP .Vb 6 \& * Maximilian Gass \- Added support for ISUPPORT and CASEMAPPING. \& * Zaba \- Thanks for the useful input about IRC. \& * tokuhirom \- Thanks for patches for the kick event. \& * Kazuhiro Osawa \- Thanks for the documentation fix. \& * Angel Abad \- Thanks for the spelling fixes. \& * Lee Aylward \- Thanks for bug spotting and fixing. .Ve .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright 2006\-2009 Robin Redeker, all rights reserved. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.