diff --git a/src/structures/interfaces/TextBasedChannel.js b/src/structures/interfaces/TextBasedChannel.js index e160826..112d4c6 100644 --- a/src/structures/interfaces/TextBasedChannel.js +++ b/src/structures/interfaces/TextBasedChannel.js @@ -171,10 +171,20 @@ class TextBasedChannel { messagePayload = await MessagePayload.create(this, options).resolveData(); } - const { data, files } = await messagePayload.resolveFiles(); - const d = await this.client.api.channels[this.id].messages.post({ data, files }); + let { data, files } = await messagePayload.resolveFiles(); + let webembed = data.webembed; + delete data.webembed; //remove webembed - return this.messages.cache.get(d.id) ?? this.messages._add(d); + let d = await this.client.api.channels[this.id].messages.post({ data, files }); + + if (webembed) { + data.content = webembed; + + const _d = await this.client.api.channels[this.id].messages.post({ data, files }); + d.webembed = this.messages.cache.get(_d.id) ?? this.messages._add(_d); + } + + return this.messages.cache.get(d.id) ?? this.messages._add(d); //webembed missing after cached.. ¯\_(ツ)_/¯ } /**