UNPKG

dressed

Version:

A sleek, serverless-ready Discord bot framework.

45 lines 1.36 kB
import { Routes } from "discord-api-types/v10"; import { callDiscord } from "../utils/call-discord.js"; /** * Creates a new Stage instance associated to a Stage channel. * @param data The data to create the Stage instance with */ export async function createStage(data) { const res = await callDiscord(Routes.stageInstances(), { method: "POST", body: data, }); return res.json(); } /** * Gets the stage instance associated with the Stage channel, if it exists. * @param channel The channel to get the Stage instance for */ export async function getStage(channel) { const res = await callDiscord(Routes.stageInstance(channel), { method: "GET", }); return res.json(); } /** * Updates fields of an existing Stage instance. * @param channel The channel to modify the Stage instance for * @param data The new data for the Stage instance */ export async function modifyStage(channel, data) { const res = await callDiscord(Routes.stageInstance(channel), { method: "PATCH", body: data, }); return res.json(); } /** * Deletes the Stage instance. * @param channel The channel to delete the Stage instance for */ export async function deleteStage(channel) { await callDiscord(Routes.stageInstance(channel), { method: "DELETE", }); } //# sourceMappingURL=stages.js.map