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

Fix threads cache #634

Merged
merged 3 commits into from
Jul 10, 2022
Merged

Fix threads cache #634

merged 3 commits into from
Jul 10, 2022

Conversation

lukellmann
Copy link
Member

@lukellmann lukellmann commented Jul 1, 2022

This PR fixes a bug that threads weren't cached when receiving Guild events.
It also deprecates Guild.threads (it does not behave like one might expect) and instead replaces it with GuildBehavior.cachedThreads.

@lukellmann lukellmann marked this pull request as ready for review July 3, 2022 13:08
@HopeBaron
Copy link
Member

Is there a way we could get these through rest?
if so we'd go with transforming this into a function that accepts a supplier

@lukellmann
Copy link
Member Author

lukellmann commented Jul 5, 2022

Is there a way we could get these through rest?
if so we'd go with transforming this into a function that accepts a supplier

You can only get active threads for a guild (and the activeThreads property already exists). To also get archived ones, you would have to request them for every channel individually, which we probably shouldn't do.
https://discord.com/developers/docs/topics/threads#enumerating-threads

@HopeBaron
Copy link
Member

your primary concern is weather you can cache it from gateway or not; it's up to the user to do it.

@lukellmann
Copy link
Member Author

What exactly does this mean for this PR?

@HopeBaron
Copy link
Member

Looking back at this this looks just fine

@lukellmann
Copy link
Member Author

Can be merged then?

@gdude2002
Copy link
Contributor

Would be great to see a merge for this

@HopeBaron HopeBaron merged commit 09d7cae into 0.8.x Jul 10, 2022
@gdude2002
Copy link
Contributor

Thanks o7

@lukellmann lukellmann deleted the fix/threads-cache branch July 10, 2022 08:11
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.

3 participants