3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-01 17:16:39 +02:00

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 $where = 'WHERE ';
my $and = ''; 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) { 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";
push @params, "%+$nick+%";
$where = ''; $where = '';
$and = 'AND '; $and = 'AND ';
} }

View File

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