summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-12-26 05:03:32 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-12-26 05:03:32 +0100
commit5d506643a6b543d46d18f3ec832f84f094a4f438 (patch)
treef9488f7aa972267e15979975a5f0037e831ad8ac
parenta04048625848c4aeab33e3e2dce24e006ebe59e1 (diff)
Tweak
-rw-r--r--main.go4
-rw-r--r--re.go2
2 files changed, 3 insertions, 3 deletions
diff --git a/main.go b/main.go
index b2e3abf..68965b1 100644
--- a/main.go
+++ b/main.go
@@ -41,7 +41,7 @@ func kicker(conn *irc.Conn, channel string) chan string {
func privmsg(note, kick chan string) irc.HandlerFunc {
last := NewLast(10)
links := linker(note)
- wl := NewWatchList(5, 5*time.Second)
+ wl := NewWatchList(3, 5*time.Second)
return func(conn *irc.Conn, line *irc.Line) {
switch t := line.Text(); {
case isFlood(t):
@@ -50,7 +50,7 @@ func privmsg(note, kick chan string) irc.HandlerFunc {
c := notify(conn, line.Nick)
last.Dump(c)
close(c)
- case strings.HasPrefix(t, "s"):
+ case strings.HasPrefix(t, "s/"):
tofix := last.Last(line.Nick)
if fixed := re(tofix, t); fixed != "" {
note <- fmt.Sprintf("%v meant to say: %v",
diff --git a/re.go b/re.go
index 90a9fda..9429ac8 100644
--- a/re.go
+++ b/re.go
@@ -7,7 +7,7 @@ import (
func re(s, r string) string {
// min: s//
- if len(r) < 3 || r[0] != 's' {
+ if len(s) < 3 {
return ""
}
z := strings.Split(r[2:], string(r[1]))