]> iEval git - app-fonbot-daemon.git/blame_incremental - lib/App/FonBot/Plugin/OFTC.pm
Fix resources in Makefile.PL
[app-fonbot-daemon.git] / lib / App / FonBot / Plugin / OFTC.pm
... / ...
CommitLineData
1package App::FonBot::Plugin::OFTC;
2
3our $VERSION = '0.000_5';
4
5use v5.14;
6use strict;
7use warnings;
8
9use parent qw/App::FonBot::Plugin::IRC/;
10
11use POE;
12use POE::Component::IRC::Plugin::AutoJoin;
13use POE::Component::IRC::Plugin::Connector;
14use POE::Component::IRC::Plugin::NickServID;
15
16use App::FonBot::Plugin::Config qw/$oftc_enabled $oftc_nick @oftc_channels $oftc_nickserv_password/;
17
18##################################################
19
20sub _start{
21 return unless $oftc_enabled;
22 my $self=$_[OBJECT];
23
24 $self->{irc} = POE::Component::IRC->spawn(
25 Nick => $oftc_nick,
26 Username => $oftc_nick,
27 Ircname => 'FonBot OFTC Transport',
28 Server => 'irc.oftc.net',
29 Port => 6697,
30 UseSSL => 1,
31 );
32 $self->{irc}->yield(register => qw/msg/);
33 $self->{irc}->yield(connect => {});
34
35 $self->{irc}->plugin_add(Connector => POE::Component::IRC::Plugin::Connector->new);
36 $self->{irc}->plugin_add(AutoJoin => POE::Component::IRC::Plugin::AutoJoin->new(
37 Channels => \@oftc_channels
38 ));
39
40 $self->{irc}->plugin_add(NickServID => POE::Component::IRC::Plugin::NickServID->new(
41 Password => $oftc_nickserv_password
42 ));
43
44 $_[KERNEL]->alias_set('OFTC');
45}
46
471;
48
49__END__
50
51=head1 NAME
52
53App::FonBot::Plugin::OFTC - FonBot pluginthat provides the OFTC user interface
54
55=head1 SYNOPSIS
56
57 use App::FonBot::Plugin::OFTC;
58 App::FonBot::Plugin::OFTC->init;
59
60 END {App::FonBot::Plugin::OFTC->fini};
61
62=head1 DESCRIPTION
63
64This is one of the two implementations of C<App::FonBot::Plugin::IRC>. It connects to OFTC, joins C<$oftc_channel>, identifies with NickServ using the C<$oftc_nickserv_password> password, and processes received commands.
65
66=head1 CONFIGURATION VARIABLES
67
68These are the L<App::FonBot::Plugin::Config> configuration variables used in this module
69
70=over
71
72=item C<$oftc_enabled>
73
74If false, the OFTC plugin is disabled.
75
76=item C<$oftc_nick>
77
78IRC nickname.
79
80=item C<@oftc_channels>
81
82List of channels to join.
83
84=item C<$oftc_nickserv_password>
85
86Password to identify to NickServ with.
87
88=back
89
90=head1 AUTHOR
91
92Marius Gavrilescu C<< <marius@ieval.ro> >>
93
94=head1 COPYRIGHT AND LICENSE
95
96Copyright 2013 Marius Gavrilescu
97
98This file is part of fonbotd.
99
100fonbotd is free software: you can redistribute it and/or modify
101it under the terms of the GNU Affero General Public License as published by
102the Free Software Foundation, either version 3 of the License, or
103(at your option) any later version.
104
105fonbotd is distributed in the hope that it will be useful,
106but WITHOUT ANY WARRANTY; without even the implied warranty of
107MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
108GNU Affero General Public License for more details.
109
110You should have received a copy of the GNU Affero General Public License
111along with fonbotd. If not, see <http://www.gnu.org/licenses/>
112
113
114=cut
115
This page took 0.020006 seconds and 4 git commands to generate.