summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go16
1 files changed, 0 insertions, 16 deletions
diff --git a/main.go b/main.go
index 802fc8f..d7c6e38 100644
--- a/main.go
+++ b/main.go
@@ -2,9 +2,7 @@ package main
import (
"flag"
- "fmt"
"log"
- "strings"
irc "github.com/fluffle/goirc/client"
)
@@ -38,27 +36,13 @@ func kicker(conn *irc.Conn, channel string) chan string {
}
func privmsg(note, kick chan string) irc.HandlerFunc {
- last := NewLast(10)
links := linker(note)
return func(conn *irc.Conn, line *irc.Line) {
switch t := line.Text(); {
case isFlood(t):
kick <- line.Nick
- case t == "last":
- c := notify(conn, line.Nick)
- last.Dump(c)
- close(c)
- case strings.HasPrefix(t, "s/"):
- tofix := last.Last(line.Nick)
- if fixed := re(tofix, t); fixed != "" {
- note <- fmt.Sprintf("%v meant to say: %v",
- line.Nick, fixed)
- return
- }
- fallthrough
default:
links <- t
- last.Push(line.Time, line.Nick, t)
}
}
}