From d48cc9d97682b5b0d616051781b8eeacabbd9c98 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sun, 14 Feb 2016 18:29:00 -0800 Subject: [PATCH] Skip only bad triggers instead of all triggers --- PBot/Plugins/Counter.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PBot/Plugins/Counter.pm b/PBot/Plugins/Counter.pm index 09e877b4..9ea76fa8 100644 --- a/PBot/Plugins/Counter.pm +++ b/PBot/Plugins/Counter.pm @@ -588,8 +588,8 @@ sub on_public { my $message = "$nick!$user\@$host $msg"; - eval { - foreach my $trigger (@triggers) { + foreach my $trigger (@triggers) { + eval { if ($message =~ m/$trigger->{trigger}/i) { my ($desc, $timestamp) = $self->reset_counter($channel, $trigger->{target}); @@ -600,11 +600,11 @@ sub on_public { } } } - } - }; + }; - if ($@) { - $self->{pbot}->{logger}->log("Error in counter trigger: $@"); + if ($@) { + $self->{pbot}->{logger}->log("Skipping bad trigger $trigger->{trigger}: $@"); + } } $self->dbi_end;