mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(ChannelManager): Remove threads from cache upon deletion (#10883)
* fix(ChannelManager): remove threads from cache upon deletion * refactor: loop over thread ids --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -73,6 +73,13 @@ class ChannelManager extends CachedManager {
|
||||
|
||||
channel?.parent?.threads?.cache.delete(id);
|
||||
this.cache.delete(id);
|
||||
|
||||
if (channel?.threads) {
|
||||
for (const threadId of channel.threads.cache.keys()) {
|
||||
this.cache.delete(threadId);
|
||||
channel.guild?.channels.cache.delete(threadId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user