Skip to content

Commit 8cdbe23

Browse files
committed
fix: set with_components when sending components through webhooks
1 parent d920933 commit 8cdbe23

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/discord.js/src/structures/Webhook.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,14 @@ class Webhook {
214214
messagePayload = MessagePayload.create(this, options).resolveBody();
215215
}
216216

217+
const { body, files } = await messagePayload.resolveFiles();
218+
217219
const query = makeURLSearchParams({
218220
wait: true,
219221
thread_id: messagePayload.options.threadId,
222+
with_components: body?.components?.length > 0,
220223
});
221224

222-
const { body, files } = await messagePayload.resolveFiles();
223225
const d = await this.client.rest.post(Routes.webhook(this.id, this.token), {
224226
body,
225227
files,

0 commit comments

Comments
 (0)