diff --git a/plugins/counter.go b/plugins/counter.go index 14cc2e5..0f3f0b9 100644 --- a/plugins/counter.go +++ b/plugins/counter.go @@ -116,6 +116,10 @@ func (p *CounterPlugin) Message(message bot.Message) bool { return true } else if len(parts) == 1 { + if len(parts[0]) < 3 { + return false + } + subject := strings.ToLower(nick) itemName := strings.ToLower(parts[0])[:len(parts[0])-2] diff --git a/plugins/downtime.go b/plugins/downtime.go index 86d9009..4bb2f3d 100644 --- a/plugins/downtime.go +++ b/plugins/downtime.go @@ -77,8 +77,11 @@ func (p *DowntimePlugin) Message(message bot.Message) bool { sort.Sort(entries) tops := "The top entries are: " for _, e := range entries { + // filter out ZNC entries - if !strings.HasPrefix(e.Nick, "*") { + if strings.HasPrefix(e.Nick, "*") { + p.remove(e.Nick) + } else { tops = fmt.Sprintf("%s%s: %s ", tops, e.Nick, time.Now().Sub(e.LastSeen)) } } @@ -140,7 +143,7 @@ func (p *DowntimePlugin) Event(kind string, message bot.Message) bool { } else if kind == "PART" { p.remove(strings.ToLower(message.User.Name)) } else { - log.Println("Unknown event: ", message) + log.Println("Unknown event: ", kind, message.User, message) p.record(strings.ToLower(message.User.Name)) } return false