From ce4f671be50e88fb5c2e007dcd5fa3bd8715d1fb Mon Sep 17 00:00:00 2001
From: Alexandre Morignot <erdnaxeli@cervoi.se>
Date: Tue, 29 Mar 2016 23:53:35 +0200
Subject: [PATCH] PlayBot::commands::parser::tag use channel last id only if
 not precised

---
 PlayBot/commands/parser.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/PlayBot/commands/parser.pm b/PlayBot/commands/parser.pm
index 5793e38..c953c66 100644
--- a/PlayBot/commands/parser.pm
+++ b/PlayBot/commands/parser.pm
@@ -147,10 +147,10 @@ sub exec {
 }
 
 sub tag {
-    my ($msg, $chan) = @_;
+    my ($msg, $chan, $id) = @_;
     my @tags = ($msg =~ /(?:^| )(#[a-zA-Z0-9_]+)/g);
 
-    my $id = PlayBot::utils::id::get($chan);
+    $id = PlayBot::utils::id::get($chan) if (not defined($id));
     PlayBot::commands::tag::exec($id, "@tags");
 
     return @tags;
-- 
GitLab