Dressed
Dressed is a Discord bot framework with 100% API support. It allows you to host a bot using the interactions endpoint system for Discord.
For more information on common functions (e.g. getUser, createChannel, etc.), see the docs on JSR
Discord will send POST requests to your bot, instead of the websocket system that Discord.js utilizes.
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 an example of some bots ready to deploy on Deno deploy in this repo.
Installation
deno add jsr:@dressed/dressed
// src/commands/ping.ts
import type { CommandConfig, CommandInteraction } from "@dressed/dressed";
export const config: CommandConfig = {
description: "Returns pong",
};
export default async function ping(interaction: CommandInteraction) {
await interaction.reply({
content: "Pong!",
ephemeral: true,
});
}
You can then build and run the bot with this command
deno run -A jsr:@dressed/cmd build -i -r
deno run -A bot.gen.ts
By default the builder outputs only boilerplate data, if you want it to
include an instance creator, add -i
when running the build command.
In order to register the commands for your bot, also run the build command with -r
(requires -i
).
In addition to Dressed, I'd recommend installing Discord API Types (The type lib that Dressed uses internally).
Dressed comes with a serve system for Deno projects, but otherwise you'll have to BYO (all the functions needed to do so are available). The all-runtime-compatible example uses a server made with Express.