diff --git a/irc/errors.go b/irc/errors.go index 34f7fcdb..eda05ff7 100644 --- a/irc/errors.go +++ b/irc/errors.go @@ -97,5 +97,5 @@ type ThrottleError struct { } func (te *ThrottleError) Error() string { - return fmt.Sprintf(`Please wait at least %v and try again`, te.Duration) + return fmt.Sprintf(`Please wait at least %v and try again`, te.Duration.Round(time.Millisecond)) } diff --git a/irc/handlers.go b/irc/handlers.go index 05b713d2..dec5e0b7 100644 --- a/irc/handlers.go +++ b/irc/handlers.go @@ -207,7 +207,8 @@ func authenticateHandler(server *Server, client *Client, msg ircmsg.Message, rb if session.sasl.mechanism == "" { throttled, remainingTime := client.loginThrottle.Touch() if throttled { - rb.Add(nil, server.name, ERR_SASLFAIL, client.Nick(), fmt.Sprintf(client.t("Please wait at least %v and try again"), remainingTime)) + rb.Add(nil, server.name, ERR_SASLFAIL, client.Nick(), + fmt.Sprintf(client.t("Please wait at least %v and try again"), remainingTime.Round(time.Millisecond))) return false } @@ -1666,7 +1667,7 @@ func listHandler(server *Server, client *Client, msg ircmsg.Message, rb *Respons config := server.Config() if time.Since(client.ctime) < config.Channels.ListDelay && client.Account() == "" && !client.HasMode(modes.Operator) { remaining := time.Until(client.ctime.Add(config.Channels.ListDelay)) - rb.Notice(fmt.Sprintf(client.t("This server requires that you wait %v after connecting before you can use /LIST. You have %v left."), config.Channels.ListDelay, remaining)) + rb.Notice(fmt.Sprintf(client.t("This server requires that you wait %v after connecting before you can use /LIST. You have %v left."), config.Channels.ListDelay, remaining.Round(time.Millisecond))) rb.Add(nil, server.name, RPL_LISTEND, client.Nick(), client.t("End of LIST")) return false } diff --git a/irc/nickserv.go b/irc/nickserv.go index 3c6cc1d6..5d0945fe 100644 --- a/irc/nickserv.go +++ b/irc/nickserv.go @@ -811,7 +811,7 @@ func nsGroupHandler(service *ircService, server *Server, client *Client, command func nsLoginThrottleCheck(service *ircService, client *Client, rb *ResponseBuffer) (success bool) { throttled, remainingTime := client.checkLoginThrottle() if throttled { - service.Notice(rb, fmt.Sprintf(client.t("Please wait at least %v and try again"), remainingTime)) + service.Notice(rb, fmt.Sprintf(client.t("Please wait at least %v and try again"), remainingTime.Round(time.Millisecond))) } return !throttled }