Skip to content
Extraits de code Groupes Projets
Valider 8c0162c0 rédigé par Alexandre Morignot's avatar Alexandre Morignot
Parcourir les fichiers

Correction of regex for the !later command

parent 863cd558
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -302,13 +302,12 @@ sub on_speak ...@@ -302,13 +302,12 @@ sub on_speak
return; return;
} }
elsif ($msg =~ /^!later( ([0-9]*)( in ([0-9]*)(h|m|s)?)?)?/) { elsif ($msg =~ /^!later(?: ([0-9]+))?(?: in ([0-9]*)?(h|m|s)?)?/) {
my ($id, $time, $unit) = ($2, $4, $5); my ($id, $time, $unit) = ($1, $2, $3);
$id = $lastID if (!$id); $id = $lastID if (!$id);
$time = 6 if (!$time); $time = 6 if (!$time);
$time *= ($unit eq 's') ? 1 : ($unit eq 'm') ? 60 : 3600; $time *= ($unit eq 's') ? 1 : ($unit eq 'm') ? 60 : 3600;
print "$time eq\n";
$kernel->delay_set('_later', $time, $nick, $id); $kernel->delay_set('_later', $time, $nick, $id);
return; return;
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter