dressed
v1.10.1
Published
A sleek, serverless-ready Discord bot framework.
Maintainers
Readme
Dressed is a Discord bot library that allows you to host a bot using the interactions endpoint system for Discord.
Discord will send POST requests to your bot, instead of the websocket system that other libraries utilize.
One cool feature of Dressed is that you can make dynamic component IDs, so that you only need to write one component handler for many different scenarios. 👉 See more
You can find examples of bots ready to deploy on Cloudflare Workers, Vercel, and Deno Deploy in this repo.
🚀 Usage
bun add dressed// src/commands/ping.ts
import type { CommandConfig, CommandInteraction } from "dressed";
export const config = {
description: "Checks the API latency",
} satisfies CommandConfig;
export default async function (interaction: CommandInteraction<typeof config>) {
const start = Date.now();
const res = await interaction.deferReply({ ephemeral: true, with_response: true });
const delay = Date.parse(res.resource?.message?.timestamp ?? "") - start;
await interaction.editReply(`🏓 ${delay}ms`);
}You can then build and run the bot with:
bun dressed build -ir
bun .dressedFor more information on how to create a simple bot, check out the getting started guide.
Dressed includes a Node HTTP server out of the box.
If you'd prefer to create your own, all the functions you need are available within dressed/server.
