Use go-humanize for somewhat nicer duration output.

master
Icedream 2017-08-15 00:40:47 +02:00
parent 872537f722
commit 35d7201500
Signed by: icedream
GPG Key ID: 1573F6D8EFE4D0CF
1 changed files with 2 additions and 1 deletions

View File

@ -12,6 +12,7 @@ import (
"net/http"
"github.com/dustin/go-humanize"
"github.com/icedream/go-footballdata"
"github.com/olekukonko/tablewriter"
"github.com/thoj/go-ircevent"
@ -412,7 +413,7 @@ func main() {
cmd := parseCommand(msg)
log.Printf("Antispam check: %s, %s", event.Source, cmd.Name)
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
}