From ce202d03f1415529f52ac1f29385b573b23de88d Mon Sep 17 00:00:00 2001 From: raylu Date: Mon, 18 Oct 2010 14:58:49 -0400 Subject: [PATCH] Also filter out #s from YouTube videos --- handler.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/handler.go b/handler.go index 3f46c60..4bbe6c0 100644 --- a/handler.go +++ b/handler.go @@ -36,10 +36,12 @@ func handlePrivmsg(conn *irc.Conn, line *irc.Line) { video = line.Text[27:] } if video != "" { - amp := strings.Index(video, "&") - if amp > -1 { + if amp := strings.Index(video, "&"); amp > -1 { video = video[0:amp] } + if pound := strings.Index(video, "#"); pound > -1 { + video = video[0:pound] + } youtube(conn, line.Nick, video, target) }