.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" 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 .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "POE::Component::IRC::Qnet 3pm" .TH POE::Component::IRC::Qnet 3pm "2018-01-01" "perl v5.26.1" "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" POE::Component::IRC::Qnet \- A fully event\-driven IRC client module for Quakenet .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& use strict; \& use warnings; \& use POE qw(Component::IRC::Qnet); \& \& my $nickname = \*(AqFlibble\*(Aq . $$; \& my $ircname = \*(AqFlibble the Sailor Bot\*(Aq; \& my $port = 6667; \& my $qauth = \*(AqFlibbleBOT\*(Aq; \& my $qpass = \*(Aqfubar\*(Aq; \& my @channels = ( \*(Aq#Blah\*(Aq, \*(Aq#Foo\*(Aq, \*(Aq#Bar\*(Aq ); \& \& # We create a new PoCo\-IRC object and component. \& my $irc = POE::Component::IRC::Qnet\->spawn( \& nick => $nickname, \& port => $port, \& ircname => $ircname, \& ) or die "Oh noooo! $!"; \& \& POE::Session\->create( \& package_states => [ \& main => [ qw(_default _start irc_001 irc_public) ], \& ], \& heap => { irc => $irc }, \& ); \& \& $poe_kernel\->run(); \& \& sub _start { \& my ($kernel, $heap) = @_[KERNEL, HEAP]; \& \& # We get the session ID of the component from the object \& # and register and connect to the specified server. \& my $irc_session = $heap\->{irc}\->session_id(); \& $kernel\->post( $irc_session => register => \*(Aqall\*(Aq ); \& $kernel\->post( $irc_session => connect => { } ); \& return; \& } \& \& sub irc_001 { \& my ($kernel, $sender) = @_[KERNEL, SENDER]; \& \& # Get the component\*(Aqs object at any time by accessing the heap of \& # the SENDER \& my $poco_object = $sender\->get_heap(); \& print "Connected to ", $poco_object\->server_name(), "\en"; \& \& # Lets authenticate with Quakenet\*(Aqs Q bot \& $kernel\->post( $sender => qbot_auth => $qauth => $qpass ); \& \& return; \& } \& \& sub irc_public { \& my ($kernel, $sender, $who, $where, $what) = @_[KERNEL, SENDER, ARG0 .. ARG2]; \& my $nick = ( split /!/, $who )[0]; \& my $channel = $where\->[0]; \& \& if ( my ($rot13) = $what =~ /^rot13 (.+)/ ) { \& $rot13 =~ tr[a\-zA\-Z][n\-za\-mN\-ZA\-M]; \& $kernel\->post( $sender => privmsg => $channel => "$nick: $rot13" ); \& } \& return; \& } \& \& # We registered for all events, this will produce some debug info. \& sub _default { \& my ($event, $args) = @_[ARG0 .. $#_]; \& my @output = ( "$event: " ); \& \& for my $arg ( @$args ) { \& if (ref $arg eq \*(AqARRAY\*(Aq) { \& push( @output, \*(Aq[\*(Aq . join(\*(Aq, \*(Aq, @$arg ) . \*(Aq]\*(Aq ); \& } \& else { \& push ( @output, "\*(Aq$arg\*(Aq" ); \& } \& } \& print join \*(Aq \*(Aq, @output, "\en"; \& return 0; \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" POE::Component::IRC::Qnet is an extension to POE::Component::IRC specifically for use on Quakenet . See the documentation for POE::Component::IRC for general usage. This document covers the extensions. .PP The module provides a number of additional commands for communicating with the Quakenet service bot Q. .SH "METHODS" .IX Header "METHODS" .ie n .SS """service_bots""" .el .SS "\f(CWservice_bots\fP" .IX Subsection "service_bots" The component will query Q its default name on Quakenet. If you wish to override these settings, use this method to configure them. .PP .Vb 1 \& $irc\->service_bots(QBOT => \*(AqW@blah.network.net\*(Aq); .Ve .PP In most cases you shouldn't need to mess with these >;o) .SH "INPUT" .IX Header "INPUT" The Quakenet service bots accept input as \s-1PRIVMSG.\s0 This module provides a wrapper around the POE::Component::IRC \*(L"privmsg\*(R" command. .ie n .SS """qbot_*""" .el .SS "\f(CWqbot_*\fP" .IX Subsection "qbot_*" Send commands to the Q bot. Pass additional command parameters as arguments to the event. .PP .Vb 1 \& $kernel\->post (\*(Aqmy client\*(Aq => qbot_auth => $q_user => $q_pass); .Ve .SH "OUTPUT EVENTS" .IX Header "OUTPUT EVENTS" All output from the Quakenet service bots is sent as NOTICEs. Use \f(CW\*(C`irc_notice\*(C'\fR to trap these. .ie n .SS """irc_whois""" .el .SS "\f(CWirc_whois\fP" .IX Subsection "irc_whois" Has all the same hash keys in \f(CW\*(C`ARG1\*(C'\fR as POE::Component::IRC, with the addition of \fB'account'\fR, which contains the name of their Q auth account, if they have authed, or a false value if they haven't. .SH "BUGS" .IX Header "BUGS" A few have turned up in the past and they are sure to again. Please use to report any. Alternatively, email the current maintainer. .SH "AUTHOR" .IX Header "AUTHOR" Chris 'BinGOs' Williams .PP Based on the original POE::Component::IRC by: .PP Dennis Taylor, .SH "SEE ALSO" .IX Header "SEE ALSO" POE::Component::IRC .PP