diff --git a/PlayBot.pl b/PlayBot.pl index 0e7be2fb81a6910adb7981e163054a91313e01c6..c820e7477bc19e4b0fbb641e55885daae1c5fc1c 100755 --- a/PlayBot.pl +++ b/PlayBot.pl @@ -296,6 +296,12 @@ sub on_speak return; } + elsif ($msg =~ /^!tag( +([0-9]+))?/) { + my $id = ($2) ? $2 : $lastID; + while ($msg =~ /#([a-zA-Z0-9_-]+)/g) { + addTag($id, $1); + } + } else { return; } @@ -333,8 +339,7 @@ sub on_speak # insertion des éventuels tags - while ($msg =~ /#([a-zA-Z0-9_-]*)/g) { - next if (!$1); + while ($msg =~ /#([a-zA-Z0-9_-]+)/g) { if ($debug) { $log->debug($1); next;