mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 03:53:29 +01:00
fix: set with_components when sending components through webhooks
This commit is contained in:
@@ -214,12 +214,14 @@ class Webhook {
|
|||||||
messagePayload = MessagePayload.create(this, options).resolveBody();
|
messagePayload = MessagePayload.create(this, options).resolveBody();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const { body, files } = await messagePayload.resolveFiles();
|
||||||
|
|
||||||
const query = makeURLSearchParams({
|
const query = makeURLSearchParams({
|
||||||
wait: true,
|
wait: true,
|
||||||
thread_id: messagePayload.options.threadId,
|
thread_id: messagePayload.options.threadId,
|
||||||
|
with_components: body?.components?.length > 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
const { body, files } = await messagePayload.resolveFiles();
|
|
||||||
const d = await this.client.rest.post(Routes.webhook(this.id, this.token), {
|
const d = await this.client.rest.post(Routes.webhook(this.id, this.token), {
|
||||||
body,
|
body,
|
||||||
files,
|
files,
|
||||||
|
|||||||
Reference in New Issue
Block a user