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:
Almeida
2024-01-15 22:29:49 +00:00
committed by GitHub
parent 7e12bee337
commit 33674be85e
3 changed files with 7 additions and 1 deletions

View File

@@ -140,10 +140,12 @@ class MessagePayload {
let username;
let avatarURL;
let threadName;
let appliedTags;
if (isWebhook) {
username = this.options.username ?? this.target.name;
if (this.options.avatarURL) avatarURL = this.options.avatarURL;
if (this.options.threadName) threadName = this.options.threadName;
if (this.options.appliedTags) appliedTags = this.options.appliedTags;
}
let flags;
@@ -211,6 +213,7 @@ class MessagePayload {
attachments: this.options.attachments,
sticker_ids: this.options.stickers?.map(sticker => sticker.id ?? sticker),
thread_name: threadName,
applied_tags: appliedTags,
};
return this;
}

View File

@@ -134,7 +134,9 @@ class Webhook {
* @property {string} [avatarURL] Avatar URL override for the message
* @property {Snowflake} [threadId] The id of the thread in the channel to send to.
* <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)
*/
/**

View File

@@ -6722,6 +6722,7 @@ export interface WebhookMessageCreateOptions extends Omit<MessageCreateOptions,
avatarURL?: string;
threadId?: Snowflake;
threadName?: string;
appliedTags?: Snowflake[];
}
export interface WebSocketOptions {