From ceaf738d2efc4b482c8a1fc5b486df99b1d0f037 Mon Sep 17 00:00:00 2001 From: StefansArya Date: Mon, 25 Oct 2021 05:35:59 +0700 Subject: [PATCH] fix(TextBasedChannel): return the cached message instead of clone it (#6877) --- src/structures/interfaces/TextBasedChannel.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/structures/interfaces/TextBasedChannel.js b/src/structures/interfaces/TextBasedChannel.js index 83a0e26a0..4dd0a0a74 100644 --- a/src/structures/interfaces/TextBasedChannel.js +++ b/src/structures/interfaces/TextBasedChannel.js @@ -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); } /**