Use go-humanize for somewhat nicer duration output.
parent
872537f722
commit
35d7201500
3
main.go
3
main.go
|
@ -12,6 +12,7 @@ import (
|
||||||
|
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/dustin/go-humanize"
|
||||||
"github.com/icedream/go-footballdata"
|
"github.com/icedream/go-footballdata"
|
||||||
"github.com/olekukonko/tablewriter"
|
"github.com/olekukonko/tablewriter"
|
||||||
"github.com/thoj/go-ircevent"
|
"github.com/thoj/go-ircevent"
|
||||||
|
@ -412,7 +413,7 @@ func main() {
|
||||||
cmd := parseCommand(msg)
|
cmd := parseCommand(msg)
|
||||||
log.Printf("Antispam check: %s, %s", event.Source, cmd.Name)
|
log.Printf("Antispam check: %s, %s", event.Source, cmd.Name)
|
||||||
if ok, duration := antispamInstance.Check(event.Source, cmd.Name); !ok {
|
if ok, duration := antispamInstance.Check(event.Source, cmd.Name); !ok {
|
||||||
conn.Noticef(sender, "Sorry, you need to wait %s before you can use this command again!", duration)
|
conn.Noticef(sender, "Sorry, please try again %s.", humanize.Time(time.Now().Add(duration)))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue