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

$lastID takes care of !get

parent e24ea01a
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -60,6 +60,8 @@ sub exec {
else {
$irc->yield(privmsg => $chan => '['.$content->[0].'] '.$content->[2].' => '.$content->[3]) ;
}
return $content->[0];
}
1;
......@@ -4,6 +4,8 @@ require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(exec);
use strict;
use lib "$FindBin::Bin/lib/";
use commands::fav;
use commands::later;
......@@ -36,7 +38,7 @@ sub exec {
my ($nick,$mask) = split(/!/,$user);
if ($msg =~ /^!fav(?: ([0-9]+))?/) {
$id = ($1) ? $1 : $lastID{$chan->[0]};
my $id = ($1) ? $1 : $lastID{$chan->[0]};
commands::fav::exec($nick, $id)
}
......@@ -52,14 +54,18 @@ sub exec {
commands::tag::exec($id, $msg);
}
elsif ($msg =~ /^!get/) {
commands::get::exec(@args);
my $id = commands::get::exec(@args);
if ($id) {
$lastID{$chan->[0]} = $id;
}
}
elsif ($msg =~ /^!help/) {
$irc->yield(privmsg => $nick => '!fav [<id>] : enregistre la vidéo dans les favoris');
$irc->yield(privmsg => $nick => '!tag [<id>] <tag1> <tag2> ... : tag la vidéo');
$irc->yield(privmsg => $nick => '!later [<id>] [in <x>[s|m|h]] : vidéo rappelée par query (par défaut temps de 6h)');
$irc->yield(privmsg => $nick => '!get [<tags>] : sort aléatoirement une vidéo');
$irc->yield(privmsg => $nick => "Sans id précisée, la dernière vidéo *postée* sur le chan est utilisée (un !get n'est pas pris en compte.");
$irc->yield(privmsg => $nick => "Sans id précisée, la dernière vidéo postée sur le chan est utilisée (ça marche aussi avec !get).");
$irc->yield(privmsg => $nick => "Un tag est de la forme « #[a-zA-Z0-9_-]+ ». Par exemple « #loLILol-mdr_lol42 » est un tag valide, tandis que « #céducaca » n'en ai pas un (seul « #c » sera considéré).");
}
else {
......
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