fix: channels being removed from guild.channels

This commit is contained in:
Amish Shah
2019-04-27 11:46:48 +01:00
parent 577636a46d
commit 4d7fc036a1
2 changed files with 9 additions and 7 deletions

View File

@@ -54,8 +54,11 @@ class ChannelStore extends DataStore {
add(data, guild, cache = true) {
const existing = this.get(data.id);
if (existing && existing.partial && cache) existing._patch(data);
if (existing) return existing;
if (existing && existing._patch && cache) existing._patch(data);
if (existing) {
guild.channels.add(existing);
return existing;
}
const channel = Channel.create(this.client, data, guild);