mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-11 20:42:38 +01:00
Add support for global Action Triggers
This commit is contained in:
parent
a69188c666
commit
ac136ef086
@ -179,7 +179,7 @@ sub actiontrigger {
|
|||||||
($channel) = split / /, $arguments, 1;
|
($channel) = split / /, $arguments, 1;
|
||||||
if (not defined $channel) {
|
if (not defined $channel) {
|
||||||
$channel = $from;
|
$channel = $from;
|
||||||
} elsif ($channel !~ m/^#/) {
|
} elsif ($channel !~ m/^#/ and $channel ne 'global') {
|
||||||
return "Usage: actiontrigger list [channel]";
|
return "Usage: actiontrigger list [channel]";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,7 +203,7 @@ sub actiontrigger {
|
|||||||
$channel = $from;
|
$channel = $from;
|
||||||
} else {
|
} else {
|
||||||
($channel, $arguments) = split / /, $arguments, 2;
|
($channel, $arguments) = split / /, $arguments, 2;
|
||||||
if ($channel !~ m/^#/) {
|
if ($channel !~ m/^#/ and $channel ne 'global') {
|
||||||
return "Usage from private message: actiontrigger add <channel> <level> <regex> <action>";
|
return "Usage from private message: actiontrigger add <channel> <level> <regex> <action>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -248,7 +248,7 @@ sub actiontrigger {
|
|||||||
$channel = $from;
|
$channel = $from;
|
||||||
} else {
|
} else {
|
||||||
($channel, $arguments) = split / /, $arguments, 2;
|
($channel, $arguments) = split / /, $arguments, 2;
|
||||||
if ($channel !~ m/^#/) {
|
if ($channel !~ m/^#/ and $channel ne 'global') {
|
||||||
return "Usage from private message: actiontrigger delete <channel> <regex>";
|
return "Usage from private message: actiontrigger delete <channel> <regex>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -334,6 +334,9 @@ sub check_trigger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
my @triggers = $self->list_triggers($channel);
|
my @triggers = $self->list_triggers($channel);
|
||||||
|
my @globals = $self->list_triggers('global');
|
||||||
|
|
||||||
|
push @triggers, @globals;
|
||||||
|
|
||||||
$text = "$nick!$user\@$host $text";
|
$text = "$nick!$user\@$host $text";
|
||||||
# $self->{pbot}->{logger}->log("Checking action trigger: [$text]\n");
|
# $self->{pbot}->{logger}->log("Checking action trigger: [$text]\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user