diff options
-rw-r--r-- | main.go | 5 | ||||
-rw-r--r-- | re.go | 6 |
2 files changed, 5 insertions, 6 deletions
@@ -38,6 +38,11 @@ func (n *Notify) Write(p []byte) (int, error) { func privmsg(room string) irc.HandlerFunc { last := make(map[string]string) return func(conn *irc.Conn, line *irc.Line) { + defer func() { + if r := recover(); r != nil { + log.Println("panic", r) + } + }() switch t := line.Text(); { case isFlood(t): if line.Nick != conn.Me().Nick { @@ -1,17 +1,11 @@ package main import ( - "log" "regexp" "strings" ) func re(s, r string, global bool) string { - defer func() { - if r := recover(); r != nil { - log.Println("panic", r) - } - }() // min: at least two separators if len(s) < 2 { return "" |