X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FApp%2FDevbot.pm;h=b1c1b2478c31d0525e05bb57498ba6b68b45e5ec;hb=4885ce98b06aaa8d1323e202307e0951195910a2;hp=1e0f5c8ff1d54a3db96c67fab02708e05639cb10;hpb=49843e25f4f9e0d01bedef23c3997857e60fada3;p=app-devbot.git diff --git a/lib/App/Devbot.pm b/lib/App/Devbot.pm index 1e0f5c8..b1c1b24 100644 --- a/lib/App/Devbot.pm +++ b/lib/App/Devbot.pm @@ -3,7 +3,7 @@ package App::Devbot; use v5.14; use strict; use warnings; -our $VERSION = 0.001003; +our $VERSION = 0.001004; use POE; use POE::Component::IRC::State; @@ -15,11 +15,10 @@ use IRC::Utils qw/parse_user/; use Getopt::Long; use POSIX qw/strftime/; +use Regexp::Common qw /net/; ################################################## -our $VERSION; - my $nick='devbot'; my $password; my $server='irc.oftc.net'; @@ -73,7 +72,10 @@ sub bot_start{ Retry_when_banned => 60, )); - $irc->yield(register => "all"); + $server = $1 if $server =~ /^($RE{net}{domain})$/; + $port = $1 if $port =~ /^([0-9]+)$/; + + $irc->yield(register => "all"); $irc->yield( connect => { Nick => $nick,