diff --git a/lib/PBot/Plugin/Quotegrabs/Storage/SQLite.pm b/lib/PBot/Plugin/Quotegrabs/Storage/SQLite.pm index 31590e08..3fc78245 100644 --- a/lib/PBot/Plugin/Quotegrabs/Storage/SQLite.pm +++ b/lib/PBot/Plugin/Quotegrabs/Storage/SQLite.pm @@ -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 '; } diff --git a/lib/PBot/VERSION.pm b/lib/PBot/VERSION.pm index f3ccd20d..0aebf583 100644 --- a/lib/PBot/VERSION.pm +++ b/lib/PBot/VERSION.pm @@ -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 {}