import { type WebhookMessageStructure, type WebhookStructure } from '../../client/transformers'; import { type MessageWebhookMethodEditParams, type MessageWebhookMethodWriteParams, type MessageWebhookMethodWriteWaitParams } from '../../structures'; import type { RESTPatchAPIWebhookJSONBody, RESTPatchAPIWebhookWithTokenJSONBody, RESTPostAPIChannelWebhookJSONBody, RESTPostAPIWebhookWithTokenQuery } from '../../types'; import type { MakeRequired, OmitInsert } from '../types/util'; import { BaseShorter } from './base'; export declare class WebhookShorter extends BaseShorter { create(channelId: string, body: RESTPostAPIChannelWebhookJSONBody): Promise; /** * Deletes a webhook. * @param webhookId The ID of the webhook. * @param options The optional parameters including token and reason. * @returns A Promise that resolves when the webhook is deleted. */ delete(webhookId: string, options: WebhookShorterOptionalParams): Promise; /** * Edits a webhook. * @param webhookId The ID of the webhook. * @param body The data to update the webhook with. * @param options The optional parameters including token and reason. * @returns A Promise that resolves when the webhook is edited. */ edit(webhookId: string, body: RESTPatchAPIWebhookWithTokenJSONBody | RESTPatchAPIWebhookJSONBody, options: WebhookShorterOptionalParams): Promise; /** * Fetches a webhook. * @param webhookId The ID of the webhook. * @param token The token of the webhook (optional). * @returns A Promise that resolves to the fetched webhook. */ fetch(webhookId: string, token?: string): Promise; /** * Writes a message using the webhook. * @param webhookId The ID of the webhook. * @param token The token of the webhook. * @param data The data for writing the message. * @returns A Promise that resolves to the written message. */ writeMessage(webhookId: string, token: string, payload: MessageWebhookMethodWriteWaitParams): Promise; writeMessage(webhookId: string, token: string, payload: MessageWebhookMethodWriteParams): Promise; /** * Edits a message sent by the webhook. * @param webhookId The ID of the webhook. * @param token The token of the webhook. * @param messageId The ID of the message to edit. * @param data The data for editing the message. * @returns A Promise that resolves to the edited message. */ editMessage(webhookId: string, token: string, { messageId, body: data, ...json }: MessageWebhookMethodEditParams): Promise; /** * Deletes a message sent by the webhook. * @param webhookId The ID of the webhook. * @param token The token of the webhook. * @param messageId The ID of the message to delete. * @param reason The reason for deleting the message. * @returns A Promise that resolves when the message is deleted. */ deleteMessage(payload: WebhookShorterMessageDeleteParams): Promise; /** * Fetches a message sent by the webhook. * @param webhookId The ID of the webhook. * @param token The token of the webhook. * @param messageId The ID of the message to fetch. * @param threadId The ID of the thread the message belongs to. * @returns A Promise that resolves to the fetched message */ fetchMessage(payload: WebhookShorterMessageFetchParams): Promise; listFromGuild(guildId: string): Promise; listFromChannel(channelId: string): Promise; } export type WebhookShorterOptionalParams = Partial<{ token: string; reason: string; }>; export interface WebhookShorterMessageParameters { webhookId: string; token: string; messageId?: string; reason?: string; } export type WebhookShorterMessageParams = OmitInsert & (Query extends never ? {} : { query?: Pick; })>; export type WebhookShorterMessageDeleteParams = WebhookShorterMessageParams<'thread_id', 'messageId'>; export type WebhookShorterMessageFetchParams = Omit, 'reason'>;