mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 19:13:31 +01:00
feat(Webhook): allow setting appliedTags on send() (#10027)
* feat(Webhook): allow setting `appliedTags` on `send()` * docs: fix grammar Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> --------- Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -140,10 +140,12 @@ class MessagePayload {
|
|||||||
let username;
|
let username;
|
||||||
let avatarURL;
|
let avatarURL;
|
||||||
let threadName;
|
let threadName;
|
||||||
|
let appliedTags;
|
||||||
if (isWebhook) {
|
if (isWebhook) {
|
||||||
username = this.options.username ?? this.target.name;
|
username = this.options.username ?? this.target.name;
|
||||||
if (this.options.avatarURL) avatarURL = this.options.avatarURL;
|
if (this.options.avatarURL) avatarURL = this.options.avatarURL;
|
||||||
if (this.options.threadName) threadName = this.options.threadName;
|
if (this.options.threadName) threadName = this.options.threadName;
|
||||||
|
if (this.options.appliedTags) appliedTags = this.options.appliedTags;
|
||||||
}
|
}
|
||||||
|
|
||||||
let flags;
|
let flags;
|
||||||
@@ -211,6 +213,7 @@ class MessagePayload {
|
|||||||
attachments: this.options.attachments,
|
attachments: this.options.attachments,
|
||||||
sticker_ids: this.options.stickers?.map(sticker => sticker.id ?? sticker),
|
sticker_ids: this.options.stickers?.map(sticker => sticker.id ?? sticker),
|
||||||
thread_name: threadName,
|
thread_name: threadName,
|
||||||
|
applied_tags: appliedTags,
|
||||||
};
|
};
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,7 +134,9 @@ class Webhook {
|
|||||||
* @property {string} [avatarURL] Avatar URL override for the message
|
* @property {string} [avatarURL] Avatar URL override for the message
|
||||||
* @property {Snowflake} [threadId] The id of the thread in the channel to send to.
|
* @property {Snowflake} [threadId] The id of the thread in the channel to send to.
|
||||||
* <info>For interaction webhooks, this property is ignored</info>
|
* <info>For interaction webhooks, this property is ignored</info>
|
||||||
* @property {string} [threadName] Name of the thread to create (only available if webhook is in a forum channel)
|
* @property {string} [threadName] Name of the thread to create (only available if the webhook is in a forum channel)
|
||||||
|
* @property {Snowflake[]} [appliedTags]
|
||||||
|
* The tags to apply to the created thread (only available if the webhook is in a forum channel)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
1
packages/discord.js/typings/index.d.ts
vendored
1
packages/discord.js/typings/index.d.ts
vendored
@@ -6722,6 +6722,7 @@ export interface WebhookMessageCreateOptions extends Omit<MessageCreateOptions,
|
|||||||
avatarURL?: string;
|
avatarURL?: string;
|
||||||
threadId?: Snowflake;
|
threadId?: Snowflake;
|
||||||
threadName?: string;
|
threadName?: string;
|
||||||
|
appliedTags?: Snowflake[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface WebSocketOptions {
|
export interface WebSocketOptions {
|
||||||
|
|||||||
Reference in New Issue
Block a user