X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FApp%2FDevbot.pm;h=1ba7bd70229c9aea72421c26702b8ba13f54c013;hb=837fdca974108189c6f6a3179e740d3be7ddf2f5;hp=019bcc718eb5b7cfe75e33efceaa7b4d60c6341f;hpb=bb1da1df94cbd0a34ccca3df33fb3fb1e5f63f4e;p=app-devbot.git diff --git a/lib/App/Devbot.pm b/lib/App/Devbot.pm index 019bcc7..1ba7bd7 100644 --- a/lib/App/Devbot.pm +++ b/lib/App/Devbot.pm @@ -1,6 +1,9 @@ -package App::Devbot 0.001002; +package App::Devbot; + use v5.14; +use strict; use warnings; +our $VERSION = 0.001003; use POE; use POE::Component::IRC::State; @@ -12,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'; @@ -70,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,