mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-03-26 20:09:37 +00:00
API: Fixed UserRateLimit 0 and omitempty
This commit is contained in:
parent
6dafb30401
commit
bd32b19645
|
@ -85,8 +85,8 @@ type ModifyChannelData struct {
|
|||
Topic json.OptionString `json:"topic,omitempty"`
|
||||
NSFW json.OptionBool `json:"nsfw,omitempty"`
|
||||
|
||||
// 0-21600, refer to Channel.UserRateLimit
|
||||
UserRateLimit discord.Seconds `json:"rate_limit_per_user,omitempty"`
|
||||
// 0-21600 seconds, refer to (discord.Channel).UserRateLimit.
|
||||
UserRateLimit json.OptionInt `json:"rate_limit_per_user,omitempty"`
|
||||
|
||||
// Voice only
|
||||
// 8000 - 96000 (or 128000 for Nitro)
|
||||
|
|
|
@ -112,9 +112,13 @@ func (h *Handler) ChanFor(fn func(interface{}) bool) (out <-chan interface{}, ca
|
|||
}
|
||||
})
|
||||
|
||||
// Only allow cancel to be called once.
|
||||
var once sync.Once
|
||||
cancel = func() {
|
||||
removeHandler()
|
||||
close(closer)
|
||||
once.Do(func() {
|
||||
removeHandler()
|
||||
close(closer)
|
||||
})
|
||||
}
|
||||
out = result
|
||||
|
||||
|
|
Loading…
Reference in a new issue