Search...

WebhooksAPI

declare class WebhooksAPI 
declare class WebhooksAPI 

No summary provided.

constructor(rest)

Constructs a new instance of the WebhooksAPI class
NameTypeOptionalDescription
restRESTNoNone

create(channelId, data, reason?)

:

Promise<never>

NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to create the webhook in
dataRESTPostAPIChannelWebhookJSONBodyNoThe data to use when creating the webhook
reasonstringYesThe reason for creating the webhook

delete(id, { token, reason }?)

:

Promise<void>

NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook to delete
{ token, reason }{ reason?: string; token?: string; }YesNone

deleteMessage(id, token, messageId, 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
options{ thread_id?: string; }YesThe options to use when deleting the message

edit(id, webhook, { token, reason }?)

:

Promise<discord_api_types_v10.APIWebhook>

NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook to edit
webhookRESTPatchAPIWebhookJSONBodyNoThe new webhook data
{ token, reason }{ reason?: string; token?: string; }YesNone

editMessage(id, token, messageId, { thread_id, ...body })

:

Promise<discord_api_types_v10.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
{ thread_id, ...body }RESTPatchAPIWebhookWithTokenMessageJSONBody & { thread_id?: string; }NoNone

execute(id, token, data)

:

Promise<RESTPostAPIWebhookWithTokenWaitResult>

Executes a webhook and returns the created message
NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook
tokenstringNoThe token of the webhook
dataRESTPostAPIWebhookWithTokenJSONBody & RESTPostAPIWebhookWithTokenQuery & { files?: RawFile[]; wait: true; }NoThe data to use when executing the webhook

execute(id, token, data)

:

Promise<void>

Executes a webhook and returns the created message
NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook
tokenstringNoThe token of the webhook
dataRESTPostAPIWebhookWithTokenJSONBody & RESTPostAPIWebhookWithTokenQuery & { files?: RawFile[]; wait: true; }NoThe data to use when executing the webhook

executeGitHub(id, token, body, options?)

:

Promise<void>

NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook
tokenstringNoThe token of the webhook
bodyunknownNoNone
optionsRESTPostAPIWebhookWithTokenGitHubQueryYesThe options to use when executing the webhook

executeSlack(id, token, body, options?)

:

Promise<void>

NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook
tokenstringNoThe token of the webhook
bodyunknownNoNone
optionsRESTPostAPIWebhookWithTokenSlackQueryYesThe options to use when executing the webhook

get(id, token?)

:

Promise<discord_api_types_v10.APIWebhook>

NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook
tokenstringYesThe token of the webhook

getMessage(id, token, messageId, options?)

:

Promise<discord_api_types_v10.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
options{ thread_id?: string; }YesThe options to use when fetching the message