Plugin/Quotegrabs: `rq` now properly searches multi-grabs

This commit is contained in:
Pragmatic Software 2023-03-30 06:33:33 -07:00
parent 640f866829
commit d8b19eff68
2 changed files with 8 additions and 3 deletions

View File

@ -114,9 +114,14 @@ sub get_random_quotegrab {
my $where = 'WHERE ';
my $and = '';
# multi-grabs have the nick separated by +'s so we must test for
# nick, nick+*, *+nick, and *+nick+* to match each of these cases
if (defined $nick) {
$sql .= $where . 'nick LIKE ? ';
$sql .= $where . 'nick LIKE ? OR nick LIKE ? OR nick LIKE ? OR nick LIKE ?';
push @params, "$nick";
push @params, "$nick+%";
push @params, "%+$nick";
push @params, "%+$nick+%";
$where = '';
$and = 'AND ';
}

View File

@ -25,8 +25,8 @@ use PBot::Imports;
# These are set by the /misc/update_version script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 4640,
BUILD_DATE => "2023-03-23",
BUILD_REVISION => 4641,
BUILD_DATE => "2023-03-30",
};
sub initialize {}