dressed
Version:
A sleek, serverless-ready Discord bot framework.
116 lines (115 loc) • 6.08 kB
TypeScript
import type { APIMessage, APIThreadChannel, RESTDeleteAPIChannelResult, RESTGetAPIChannelInvitesResult, RESTGetAPIChannelResult, RESTGetAPIChannelThreadMemberQuery, RESTGetAPIChannelThreadMemberResult, RESTGetAPIChannelThreadMembersResult, RESTGetAPIChannelThreadsArchivedQuery, RESTGetAPIChannelUsersThreadsArchivedResult, RESTPatchAPIChannelJSONBody, RESTPatchAPIChannelResult, RESTPostAPIChannelFollowersResult, RESTPostAPIChannelInviteJSONBody, RESTPostAPIChannelInviteResult, RESTPostAPIChannelThreadsJSONBody, RESTPostAPIChannelThreadsResult, RESTPostAPIGuildForumThreadsJSONBody, RESTPutAPIChannelPermissionJSONBody, RESTPutAPIChannelRecipientJSONBody, Snowflake } from "discord-api-types/v10";
import type { RawFile } from "../types/file.ts";
/**
* Get a channel by ID.
* @param channel The channel to fetch
*/
export declare function getChannel(channel: Snowflake): Promise<RESTGetAPIChannelResult>;
/**
* Update a channel's settings.
* @param channel The channel to modify
* @param data The new data for the channel
*/
export declare function modifyChannel(channel: Snowflake, data: RESTPatchAPIChannelJSONBody): Promise<RESTPatchAPIChannelResult>;
/**
* Delete a channel, or close a private message.
* @param channel The channel to delete
*/
export declare function deleteChannel(channel: Snowflake): Promise<RESTDeleteAPIChannelResult>;
/**
* Edit the channel permission overwrites for a user or role in a channel.
* @param channel The channel to affect
* @param overwrite The permission overwrite to modify
*/
export declare function modifyChannelPermissions(channel: Snowflake, overwrite: Snowflake, data: RESTPutAPIChannelPermissionJSONBody): Promise<void>;
/**
* Get a list of invites for a channel.
* @param channel The channel to fetch from
*/
export declare function listChannelInvites(channel: Snowflake): Promise<RESTGetAPIChannelInvitesResult>;
/**
* Create a new invite object for a channel.
* @param channel The channel to create the invite for
*/
export declare function createChannelInvite(channel: Snowflake, data: RESTPostAPIChannelInviteJSONBody): Promise<RESTPostAPIChannelInviteResult>;
/**
* Delete a channel permission overwrite for a user or role in a channel.
* @param channel The channel to affect
* @param overwrite The permission overwrite to delete
*/
export declare function deleteChannelPermissions(channel: Snowflake, overwrite: Snowflake): Promise<void>;
/**
* Follow an Announcement Channel to send messages to a target channel.
* @param channel The announcement channel to follow
* @param target The target channel to send messages to
*/
export declare function followChannel(channel: Snowflake, target: Snowflake): Promise<RESTPostAPIChannelFollowersResult>;
/**
* Sends a typing indicator for the specified channel, which expires after 10 seconds.
* @param channel The channel to start typing in
*/
export declare function createTypingIndicator(channel: Snowflake): Promise<void>;
/**
* Adds a recipient to a Group DM using their access token.
* @param channel The channel to add the recipient to
* @param user The user to add
*/
export declare function addGDMMember(channel: Snowflake, user: Snowflake, data: RESTPutAPIChannelRecipientJSONBody): Promise<void>;
/**
* Removes a recipient to a Group DM.
* @param channel The channel to remove the recipient from
* @param user The user remove
*/
export declare function removeGDMMember(channel: Snowflake, user: Snowflake): Promise<void>;
/**
* Creates a new thread, include a message ID to start the thread from that message.
* @param channel The channel to create the thread in
* @param data The thread data
* @param message The message to create the thread from
*/
export declare function createThread(channel: Snowflake, data: Omit<RESTPostAPIChannelThreadsJSONBody, "type"> & {
type?: "Public" | "Private" | number;
}, message?: Snowflake): Promise<RESTPostAPIChannelThreadsResult>;
/**
* Creates a new forum thread.
* @param channel The channel to create the thread in
* @param data The thread data
*/
export declare function createForumThread(channel: Snowflake, data: RESTPostAPIGuildForumThreadsJSONBody & {
files?: RawFile[];
}): Promise<APIThreadChannel & {
message: APIMessage;
}>;
/**
* Adds a member to a thread.
* @param thread The thread to add the user to
* @param user The user to add to the thread (defaults to self)
*/
export declare function addThreadMember(thread: Snowflake, user?: Snowflake): Promise<void>;
/**
* Removes a member from a thread.
* @param thread The thread to remove the user from
* @param user The user to remove from the thread (defaults to self)
*/
export declare function removeThreadMember(thread: Snowflake, user?: Snowflake): Promise<void>;
/**
* Returns a thread member object if the user is a member of the thread.
* @param thread The thread to get the user from
* @param user The user to get from the thread
* @param options Optional parameters for the request
*/
export declare function getThreadMember(thread: Snowflake, user: Snowflake, options?: RESTGetAPIChannelThreadMemberQuery): Promise<RESTGetAPIChannelThreadMemberResult>;
/**
* Returns a list of thread members in the thread.
* @param thread The thread to get from
* @param options Optional parameters for the request
*/
export declare function listThreadMembers(thread: Snowflake, options?: RESTGetAPIChannelThreadMemberQuery): Promise<RESTGetAPIChannelThreadMembersResult>;
/**
* Returns a list of archived threads in the channel. Alternatively, returns a list of joined private threads in the channel.
* @param channel The channel to get from
* @param publicThreads Whether to get public or private threads
* @param joinedOnly Whether to only return private threads the user has joined (will force publicThreads to false)
* @param options Optional parameters for the request
*/
export declare function listArchivedThreads(channel: Snowflake, publicThreads: boolean, joinedOnly?: boolean, options?: RESTGetAPIChannelThreadsArchivedQuery): Promise<RESTGetAPIChannelUsersThreadsArchivedResult>;