sub _build_disp {
my ($self) = @_;
- my $disp = new NDIRC::Dispatcher;
+ my $disp = NDIRC::Dispatcher->new;
- if (my $commands = new IO::File 'commands'){
+ if (my $commands = IO::File->new('commands')){
my @commands = split /\W+/, do{local $/; <$commands>};
say "Loading commands from: @commands";
$disp->load(@commands);
}
%{$self->targets} = ();
- my $channels = new IO::File 'channels' or die $!;;
+ my $channels = IO::File->new('channels') or die $!;;
while (<$channels>){
my ($chan, @types) = split /\s+/;
say "$chan - @types";
}
}
- $c->dm_reply(1) if $p eq '!';
-
return 0 unless $self->disp->has_command($command,$c->channel);
say localtime(time) . " - $msg";
+ $c->dm_reply(1) if $p eq '!';
+
return $self->disp->run_command($c,$command,$args);
}