diff --git a/PlayBot.pl b/PlayBot.pl index affb21aa9af9c65e77286c534090dfafdcfeffbe..b556d7ecb7418fd908cf13f90588072ef4f8bb15 100755 --- a/PlayBot.pl +++ b/PlayBot.pl @@ -279,13 +279,8 @@ sub on_speak # if not, maybe there is an url we can parse my $id = sites::parser::parse(@args); - if ($id) { - # if yes, we need to save the new content's id - $lastID{$chan->[0]} = $id; - - # we insert the potiential tags - commands::parser::tag($msg, $chan); - } + # if there is a new content, there is a new id to save + $lastID{$chan->[0]} = $id if ($id); } } diff --git a/lib/sites/parser.pm b/lib/sites/parser.pm index 29eb1fb857bb22df3f13b83d893cf4af93f7ec24..e34a68910891554b8742d3d0a44eadcb9f2f44f7 100644 --- a/lib/sites/parser.pm +++ b/lib/sites/parser.pm @@ -11,6 +11,7 @@ use mixcloud; use zippy; use lib "$FindBin::Bin/lib/"; +use commands::parser; use commands::tag; our $irc; @@ -98,6 +99,9 @@ sub parse { $sth->execute($id, $chan->[0]) or $log->error("Couldn't finish transaction: " . $dbh->errstr); + # we insert the potiential tags + commands::parser::tag($msg, $chan); + if (defined $content{'context'}) { commands::tag::addContext($id, $content{'context'}); }