Search...

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, { reason, signal }?)

:

Promise<never>

NameTypeOptionalDescription
channelIdSnowflakeNoThe id of the channel to create the webhook in
bodyRESTPostAPIChannelWebhookJSONBodyNoThe data to use when creating the webhook
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

delete(id, { token, reason, signal }?)

:

Promise<void>

NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook to delete
{ token, reason, signal }Pick<RequestData, 'reason' | 'signal'> & { token?: string | undefined; }YesNone

deleteMessage(id, token, messageId, query?, { signal }?)

:

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
{ signal }Pick<RequestData, 'signal'>YesNone

edit(id, body, { token, reason, signal }?)

:

Promise<APIWebhook>

NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook to edit
bodyRESTPatchAPIWebhookJSONBodyNoThe new webhook data
{ token, reason, signal }Pick<RequestData, 'reason' | 'signal'> & { token?: string | undefined; }YesNone

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

:

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
{ thread_id, files, ...body }RESTPatchAPIWebhookWithTokenMessageJSONBody & { files?: RawFile[]; thread_id?: string; }NoNone
{ signal }Pick<RequestData, 'signal'>YesNone

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

execute(id, token, body, options?)

:

Promise<void>

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, body, query?, { signal }?)

:

Promise<void>

NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook
tokenstringNoThe token of the webhook
bodyunknownNoNone
queryRESTPostAPIWebhookWithTokenGitHubQueryYesThe options to use when executing the webhook
{ signal }Pick<RequestData, 'signal'>YesNone

executeSlack(id, token, body, query?, { signal }?)

:

Promise<void>

NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook
tokenstringNoThe token of the webhook
bodyunknownNoNone
queryRESTPostAPIWebhookWithTokenSlackQueryYesThe query options to use when executing the webhook
{ signal }Pick<RequestData, 'signal'>YesNone

get(id, token?, { signal }?)

:

Promise<APIWebhook>

NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook
tokenstringYesThe token of the webhook
{ signal }Pick<RequestData, 'signal'>YesNone

getMessage(id, token, messageId, query?, { signal }?)

:

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
{ signal }Pick<RequestData, 'signal'>YesNone