WebhookClient
Defined in: packages/rest/src/webhook.ts:33
Standalone client for sending Discord webhooks.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WebhookClient(
options,restOptions?):WebhookClient
Defined in: packages/rest/src/webhook.ts:40
Parameters
Section titled “Parameters”options
Section titled “options”restOptions?
Section titled “restOptions?”retries?
Section titled “retries?”number
timeout?
Section titled “timeout?”number
Returns
Section titled “Returns”WebhookClient
Properties
Section titled “Properties”
readonlyid:string
Defined in: packages/rest/src/webhook.ts:35
Webhook ID.
readonlytoken:string
Defined in: packages/rest/src/webhook.ts:37
Webhook security token.
Methods
Section titled “Methods”deleteMessage()
Section titled “deleteMessage()”deleteMessage(
messageId,options?):Promise<void>
Defined in: packages/rest/src/webhook.ts:127
Deletes a previously sent webhook message.
Parameters
Section titled “Parameters”messageId
Section titled “messageId”string
options?
Section titled “options?”threadId?
Section titled “threadId?”string
Returns
Section titled “Returns”Promise<void>
editMessage()
Section titled “editMessage()”editMessage(
messageId,options):Promise<APIMessage>
Defined in: packages/rest/src/webhook.ts:115
Edits a previously sent webhook message. Takes the same options as WebhookClient.send, files included.
Parameters
Section titled “Parameters”messageId
Section titled “messageId”string
options
Section titled “options”string | WebhookMessageOptions
Returns
Section titled “Returns”Promise<APIMessage>
fetchMessage()
Section titled “fetchMessage()”fetchMessage(
messageId,options?):Promise<APIMessage>
Defined in: packages/rest/src/webhook.ts:102
Fetches a message this webhook sent (threadId for a message inside a thread).
Parameters
Section titled “Parameters”messageId
Section titled “messageId”string
options?
Section titled “options?”threadId?
Section titled “threadId?”string
Returns
Section titled “Returns”Promise<APIMessage>
send()
Section titled “send()”send(
options):Promise<APIMessage>
Defined in: packages/rest/src/webhook.ts:91
Sends a message to the webhook.
Parameters
Section titled “Parameters”options
Section titled “options”string | WebhookMessageOptions
Returns
Section titled “Returns”Promise<APIMessage>