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

caching private channels #1734

Open
laralove143 opened this issue May 15, 2022 · 0 comments
Open

caching private channels #1734

laralove143 opened this issue May 15, 2022 · 0 comments
Labels
c-cache Affects the cache crate t-feature Addition of a new feature

Comments

@laralove143
Copy link
Member

Guild channels are cached on ChannelUpdate events but creating a private channel doesn't fire any events so they're not cached, this means we would either have to cache it manually or make an avoidable API request every time.

If this is approved I can try to PR it, given the method of caching.

Since there won't be any events, it'd have to be made like

let channel = http.create_private_channel(user_id).exec().await?.model().await?;
http.create_message(channel.id).content("hello")?.exec().await?;
cache.update(channel);

Another consideration is invalidation, if the user closes the DM channel, will it be an API error to try to use it? Does Discord send any events for closed channels? If not, how can we handle invalid channels?

@zeylahellyer zeylahellyer added t-feature Addition of a new feature c-cache Affects the cache crate labels May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-cache Affects the cache crate t-feature Addition of a new feature
Projects
None yet
Development

No branches or pull requests

2 participants