Skip to content

Commit

Permalink
fix(TextBasedChannel): return the cached message instead of clone it (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
StefansArya committed Oct 24, 2021
1 parent b6c9fd6 commit ceaf738
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/structures/interfaces/TextBasedChannel.js
Expand Up @@ -171,13 +171,7 @@ class TextBasedChannel {
const { data, files } = await messagePayload.resolveFiles();
const d = await this.client.api.channels[this.id].messages.post({ data, files });

const existing = this.messages.cache.get(d.id);
if (existing) {
const clone = existing._clone();
clone._patch(d);
return clone;
}
return this.messages._add(d);
return this.messages.cache.get(d.id) ?? this.messages._add(d);
}

/**
Expand Down

0 comments on commit ceaf738

Please sign in to comment.