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

refactor fetch in !get

parent 3cd546a8
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -41,13 +41,6 @@ sub exec {
from playbot
where id = ?');
$sth->execute($words[0]);
$content = $sth->fetch;
if (!$content) {
$irc->yield(privmsg => $chan => "Je n'ai rien dans ce registre.");
return
}
}
elsif (@tags) {
my $params = join ', ' => ('?') x @tags;
......@@ -80,13 +73,6 @@ sub exec {
$sth = $dbh->prepare($req);
$sth->execute(@tags, @words_param, $chan->[0], scalar @tags);
}
$content = $sth->fetch;
if (!$content) {
$irc->yield(privmsg => $chan => "Je n'ai rien dans ce registre.");
return
}
}
else {
if ($all) {
......@@ -110,11 +96,12 @@ sub exec {
$sth = $dbh->prepare($req);
$sth->execute($chan->[0], @words_param);
}
}
$content = $sth->fetch;
if (!$content) {
if (@words) {
if (@words or @tags) {
$irc->yield(privmsg => $chan => "Je n'ai rien dans ce registre.");
}
else {
......@@ -122,7 +109,6 @@ sub exec {
}
return
}
}
# this is specific to the mysql driver
$rows = $sth->rows;
......
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