This commit updates Retry-After to be seconds-accurate instead of the
previous millisecond-accurate. Another issue (#153) is opened to get a
more accurate number, which is in the JSON body instead of the header.
This commit also removed the rate limit precision header. It also uses a
more accurate calculation algorithm to derive the reset time.
This commit changes the Overwrite type to omit the old "_new" API and
use the new field names, which are striings-serialized. The
OverwriteType is now also a strings-serialized number.
This commit fixes race conditions in both package voice, package
voicegateway and package gateway.
Originally, several race conditions exist when both the user's and the
pacemaker's goroutines both want to do several things to the websocket
connection. For example, the user's goroutine could be writing, and the
pacemaker's goroutine could trigger a reconnection. This is racey.
This issue is partially fixed by removing the pacer loop from package
heart and combining the ticker into the event (pacemaker) loop itself.
Technically, a race condition could still be triggered with care, but
the API itself never guaranteed any of those. As events are handled
using an internal loop into a channel, a race condition will not be
triggered just by handling events and writing to the websocket.
* API: fix faulty pagination behavior
This fix fixes a condition which lead to all messages getting fetched if the limit was a multiple of 100, instead of just the limit.
* API: add NewestMessages
* API: clarify MessageAfter docs
* API: adapt paginating methods for guild, member and message reaction to match the style of message's pagination methods
* API: return nil if no items were fetched
* API: remove Messages and Rename NewestMessages to Messages
* API: separate token-based and bot-based interactions with webhooks
* API: move writeMultipart to internal/multipartutil
* Multipartutil: fix double filetype-suffix