From d4207a03af491ec7b8c159f06084115832dd630c Mon Sep 17 00:00:00 2001 From: Elysia <71698422+aiko-chan-ai@users.noreply.github.com> Date: Sun, 7 May 2023 10:18:49 +0700 Subject: [PATCH] fix: webhook.editMessage --- src/structures/Webhook.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/structures/Webhook.js b/src/structures/Webhook.js index a12f57f..e1d7fcf 100644 --- a/src/structures/Webhook.js +++ b/src/structures/Webhook.js @@ -324,10 +324,13 @@ class Webhook { let messagePayload; - if (options instanceof MessagePayload) messagePayload = options; - else messagePayload = MessagePayload.create(this, options); + if (options instanceof MessagePayload) { + messagePayload = await options.resolveData(); + } else { + messagePayload = await MessagePayload.create(this, options).resolveData(); + } - const { data, files } = await messagePayload.resolveData().resolveFiles(); + const { data, files } = await messagePayload.resolveFiles(); const d = await this.client.api .webhooks(this.id, this.token)