refactor: new node features (#5132)

Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
Sugden
2021-06-30 21:40:33 +01:00
committed by GitHub
parent f108746c15
commit 1e8f01253e
68 changed files with 305 additions and 360 deletions

View File

@@ -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;
}