]> iEval git - app-fonbot-daemon.git/blob - OFTC.pm
ea4b701680a86fc25db4b6dbb70d81b3ae895db3
[app-fonbot-daemon.git] / OFTC.pm
1 package App::FonBot::Plugin::OFTC;
2
3 our $VERSION = '0.000_5';
4
5 use v5.14;
6 use strict;
7 use warnings;
8
9 use parent qw/App::FonBot::Plugin::IRC/;
10
11 use POE;
12 use POE::Component::IRC::Plugin::AutoJoin;
13 use POE::Component::IRC::Plugin::Connector;
14 use POE::Component::IRC::Plugin::NickServID;
15
16 use App::FonBot::Plugin::Config qw/$oftc_enabled $oftc_nick @oftc_channels $oftc_nickserv_password/;
17
18 ##################################################
19
20 sub _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
47 1;
48
49 __END__
50
51 =head1 NAME
52
53 App::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
64 This 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
68 These are the L<App::FonBot::Plugin::Config> configuration variables used in this module
69
70 =over
71
72 =item C<$oftc_enabled>
73
74 If false, the OFTC plugin is disabled.
75
76 =item C<$oftc_nick>
77
78 IRC nickname.
79
80 =item C<@oftc_channels>
81
82 List of channels to join.
83
84 =item C<$oftc_nickserv_password>
85
86 Password to identify to NickServ with.
87
88 =back
89
90 =head1 AUTHOR
91
92 Marius Gavrilescu C<< <marius@ieval.ro> >>
93
94 =head1 COPYRIGHT AND LICENSE
95
96 Copyright 2013 Marius Gavrilescu
97
98 This file is part of fonbotd.
99
100 fonbotd is free software: you can redistribute it and/or modify
101 it under the terms of the GNU Affero General Public License as published by
102 the Free Software Foundation, either version 3 of the License, or
103 (at your option) any later version.
104
105 fonbotd is distributed in the hope that it will be useful,
106 but WITHOUT ANY WARRANTY; without even the implied warranty of
107 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
108 GNU Affero General Public License for more details.
109
110 You should have received a copy of the GNU Affero General Public License
111 along with fonbotd. If not, see <http://www.gnu.org/licenses/>
112
113
114 =cut
115
This page took 0.052465 seconds and 3 git commands to generate.