]> ruin.nu Git - NDIRC.git/blobdiff - Bot.pm
Fix warning for uninitialized prefix
[NDIRC.git] / Bot.pm
diff --git a/Bot.pm b/Bot.pm
index 078563d8bdfa3e85e0f78da7c48d5cbd30b35799..2fc95c2ba7b55ba9386709fbf9fa924e233e3cd6 100644 (file)
--- a/Bot.pm
+++ b/Bot.pm
@@ -371,7 +371,7 @@ sub discord_channel_create {
 sub handleCommand {
        my ($self, $c, $msg) = @_;
 
-       my ($p,$command,$args) = ($msg =~ /^([.])(\S+)(?: (.+))?/);
+       my ($p,$command,$args) = ($msg =~ /^([.!])(\S+)(?: (.+))?/);
 
        if ($msg =~ m{https?://[\w.]+/.+?scan(_id|_grp)?=(\w+)}){
                if (!$command || $command =~ m{^https?://}){
@@ -385,6 +385,8 @@ sub handleCommand {
 
        say localtime(time) . " - $msg";
 
+       $c->dm_reply(1) if $p eq '!';
+
        return $self->disp->run_command($c,$command,$args);
 }