mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
refactor: new node features (#5132)
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
@@ -22,10 +22,10 @@ class ChannelManager extends BaseManager {
|
||||
add(data, guild, cache = true) {
|
||||
const existing = this.cache.get(data.id);
|
||||
if (existing) {
|
||||
if (existing._patch && cache) existing._patch(data);
|
||||
if (guild) guild.channels?.add(existing);
|
||||
if (ThreadChannelTypes.includes(existing.type) && typeof existing.parent?.threads !== 'undefined') {
|
||||
existing.parent.threads.add(existing);
|
||||
if (cache) existing._patch(data);
|
||||
guild?.channels?.add(existing);
|
||||
if (ThreadChannelTypes.includes(existing.type)) {
|
||||
existing.parent?.threads?.add(existing);
|
||||
}
|
||||
return existing;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user