guilded.ts
Version:
A powerful NPM module that allows you to easily interact with the Guilded API.
64 lines • 2.62 kB
TypeScript
import { BaseManager, FetchManyOptions, FetchOptions } from '../BaseManager';
import { Channel } from '../../structures/channel/Channel';
import { Webhook } from '../../structures/Webhook';
import { Collection } from '@discordjs/collection';
import { APIEmbed, APIWebhookMessagePayload } from 'guilded-api-typings';
import { Embed } from '@guildedts/builders';
/**
* The manager of webhooks that belong to a channel.
* @example new ChannelWebhookManager(channel);
*/
export declare class ChannelWebhookManager extends BaseManager<string, Webhook> {
readonly channel: Channel;
/** @param channel The channel the webhooks belong to. */
constructor(channel: Channel);
/**
* Fetch a webhook from the channel, or cache.
* @param webhook The webhoook to fetch.
* @param options The options to fetch the webhook with.
* @returns The fetched webhook.
* @example webhooks.fetch(webhook);
*/
fetch(webhook: string | Webhook, options?: FetchOptions): Promise<Webhook>;
/**
* Fetch multiple webhooks from the channel.
* @param options The options to fetch webhooks with.
* @returns The fetched webhooks.
* @example webhooks.fetch();
*/
fetch(options?: FetchManyOptions): Promise<Collection<string, Webhook>>;
/** @ignore */
private fetchSingle;
/** @ignore */
private fetchMany;
/**
* Create a webhook in the channel.
* @param name The name of the webhook.
* @returns The created webhook.
* @example webhooks.create('My Webhook');
*/
create(name: string): Promise<Webhook>;
/**
* Edit a webhook in the channel.
* @param webhook The webhook to edit.
* @param name The name of the webhook.
* @param channelId The ID of the channel to move the webhook to.
* @returns The edited webhook.
* @example webhooks.edit(webhook, 'My Webhook');
*/
edit(webhook: string | Webhook, name: string, channelId?: string): Promise<Webhook>;
/**
* Delete a webhook in the channel.
* @param webhook The webhook to delete.
* @example webhooks.delete(webhook);
*/
delete(webhook: string | Webhook): Promise<void>;
}
/** The payload for creating a webhook message. */
export interface WebhookMessagePayload extends Omit<APIWebhookMessagePayload, 'embeds'> {
/** The embeds of the message. */
embeds?: (Embed | APIEmbed)[];
}
/** The resolvable payload for creating a webhook message. */
export declare type WebhookMessagePayloadResolvable = string | (Embed | APIEmbed)[] | WebhookMessagePayload;
//# sourceMappingURL=ChannelWebhookManager.d.ts.map