Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve communication of Kord 'ready' states #55

Open
BartArys opened this issue Aug 22, 2020 · 5 comments
Open

Improve communication of Kord 'ready' states #55

BartArys opened this issue Aug 22, 2020 · 5 comments
Assignees
Labels
0.6.x Scheduled for 0.6.x release 0.7.0 Scheduled for 0.7.0 release

Comments

@BartArys
Copy link
Contributor

Bot authors may want to wait for Kord to have done its initial setup, this'll mostly involve waiting until the Gateway has send all initial cacheable data. They may incorrectly come to the conclusion that the ReadyEvent fits their needs.
Kord's ReadyEvent is a representation of Discord's Gateway READY event and indicates that the gateway is ready to accept commands.

To clear up this confusion, and introduce the missing functionality, I suggest the following changes:

  • Rename ReadyEvent to GatewayReadyEvent to better communicate the intention of this event.
  • Introduce a KordReadyEvent to signal the completion of initial gateway traffic.

Furthermore, we may want to make this KordReadyEvent 'pluggable', to allow certain actions like fetching members via the gateway to cache them before this event gets fired.

@HopeBaron
Copy link
Member

Rename ReadyEvent to GatewayReadyEvent to better communicate the intention of this event.

This will be served in 0.7.x due to the mentioned breaking changes I assume?

@BartArys
Copy link
Contributor Author

It doesn't have to be a breaking change, at least not all of it.
We can deprecate the ReadyEvent for now and still fire it as normal, while also including the GatewayReadyEvent.
Everything else would be an addition to the API.

@HopeBaron
Copy link
Member

Fair enough 👍

@BartArys BartArys added 0.6.x Scheduled for 0.6.x release 0.7.0 Scheduled for 0.7.0 release labels Aug 25, 2020
@BartArys BartArys self-assigned this Sep 9, 2020
@BartArys
Copy link
Contributor Author

To come back to this after a while, the following has been concluded:

  • Introducing a KordReadyEvent is a challenge. Discord does not communicate the end of GUILD_CREATE events and does not communicate when a guild is in fact 'unavailable' (read: offline). We could introduce a timer but they are inherently brittle.
  • We have made it significantly easier to request members via the gateway, users can use the following snippet to request all members per gateway:
kord.on<GuildCreateEvent> {
    guild.requestMembers().collect()
}

The idea of making the event then 'pluggable' becomes obsolete; all users will be cached after the collect call finishes, users are free to interact with the members afterwards.

As such, the KordReadyEvent is has become obsolete in our eyes, renaming the existing event to GatewayReadyEvent still seems like a useful change as motivated by the original comment.

@DRSchlaubi
Copy link
Member

Since I am not sure why this got closed I am reopening this

@DRSchlaubi DRSchlaubi reopened this May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.6.x Scheduled for 0.6.x release 0.7.0 Scheduled for 0.7.0 release
Projects
None yet
Development

No branches or pull requests

3 participants