Skip to content

Conversation

@L0neGamer
Copy link
Contributor

Make the cache slightly more explicit in its two failure states so that users are less likely to get confused why they can't access it.

@aquarial
Copy link
Collaborator

aquarial commented Sep 9, 2023

Thinking about another way to approach this:

The cache uses two parts from the InternalReady event right now: the User object, and a PartialApplication.

Both of those have a REST endpoint (https://discord.com/developers/docs/resources/user#get-user https://discord.com/developers/docs/resources/application#get-current-application)

The code already runs a REST request for GetCurrentUser before running discordOnStart.

We can run both these rest requests and populate the cache at the beginning! The external interface would remain the same because the cache would always be populated and now it's safe to lookup during the onStart handler

It would require more rejigging of Discord.hs to pass things around in the right order to initialize the caceh

@aquarial
Copy link
Collaborator

Here''s an implementation: #190

@L0neGamer
Copy link
Contributor Author

closed in favour of #190

@L0neGamer L0neGamer closed this Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants