+sub handleCommand {
+ my ($self, $c, $msg) = @_;
+
+ my ($p,$command,$args) = ($msg =~ /^([.!])(\S+)(?: (.+))?/);
+
+ if ($msg =~ m{https?://[\w.]+/.+?scan(_id|_grp)?=(\w+)}){
+ if (!$command || $command =~ m{^https?://}){
+ ($p,$command,$args) = ('.','addscan',$msg);
+ }elsif($command ne 'addscan'){
+ $self->handleCommand ($c, ".addscan $msg")
+ }
+ }
+
+ $c->dm_reply(1) if $p eq '!';
+
+ return 0 unless $self->disp->has_command($command,$c->channel);
+
+ say localtime(time) . " - $msg";
+
+ return $self->disp->run_command($c,$command,$args);
+}
+