3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-20 10:59:29 +01:00

Add factoid > nick redirection (only for factoids, not for commands)

This commit is contained in:
Pragmatic Software 2021-05-31 11:36:29 -07:00
parent 5eb5e2e6ce
commit 27bb3bab95

View File

@ -1094,6 +1094,17 @@ sub interpreter {
$context->{arguments} = "" if not defined $context->{arguments}; $context->{arguments} = "" if not defined $context->{arguments};
# factoid > nick redirection
if ($context->{arguments} =~ s/> ([_a-zA-Z0-9\[\]{}`\\-]+)$//) {
my $rcpt = $1;
if ($self->{pbot}->{nicklist}->is_present($context->{from}, $rcpt)) {
$context->{nickoverride} = $rcpt;
$context->{force_nickoverride} = 1;
} else {
$context->{arguments} .= "> $rcpt";
}
}
# if no match found, attempt to call factoid from another channel if it exists there # if no match found, attempt to call factoid from another channel if it exists there
if (not defined $keyword) { if (not defined $keyword) {
my $string = "$original_keyword $context->{arguments}"; my $string = "$original_keyword $context->{arguments}";