* Latency method
* fixed typo
* fixed linter error
* Renamed Latency to HeartbeatLatency
* HeartbeatLatency now returns time.Time
* return time.Duration instead, since .Sub() returns that
* Add full-stops to end of comments
This resolves#577.
ChannelVoiceJoinManual is a wrapper over sending an OP4 to Discord, for
initiating a voice server connection. The library's builtin voice
connection management locks/maps are skipped, and the library will not
attempt to manage this voice connection.
Users are expected to hook the VoiceServerUpdate event and forward the
data to an outside voice manager, such as Lavalink.
* Bump to v0.17.0
* Add members from GuildMembersChunk to state (#454)
* Revert "Add members from GuildMembersChunk to state (#454)" (#455)
This reverts commit e4487b30d4.
* travis: update go versions
* Allowed setting the game to null.
* Allowed for setting status to listening.
* Changed variable names for better consistency
* Reverted updateStatus to maintain API compatibility, instead added now
UpdateListeningStatus method which directly calls UpdateStatusComplex.
* Fix version to 0.18.0-alpha
* Make the new UpdateListeningStatus read a bit better.
* Updated setting game to nil for better compatibility.
* Remove the explicit nil check, as no longer seems to be needed.
* Fix comment styling.
* Remove idle as unused.
Now the open function will follow through a bit more and insure that the
proper sequence of events happens during the Open call. This required
some refactoring and a few mild changes in the onEvent func.
* Added ability to change the online status
* Add structs for rick presence implementation
* Refractor and publicise UpdateStatusData
* Add UpdateStatusComplex for raw status data sending
* Case gameType to int, stopped it compiling
* Might want to gofmt.
Doesn't do it on save because Gogland removed it and their new thing I
can't make sense of.
* Revert "Added ability to change the online status"
This reverts commit 235cd15a8eebbec070cb95a5853295387bceae1c.
* Change gametypeto match
* Move RLock to UpdateStatusComplex
* add custom ratelimits
* check for nil ratelimiter
* Don't expose custom ratelimits to Session
* attempt to fix race conditions
* use defer instead
* Slightly improved ratelimiter
You shouldn't need to change the ratelimiters ratelimits while its
running so I removed the functions SetCustomRatelimit and
RemoveCustomRatelimit.
* Add heartbeat ACK response and error handling
- Error when sending a heartbeat now triggers a reconnection
- Op7 now triggers a reconnection
- Session now tracks the last heartbeat ACK that was recieved. If the
last ACK is more than FailedHeartbeatAcks*heartbeatinterval in the past,
this is treated as a dead connection and a reconnection is forced.
* Address @iopred comments
This is a stability improvement but may have a slight performance
impact. This change will be reviewed again later. Doing this solves a
data race issue with the Sequence number that must be tracked for
gateway resume and heartbeats. Event specific handlers are now called
as a goroutine though.
Also cleaned up identify sending so there's now a function that handles
it instead of duplicate code. Renamed handshake* structs to identify*
structs to make naming match up.