diff options
-rw-r--r-- | bot.conf.example | 1 | ||||
-rw-r--r-- | config_file.pm | 1 | ||||
-rwxr-xr-x | idalius.pl | 3 |
3 files changed, 4 insertions, 1 deletions
diff --git a/bot.conf.example b/bot.conf.example index 29b619d..428b5eb 100644 --- a/bot.conf.example +++ b/bot.conf.example @@ -15,6 +15,7 @@ quit_msg = "Goodbye!" user = nobody group = nobody triggers = 'sa+x' => 'π· ', 'trumpet' => 'πΊ ', 'snake' => 'π ' +prefix_nick = 1 prefix = % antiflood_on = 0 diff --git a/config_file.pm b/config_file.pm index bc30cea..01991c7 100644 --- a/config_file.pm +++ b/config_file.pm @@ -24,6 +24,7 @@ sub parse_config 'group', 'url_on', 'url_len', + 'prefix_nick', 'prefix', 'antiflood_on'); my @list_configs = ( @@ -190,7 +190,8 @@ sub irc_public { return if (grep {$_ eq $nick} @{$config{ignore}}); my $stripped_what = strip_color(strip_formatting($what)); - if ($stripped_what =~ s/^$config{prefix}//) { + if ($config{prefix_nick} && $stripped_what =~ s/^\Q$current_nick\E[:,]\s+//g || + $stripped_what =~ s/^$config{prefix}//) { $output = run_command($stripped_what, $who, $where); $irc->yield(privmsg => $where => $output) if $output; strike_add($nick, $channel) if $output; |