mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-11-30 08:08:13 +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"`
|
Topic json.OptionString `json:"topic,omitempty"`
|
||||||
NSFW json.OptionBool `json:"nsfw,omitempty"`
|
NSFW json.OptionBool `json:"nsfw,omitempty"`
|
||||||
|
|
||||||
// 0-21600, refer to Channel.UserRateLimit
|
// 0-21600 seconds, refer to (discord.Channel).UserRateLimit.
|
||||||
UserRateLimit discord.Seconds `json:"rate_limit_per_user,omitempty"`
|
UserRateLimit json.OptionInt `json:"rate_limit_per_user,omitempty"`
|
||||||
|
|
||||||
// Voice only
|
// Voice only
|
||||||
// 8000 - 96000 (or 128000 for Nitro)
|
// 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() {
|
cancel = func() {
|
||||||
|
once.Do(func() {
|
||||||
removeHandler()
|
removeHandler()
|
||||||
close(closer)
|
close(closer)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
out = result
|
out = result
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue