UNPKG

dressed

Version:

A sleek, serverless-ready Discord bot framework.

110 lines (109 loc) 5.51 kB
import type { APIMessage, RESTGetAPIChannelMessageReactionUsersQuery, RESTGetAPIChannelMessageReactionUsersResult, RESTGetAPIChannelMessageResult, RESTGetAPIChannelMessagesPinsQuery, RESTGetAPIChannelMessagesPinsResult, RESTGetAPIChannelMessagesQuery, RESTGetAPIChannelMessagesResult, RESTGetAPIChannelPinsResult, RESTPatchAPIChannelMessageJSONBody, RESTPostAPIChannelMessageCrosspostResult, RESTPostAPIChannelMessageJSONBody, RESTPostAPIChannelMessageResult, Snowflake } from "discord-api-types/v10"; import type { RawFile } from "../types/file.ts"; /** * Lists the messages in a channel. * @param channel The channel to get the messages from * @param options Optional parameters for the request */ export declare function listMessages(channel: Snowflake, options?: RESTGetAPIChannelMessagesQuery): Promise<RESTGetAPIChannelMessagesResult>; /** * Retrieves a specific message in the channel. * @param channel The channel to get the message from * @param message The snowflake of the message to get */ export declare function getMessage(channel: Snowflake, message: Snowflake): Promise<RESTGetAPIChannelMessageResult>; /** * Post a message to a guild text or DM channel. * @param channel The channel to post the message in * @param data The message data */ export declare function createMessage(channel: Snowflake, data: string | (RESTPostAPIChannelMessageJSONBody & { files?: RawFile[]; })): Promise<RESTPostAPIChannelMessageResult>; /** * Crosspost a message in an Announcement Channel to following channels. * @param channel The channel to post from * @param message The snowflake of the message to crosspost */ export declare function crosspostMessage(channel: Snowflake, message: Snowflake): Promise<RESTPostAPIChannelMessageCrosspostResult>; /** * Adds a reaction to a message. * @param channel The channel to add the reaction in * @param message The message to add the reaction to * @param emoji The emoji to react with */ export declare function createReaction(channel: Snowflake, message: Snowflake, emoji: string): Promise<void>; /** * Deletes a reaction from a message. * @param channel The channel to delete the reaction in * @param message The message to delete the reaction from * @param emoji The emoji to delete * @param user The user to delete the reaction for (defaults to self) */ export declare function deleteReaction(channel: Snowflake, message: Snowflake, emoji: string, user?: Snowflake): Promise<void>; /** * Get a list of users that reacted with this emoji. * @param channel The channel to get the reaction in * @param message The message to get the reaction from * @param emoji The emoji to list * @param options Optional parameters for the request */ export declare function listReactions(channel: Snowflake, message: Snowflake, emoji: string, options?: RESTGetAPIChannelMessageReactionUsersQuery): Promise<RESTGetAPIChannelMessageReactionUsersResult>; /** * Deletes all reactions on a message. * @param channel The channel to delete the reactions in * @param message The message to delete the reactions from */ export declare function deleteAllReactions(channel: Snowflake, message: Snowflake): Promise<void>; /** * Deletes all reactions of a specific emoji on a message. * @param channel The channel to delete the reactions in * @param message The message to delete the reactions from * @param emoji The emoji to delete */ export declare function deleteAllEmojiReactions(channel: Snowflake, message: Snowflake, emoji: string): Promise<void>; /** * Edit a previously sent message. * @param channel The channel to edit the message in * @param message The snowflake of the message to edit * @param data The new message data */ export declare function editMessage(channel: Snowflake, message: Snowflake, data: string | (RESTPatchAPIChannelMessageJSONBody & { files?: RawFile[]; })): Promise<APIMessage>; /** * Delete a message. If operating on a guild channel and trying to delete a message that was not sent by the current user, this endpoint requires the `MANAGE_MESSAGES` permission. * @param channel The channel to delete the message from * @param message The snowflake of the message to delete */ export declare function deleteMessage(channel: Snowflake, message: Snowflake): Promise<void>; /** * Delete multiple messages in a single request. * @param channel The channel to delete messages from * @param messages An array of snowflakes */ export declare function bulkDelete(channel: Snowflake, messages: Snowflake[]): Promise<void>; /** * Returns all pinned messages in the channel. * @param channel The channel to find the pins for * @deprecated Use `listChannelPins` */ export declare function listPins(channel: Snowflake): Promise<RESTGetAPIChannelPinsResult>; /** * Retrieves the list of pins in a channel. * @param channel The channel to find the pins for * @param options Optional parameters for the request */ export declare function listChannelPins(channel: Snowflake, options?: RESTGetAPIChannelMessagesPinsQuery): Promise<RESTGetAPIChannelMessagesPinsResult>; /** * Pin a message in a channel. * @param channel The channel to pin the message in * @param message The message to pin */ export declare function createPin(channel: Snowflake, message: Snowflake): Promise<void>; /** * Unpin a message in a channel. * @param channel The channel to unpin the message in * @param message The message to unpin */ export declare function deletePin(channel: Snowflake, message: Snowflake): Promise<void>;