diff --git a/lib/commands/get.pm b/lib/commands/get.pm index 7fcf5787a3fad4a028e92efaf35abb30279f0d03..1c45e8eb94f5e5206f72591e46c13633e86f9f9d 100644 --- a/lib/commands/get.pm +++ b/lib/commands/get.pm @@ -92,6 +92,7 @@ sub exec { if ($all) { $req = 'select id, sender, title, url, duration from playbot'; $req .= ' where '.$words_sql if ($words_sql); + $req .= ' group by id'; $req .= ' order by rand()'; $sth = $dbh->prepare($req); @@ -103,6 +104,7 @@ sub exec { join playbot_chan pc on p.id = pc.content where pc.chan = ?'; $req .= ' and '.$words_sql if ($words_sql); + $req .= ' group by p.id'; $req .= ' order by rand()'; $sth = $dbh->prepare($req);