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

Fixes #12: add a command "!"

parent 4cc995e4
Aucune branche associée trouvée
Étiquettes
Aucune requête de fusion associée trouvée
...@@ -16,6 +16,9 @@ my $dbh; ...@@ -16,6 +16,9 @@ my $dbh;
my @insultes = ("Ahahahah ! 23 à 0 !", "C'est la piquette, Jack !", "Tu sais pas jouer, Jack !", "T'es mauvais, Jack !"); my @insultes = ("Ahahahah ! 23 à 0 !", "C'est la piquette, Jack !", "Tu sais pas jouer, Jack !", "T'es mauvais, Jack !");
# store a chan last command
my %command;
sub setConf { sub setConf {
my ($ircNew, $dbhNew, $log, $lastIDnew) = @_; my ($ircNew, $dbhNew, $log, $lastIDnew) = @_;
...@@ -42,6 +45,13 @@ sub exec { ...@@ -42,6 +45,13 @@ sub exec {
my ($kernel, $user, $chan, $msg) = @_; my ($kernel, $user, $chan, $msg) = @_;
my ($nick, $mask) = split(/!/,$user); my ($nick, $mask) = split(/!/,$user);
if ($msg eq '!' and $command{lc $chan->[0]}) {
$msg = $command{lc $chan->[0]};
}
else {
$command{lc $chan->[0]} = $msg;
}
if ($msg =~ /^ *!fav(?: (\S+))? *$/) { if ($msg =~ /^ *!fav(?: (\S+))? *$/) {
my $index = $1; my $index = $1;
try { try {
......
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