You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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
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?
The text was updated successfully, but these errors were encountered: