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

Fixes #18: we save last command ONLY if it's actually a command

parent 9e67b2bb
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -48,9 +48,6 @@ sub exec {
if ($msg eq '!' and $command{lc $chan->[0]}) {
$msg = $command{lc $chan->[0]};
}
else {
$command{lc $chan->[0]} = $msg;
}
if ($msg =~ /^ *!fav(?: (\S+))? *$/) {
my $index = $1;
......@@ -75,24 +72,25 @@ sub exec {
elsif ($msg =~ /^( *!tag)(?:( +)(-?\d+))?/) {
my $index = $3;
my $id;
my $tags;
if ($3) {
$msg = substr $msg, (length $1) + (length $2) + (length $3);
$tags = substr $msg, (length $1) + (length $2) + (length $3);
}
else {
$msg = substr $msg, (length $1) + (length $2);
$tags = substr $msg, (length $1) + (length $2);
}
try {
$id = utils::id::get($chan->[0], $index);
commands::tag::exec($id, $msg);
commands::tag::exec($id, $tags);
} catch {
$irc->yield(privmsg => $chan->[0] => $insultes[rand @insultes]);
};
}
elsif ($msg =~ /^( *!get)(?: +.*)?$/) {
$msg = substr $msg, (length $1) + 1;
my @args = ($chan, $msg);
my $query = substr $msg, (length $1) + 1;
my @args = ($chan, $query);
my $id = commands::get::exec(@args);
if ($id) {
......@@ -119,6 +117,7 @@ sub exec {
return 0;
}
$command{lc $chan->[0]} = $msg;
return 1;
}
......
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