]> ruin.nu Git - NDIRC.git/blobdiff - Delling.pm
Universal scan parsing
[NDIRC.git] / Delling.pm
index 01097f2b318e54b9e2472bf34311e4efca472464..e04619015f4fdb8e8a5fafc39dfb79c75a5f7580 100644 (file)
@@ -162,8 +162,9 @@ sub refresh {
                });
        $scans->execute;
        while (my $scan = $scans->fetchrow_hashref){
-               $heap->{irc}->yield(notice => $scan->{nick}, "($scan->{coords} $scan->{type})"
-                       ." http://game.planetarion.com/showscan.pl?scan_id=$scan->{scan_id}");
+               $self->message("($scan->{coords} $scan->{type})"
+                       ." http://game.planetarion.com/showscan.pl?scan_id=$scan->{scan_id}"
+                       , @{$scan->{nick}});
                $sentscan->execute($scan->{id});
        }
 
@@ -236,13 +237,6 @@ after discord_message_create => sub {
 
        say localtime(time) . " - $channel_id $channel $author_name $author_id";
 
-       my ($p,$command,$args) = ($msg =~ /^([.!~])(\S+)(?: (.+))?/);
-
-
-       return 0 unless $self->disp->has_command($command,$channel);
-
-       say localtime(time) . " - $msg";
-
        my $c = NDIRC::DiscordContext->new({
                        discord_id => $author_name,
                        channel_id => $channel_id,
@@ -253,7 +247,7 @@ after discord_message_create => sub {
                        discord => $self->discord,
                });
 
-       return $self->disp->run_command($c,$command,$args);
+       return $self->handleCommand($c,$msg);
 
 };