mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 10:03:31 +01:00
feat: api v9 and threads (#5570)
Co-authored-by: Noel <icrawltogo@gmail.com> Co-authored-by: Amish Shah <dev@shah.gg> Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com> Co-authored-by: SynthGhost <60333233+synthghost@users.noreply.github.com> Co-authored-by: SpaceEEC <24881032+SpaceEEC@users.noreply.github.com> Co-authored-by: Elliot <elliot@maisl.fr> Co-authored-by: Antonio Román <kyradiscord@gmail.com> Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
This commit is contained in:
@@ -92,6 +92,8 @@ class Webhook {
|
||||
* @typedef {BaseMessageOptions} WebhookMessageOptions
|
||||
* @property {string} [username=this.name] Username 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.
|
||||
* <info>For interaction webhooks, this property is ignored</info>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -115,6 +117,11 @@ class Webhook {
|
||||
* .then(message => console.log(`Sent message: ${message.content}`))
|
||||
* .catch(console.error);
|
||||
* @example
|
||||
* // Send a basic message in a thread
|
||||
* webhook.send('hello!', { threadID: '836856309672348295' })
|
||||
* .then(message => console.log(`Sent message: ${message.content}`))
|
||||
* .catch(console.error);
|
||||
* @example
|
||||
* // Send a remote file
|
||||
* webhook.send({
|
||||
* files: ['https://cdn.discordapp.com/icons/222078108977594368/6e1019b3179d71046e463a75915e7244.png?size=2048']
|
||||
@@ -169,7 +176,7 @@ class Webhook {
|
||||
.post({
|
||||
data,
|
||||
files,
|
||||
query: { wait: true },
|
||||
query: { thread_id: apiMessage.options.threadID, wait: true },
|
||||
auth: false,
|
||||
})
|
||||
.then(d => {
|
||||
|
||||
Reference in New Issue
Block a user