mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-22 03:49:29 +01:00
Factoids: process regex factoids when implicitly invoked
This commit is contained in:
parent
5ffde32d46
commit
2096df16d6
@ -112,12 +112,7 @@ sub interpreter($self, $context) {
|
||||
return $self->interpreter($context);
|
||||
}
|
||||
|
||||
# keyword still not found, try regex factoids if the bot was explicitly invoked
|
||||
if (not $context->{addressed}) {
|
||||
$self->{pbot}->{logger}->log("No factoid found; disregarding error message because bot not explicitly invoked\n");
|
||||
return '';
|
||||
}
|
||||
|
||||
# keyword still not found, try regex factoids
|
||||
($channel, $keyword) =
|
||||
$self->{pbot}->{factoids}->{data}->find(
|
||||
$context->{ref_from} ? $context->{ref_from} : $context->{from},
|
||||
@ -128,6 +123,12 @@ sub interpreter($self, $context) {
|
||||
|
||||
# no such keyword, display similiar matches for all channels
|
||||
if (not defined $keyword) {
|
||||
# but only if the bot is explicitly invoked
|
||||
if (not $context->{addressed}) {
|
||||
$self->{pbot}->{logger}->log("No factoid found; disregarding error message because bot not explicitly invoked\n");
|
||||
return '';
|
||||
}
|
||||
|
||||
my $namespace = $context->{from};
|
||||
$namespace = '.*' if $namespace !~ /^#/;
|
||||
|
||||
|
@ -25,8 +25,8 @@ use PBot::Imports;
|
||||
# These are set by the /misc/update_version script
|
||||
use constant {
|
||||
BUILD_NAME => "PBot",
|
||||
BUILD_REVISION => 4687,
|
||||
BUILD_DATE => "2023-09-23",
|
||||
BUILD_REVISION => 4688,
|
||||
BUILD_DATE => "2023-09-24",
|
||||
};
|
||||
|
||||
sub initialize {}
|
||||
|
Loading…
Reference in New Issue
Block a user