nyxx-discord / nyxx

Wrapper around Discord API for Dart
Apache License 2.0
326 stars 49 forks source link

Prevent events from being dropped during the connection process #612

Closed abitofevrything closed 10 months ago

abitofevrything commented 10 months ago

Description

Prevents events from being added to broadcast streams before the client is returned from Nyxx.connectGateway (or, at least, until the user is able to access the event streams e.g via plugins).

Also fixes an issue where using getters and Stream.map caused every gateway event to be parsed multiple times, scaling with the number of listeners on the client's event streams.

Also fixes an issue where IDENTIFY calls were not rate limited if they were not made as part of the initial Gateway connection (e.g during a reconnect).

Type of change

Checklist: