summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Gerus <rgerus@dpd.com.pl>2015-12-22 13:51:36 +0100
committerRobert Gerus <rgerus@dpd.com.pl>2015-12-22 13:51:36 +0100
commit0712fc143852ade90a0e3e594385e4fdd7409afd (patch)
tree3038e37313122a18ab3176ed398b92f7fc8e1db7
parent183404c9e7fe12e64987aa2543281c1b8db9a28c (diff)
downloadgorepost-0712fc143852ade90a0e3e594385e4fdd7409afd.tar.gz
gorepost-0712fc143852ade90a0e3e594385e4fdd7409afd.tar.bz2
gorepost-0712fc143852ade90a0e3e594385e4fdd7409afd.tar.xz
gorepost-0712fc143852ade90a0e3e594385e4fdd7409afd.zip
This does not to be in init()
-rw-r--r--bot/urltitle.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/bot/urltitle.go b/bot/urltitle.go
index 7e12fe9..ccb46ec 100644
--- a/bot/urltitle.go
+++ b/bot/urltitle.go
@@ -16,8 +16,8 @@ import (
"github.com/arachnist/gorepost/irc"
)
-var trimTitle *regexp.Regexp
-var trimLink *regexp.Regexp
+var trimTitle = regexp.MustCompile("[\\s]+")
+var trimLink = regexp.MustCompile("^.*?http")
var enc = charmap.ISO8859_2
func youtube(vid string) string {
@@ -124,7 +124,5 @@ func linktitle(output func(irc.Message), msg irc.Message) {
}
func init() {
- trimTitle = regexp.MustCompile("[\\s]+")
- trimLink = regexp.MustCompile("^.*?http")
addCallback("PRIVMSG", "LINKTITLE", linktitle)
}