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, 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, options?):Promise<void>
NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook to delete
options{ reason?: string; token?: string; }YesThe options to use when deleting the webhook
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, options?):Promise<APIWebhook>
NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook to edit
webhookRESTPatchAPIWebhookJSONBodyNoThe new webhook data
options{ reason?: string; token?: string; }YesThe options to use when editing the webhook
editMessage(id, token, messageId, data):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
dataRESTPatchAPIWebhookWithTokenMessageJSONBody & { thread_id?: string; }NoThe data to use when editing the message
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, options, options?):Promise<void>
NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook
tokenstringNoThe token of the webhook
optionsunknownNoThe options to use when executing the webhook
optionsRESTPostAPIWebhookWithTokenGitHubQueryYesThe options to use when executing the webhook
executeSlack(id, token, options, options?):Promise<void>
NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook
tokenstringNoThe token of the webhook
optionsunknownNoThe options to use when executing the webhook
optionsRESTPostAPIWebhookWithTokenSlackQueryYesThe options to use when executing the webhook
get(id, token?):Promise<APIWebhook>
NameTypeOptionalDescription
idSnowflakeNoThe id of the webhook
tokenstringYesThe token of the webhook
getMessage(id, token, messageId, 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
options{ thread_id?: string; }YesThe options to use when fetching the message