diff --git a/lib/commands/later.pm b/lib/commands/later.pm index 31d39ff74de4ecc105a2039f366f583af06560ac..9af5e8601131f496889087d1f048934055f0347d 100644 --- a/lib/commands/later.pm +++ b/lib/commands/later.pm @@ -13,7 +13,7 @@ sub exec { $time = 6 if (!$time); $time *= ($unit eq 's') ? 1 : ($unit eq 'm') ? 60 : 3600; - if ($offset == -1) { + while ($offset <= 0) { my $sth = $dbh->prepare_cached(' SELECT content FROM playbot_chan @@ -37,6 +37,7 @@ sub exec { my $content = $sth->fetch; return unless ($content); $id = $content->[0]; + $offset++; } my $sth = $dbh->prepare_cached('INSERT INTO playbot_later (content, nick, date) VALUES (?, ?, ?)');