Make the deadline configurable

This commit is contained in:
2020-01-01 16:18:13 +00:00
parent c31e8d9f51
commit 90dc6edfad
2 changed files with 7 additions and 2 deletions

View File

@@ -21,6 +21,7 @@ import (
var (
channels = flag.String("channels", "##testing,##test", "Channels to join (separated by comma)")
cooldown = flag.Int("cooldown", 120, "Command rate-limit, in seconds")
host = flag.String("host", "chat.freenode.net", "Server host[:port]")
ident = flag.String("ident", "lysenko", "Lysenko Bot")
nick = flag.String("nick", "lysenko", "Lysenko Bot")
@@ -71,6 +72,8 @@ func main() {
}
defer db.DB.Close()
deadline.Cooldown = time.Second * time.Duration(*cooldown)
mux := hugot.DefaultMux
mux.HandleHears(&quotedb.AddQuoteHandler{QuoteDB: db})
mux.HandleHears(deadline.NewHears(&quotedb.LastQuoteHandler{QuoteDB: db}))