X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FApp%2FDevbot.pm;h=1ba7bd70229c9aea72421c26702b8ba13f54c013;hb=837fdca974108189c6f6a3179e740d3be7ddf2f5;hp=1e0f5c8ff1d54a3db96c67fab02708e05639cb10;hpb=49843e25f4f9e0d01bedef23c3997857e60fada3;p=app-devbot.git diff --git a/lib/App/Devbot.pm b/lib/App/Devbot.pm index 1e0f5c8..1ba7bd7 100644 --- a/lib/App/Devbot.pm +++ b/lib/App/Devbot.pm @@ -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,