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

print duration when available

parent 88ada682
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -83,13 +83,24 @@ sub parse {
}
# message sur irc
my $msg = '['.$id.'] '.$content{'title'};
if (defined $content{'author'}) {
$irc->yield(privmsg => $chan => '['.$id.'] '.$content{'title'}.' | '.$content{'author'}) ;
$msg .= ' | '.$content{'author'};
}
else {
$irc->yield(privmsg => $chan => '['.$id.'] '.$content{'title'}) ;
if (defined $content{'duration'}) {
my $h = int($content{'duration'} / 3600);
my $m = int(($content{'duration'} % 3600) / 60);
my $s = int(($content{'duration'} % 3600) % 3600);
$msg .= ' ( ';
$msg .= sprintf("%02d:", $h) if ($h > 0);
$msg .= sprintf("%02d:", $m);
$msg .= sprintf("%02d", $s);
$msg .= ' )';
}
$irc->yield(privmsg => $chan => $msg);
# insertion du chan
my $sth = $dbh->prepare_cached('
INSERT INTO playbot_chan (content, chan, sender_irc)
......
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