You are reading the documentation for the next version of discord.js. Documentation for v13/v14+ has been moved to old.discordjs.dev

WebhooksAPI

export declare class WebhooksAPI
export declare class WebhooksAPI

No summary provided.

constructor(rest)
Constructs a new instance of the WebhooksAPI class
NameTypeOptionalDescription
restRESTNoNone
create(channelId, body, options?):Promise<never>
NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to create the webhook in
bodyRESTPostAPIChannelWebhookJSONBodyNoThe data to use when creating the webhook
optionsPick<RequestData, 'reason' | 'signal'>YesThe options to use when creating the webhook
delete(id, options?):Promise<void>
NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook to delete
optionsPick<RequestData, 'reason' | 'signal'> & { token?: string | undefined; }YesThe options to use when deleting the webhook
deleteMessage(id, token, messageId, query?, options?):Promise<void>
Deletes an associated message from a webhook
NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook
tokenstringNoThe token of the webhook
messageIdSnowflakeNoThe id of the message to delete
query{ thread_id?: string; }YesThe options to use when deleting the message
optionsPick<RequestData, 'signal'>YesThe options to use when deleting the message
edit(id, body, options?):Promise<APIWebhook>
NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook to edit
bodyRESTPatchAPIWebhookJSONBodyNoThe new webhook data
optionsPick<RequestData, 'reason' | 'signal'> & { token?: string | undefined; }YesThe options to use when editing the webhook
editMessage(id, token, messageId, body, options?):Promise<APIMessage>
Edits an associated message from a webhook
NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook
tokenstringNoThe token of the webhook
messageIdSnowflakeNoThe id of the message to edit
bodyRESTPatchAPIWebhookWithTokenMessageJSONBody & { files?: RawFile[]; thread_id?: string; }NoThe data to use when editing the message
optionsPick<RequestData, 'signal'>YesThe options to use when editing the message
execute(id, token, body, options?):Promise<RESTPostAPIWebhookWithTokenWaitResult>
Executes a webhook and returns the created message
NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook
tokenstringNoThe token of the webhook
bodyRESTPostAPIWebhookWithTokenJSONBody & RESTPostAPIWebhookWithTokenQuery & { files?: RawFile[]; wait: true; }NoThe data to use when executing the webhook
optionsPick<RequestData, 'signal'>YesThe options to use when executing the webhook
executeGitHub(id, token, query, query?, { signal }?):Promise<void>
NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook
tokenstringNoThe token of the webhook
queryunknownNoThe options to use when executing the webhook
queryRESTPostAPIWebhookWithTokenGitHubQueryYesThe options to use when executing the webhook
{ signal }Pick<RequestData, 'signal'>YesNone
executeSlack(id, token, query, query?, { signal }?):Promise<void>
NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook
tokenstringNoThe token of the webhook
queryunknownNoThe query options to use when executing the webhook
queryRESTPostAPIWebhookWithTokenSlackQueryYesThe query options to use when executing the webhook
{ signal }Pick<RequestData, 'signal'>YesNone
get(id, token?, options?):Promise<APIWebhook>
NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook
tokenstringYesThe token of the webhook
optionsPick<RequestData, 'signal'>YesThe options to use when fetching the webhook
getMessage(id, token, messageId, query?, options?):Promise<APIMessage>
Fetches an associated message from a webhook
NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook
tokenstringNoThe token of the webhook
messageIdSnowflakeNoThe id of the message to fetch
queryRESTGetAPIWebhookWithTokenMessageQueryYesThe query options to use when fetching the message
optionsPick<RequestData, 'signal'>YesThe options to use when fetching the message