This commit adds the ErrorReplier callback into Context, which allows
the user to implement a custom way to format errors, such as putting
them into an embed.
* Gateway: Fix gateway reconnect
This commit uses the correct timeout, Gateway.ReconnectTimeout, when reconnecting. Furthermore, it adds a delay between consecutive, failed reconnects.
* Gateway: Stop pacemaker when calling Gateway.CloseGracefully
* API: remove unnecessary leading/trailing whitespaces
* Gateway: Add Gateway.OnScalingRequired callback
* Gateway: Make all user initiated user closures graceful and ensure that closures are respected during reconnects
* Gateway: Fix typo
* Gateway: Add Gateway.ReconnectAttempts and deprecate .ReconnectTimeout
* Gateway: Add Gateway.Pause and reexport .Reconnect and .ReconnectCtx
* Gateway: Improve the Gateway.OnShardingRequired docs
* Wsutil: Code cleanup
This commit modifies Gateway constructors to allow the user to easily
feed existing Identifier instances as well as updating those instances
to adhere to the Discord-returned gateway rate limits.
These changes should make it easier for typical bot sharding, although
automatic sharding is not implemented.
* gateway: add the possibility of graceful closure
* wsutil: rename ConnGracefulCloser to GracefulCloser
* Gateway: rename Gateway.CloseSession to .CloseGracefully
This commit consists of these smaller commits:
Gateway: SessionID to be a method for thread safety
This commit breaks the SessionID field of the Gateway struct to
be thread-safe by wrapping its access with a read-write mutex.
As this is a bug fix, it is reasonable of a breaking change
Heart: Allow later binding of event channel
Voice: Use the new Heart API
Heart: Fixed data races
Heart: Allow changing pace, thread-safe Heartbeat